feat: add notifications for MacOS using Applescript (#160)

yolo'ed it with codex. Let me know if this looks good to you.

https://github.com/openai/codex/issues/148

tested with:
```
npm run build:dev
```

<img width="377" alt="Screenshot 2025-04-16 at 18 12 01"
src="https://github.com/user-attachments/assets/79aa799b-b0b9-479d-84f1-bfb83d34bfb9"
/>
This commit is contained in:
kchro3
2025-04-17 16:19:26 -07:00
committed by GitHub
parent be7e3fd377
commit 0a2e416b7a
11 changed files with 73 additions and 10 deletions

View File

@@ -96,7 +96,7 @@ describe("cancel before first function_call", () => {
onLoading: () => {},
getCommandConfirmation: async () => ({ review: "yes" } as any),
onLastResponseId: () => {},
config: { model: "any", instructions: "" },
config: { model: "any", instructions: "", notify: false },
});
// Start first run.

View File

@@ -104,7 +104,7 @@ describe("cancel clears previous_response_id", () => {
onLoading: () => {},
getCommandConfirmation: async () => ({ review: "yes" } as any),
onLastResponseId: () => {},
config: { model: "any", instructions: "" },
config: { model: "any", instructions: "", notify: false },
});
// First run that triggers a function_call, but we will cancel *before* the

View File

@@ -95,7 +95,7 @@ describe("Agent cancellation race", () => {
additionalWritableRoots: [],
model: "any",
instructions: "",
config: { model: "any", instructions: "" },
config: { model: "any", instructions: "", notify: false },
approvalPolicy: { mode: "auto" } as any,
onItem: (i) => items.push(i),
onLoading: () => {},

View File

@@ -89,7 +89,7 @@ describe("Agent cancellation", () => {
const agent = new AgentLoop({
model: "any",
instructions: "",
config: { model: "any", instructions: "" },
config: { model: "any", instructions: "", notify: false },
approvalPolicy: { mode: "auto" } as any,
additionalWritableRoots: [],
onItem: (item) => {
@@ -140,7 +140,7 @@ describe("Agent cancellation", () => {
additionalWritableRoots: [],
model: "any",
instructions: "",
config: { model: "any", instructions: "" },
config: { model: "any", instructions: "", notify: false },
approvalPolicy: { mode: "auto" } as any,
onItem: (item) => received.push(item),
onLoading: () => {},

View File

@@ -41,6 +41,7 @@ describe("Agent interrupt and continue", () => {
config: {
model: "test-model",
instructions: "",
notify: false,
},
onItem: (item) => received.push(item),
onLoading: (loading) => {

View File

@@ -111,7 +111,7 @@ describe("Agent terminate (hard cancel)", () => {
const agent = new AgentLoop({
model: "any",
instructions: "",
config: { model: "any", instructions: "" },
config: { model: "any", instructions: "", notify: false },
approvalPolicy: { mode: "auto" } as any,
additionalWritableRoots: [],
onItem: (item) => received.push(item),
@@ -147,7 +147,7 @@ describe("Agent terminate (hard cancel)", () => {
const agent = new AgentLoop({
model: "any",
instructions: "",
config: { model: "any", instructions: "" },
config: { model: "any", instructions: "", notify: false },
approvalPolicy: { mode: "auto" } as any,
additionalWritableRoots: [],
onItem: () => {},

View File

@@ -68,6 +68,7 @@ test("saves and loads config correctly", () => {
const testConfig = {
model: "test-model",
instructions: "test instructions",
notify: false,
};
saveConfig(testConfig, testConfigPath, testInstructionsPath);