Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,5 @@ jobs:
with:
node-version: 22
- run: cd apps/push-relay && npm ci
- name: Deploy Worker
run: cd apps/push-relay && npx wrangler deploy
- name: Apply D1 migrations and deploy Worker
run: cd apps/push-relay && npm run deploy
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ package-lock.json
/apps/desktop/release-alpha
/apps/desktop/release-beta
apps/desktop/resources/runtime/ade-*
apps/desktop/resources/native/ade-attention-notch
apps/desktop/resources/native/ADEAttentionNotch_ADEAttentionNotch.bundle/
apps/desktop/native/ADEAttentionNotch/.build/
apps/desktop/native/ADEAttentionNotch/.build-*/
# Large whisper.cpp binary + ~140 MB ggml model are materialized at build time,
# never committed (see scripts/materialize-whisper-resources.mjs). Keep the dir +
# its README/.gitkeep tracked; ignore the heavy binaries/model.
Expand Down
36 changes: 34 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,39 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

================================================================================
2. whisper.cpp
2. Lobe Icons
================================================================================

Upstream: https://github.com/lobehub/lobe-icons
Copyright: Copyright (c) 2023 LobeHub
License: MIT
Bundled as: apps/desktop/native/ADEAttentionNotch/Sources/ADEAttentionNotch/
Resources/ProviderIcons/*.svg

MIT License

Copyright (c) 2023 LobeHub

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

================================================================================
3. whisper.cpp
================================================================================

Upstream: https://github.com/ggerganov/whisper.cpp
Expand Down Expand Up @@ -76,7 +108,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

================================================================================
3. ggml
4. ggml
================================================================================

Upstream: https://github.com/ggerganov/ggml
Expand Down
2 changes: 2 additions & 0 deletions apps/ade-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ ade storage compress --text # losslessly compress old c
ade --role cto storage maintenance --text # run the policy-driven ledger maintenance sweep now (CTO)
ade storage actions --text # raw storage service actions (cleanupPreview/cleanup live here)
ade actions list --domain chat --text
ade --role cto actions list --domain attention --text # discover account-wide Attention actions
ade --role cto actions run attention.getSnapshot --input-json '{"since":0}' --json
ade actions run git.stageFile --arg laneId=lane-id --arg path=src/index.ts
ade actions run pty.resumeSession --arg sessionId=session-id
ade cursor cloud agents list --text
Expand Down
60 changes: 60 additions & 0 deletions apps/ade-cli/src/adeRpcServer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,66 @@ describe("adeRpcServer", () => {
expect(allDomains.structuredContent.actions.some((entry: { domain: string }) => entry.domain === "graph_state")).toBe(true);
});

it("exposes account-wide Attention actions only to CTO callers with discoverable contracts", async () => {
const fixture = createRuntime();
const getAttentionSnapshot = vi.fn(async (since: number, streamId: string | null) => ({
contractVersion: 1,
streamId: streamId ?? "account-stream",
revision: since + 1,
generatedAt: "2026-07-28T12:00:00.000Z",
machines: [],
items: [],
tombstones: [],
}));
(fixture.runtime as any).pushPublisherService = {
getAttentionSnapshot,
acknowledgeAttention: vi.fn(async () => undefined),
reportAttentionPresence: vi.fn(async () => undefined),
getAttentionPreferences: vi.fn(async () => ({})),
putAttentionPreferences: vi.fn(async () => undefined),
};

const agentHandler = createAdeRpcRequestHandler({ runtime: fixture.runtime, serverVersion: "test" });
await initialize(agentHandler, { callerId: "agent-1", role: "agent" });
const hidden = await callTool(agentHandler, "list_ade_actions", { domain: "attention" });
expect(hidden?.isError).toBeUndefined();
expect(hidden.structuredContent).toMatchObject({ count: 0, actions: [] });

const ctoHandler = createAdeRpcRequestHandler({ runtime: fixture.runtime, serverVersion: "test" });
await initialize(ctoHandler, { callerId: "cto-1", role: "cto" });
const inventory = await callTool(ctoHandler, "list_ade_actions", { domain: "attention" });
expect(inventory?.isError).toBeUndefined();
expect(inventory.structuredContent.actions.map((entry: { name: string }) => entry.name)).toEqual(
expect.arrayContaining([
"attention.getSnapshot",
"attention.acknowledge",
"attention.reportPresence",
"attention.getPreferences",
"attention.putPreferences",
]),
);
const getSnapshotAction = inventory.structuredContent.actions.find(
(entry: { name: string }) => entry.name === "attention.getSnapshot",
);
expect(getSnapshotAction).toMatchObject({
description: expect.stringContaining("account-wide Attention stream"),
input: expect.stringContaining("streamId"),
example: expect.stringContaining("attention.getSnapshot"),
});

const snapshot = await callTool(ctoHandler, "run_ade_action", {
domain: "attention",
action: "getSnapshot",
args: { since: 7, streamId: "account-stream" },
});
expect(snapshot?.isError).toBeUndefined();
expect(snapshot.structuredContent.result).toMatchObject({
streamId: "account-stream",
revision: 8,
});
expect(getAttentionSnapshot).toHaveBeenCalledWith(7, "account-stream");
});

it("invokes ADE actions dynamically and returns status hints", async () => {
const fixture = createRuntime();
const handler = createAdeRpcRequestHandler({ runtime: fixture.runtime, serverVersion: "test" });
Expand Down
42 changes: 35 additions & 7 deletions apps/ade-cli/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,7 @@ export async function createAdeRuntime(args: {
if (event.type === "pr-notification" && pushPrNotificationSubscribers.size > 0) {
const notification: PushPrNotification = {
kind: event.kind,
prId: event.prId,
prNumber: event.prNumber,
prTitle: event.prTitle ?? null,
laneId: event.laneId ?? null,
Expand Down Expand Up @@ -1426,14 +1427,45 @@ export async function createAdeRuntime(args: {
// push-identity file), so a run in one project doesn't clobber the phone's
// single "agent-runs" Live Activity for another. Each scope wires its own
// chat/pty/PR signals via attachSources; the aggregate merges runs across all.
// This is also the canonical account-directory identity used to route an
// Attention click back to this exact machine, even when another machine has
// a project at the same path.
const { createSyncCloudRelayStore } = await import("./services/sync/syncCloudRelayStore");
const cloudRelayFilePath = path.join(
resolvedArgs.syncRuntime?.phonePairingStateDir ?? resolveMachineAdeLayout().secretsDir,
"sync-cloud-relay.json",
);
const cloudRelayStore = createSyncCloudRelayStore({ filePath: cloudRelayFilePath });
const syncDeviceIdPath = path.join(
resolvedArgs.syncRuntime?.phonePairingStateDir ?? resolveMachineAdeLayout().secretsDir,
"sync-device-id",
);
const pushRelayFilePath = resolvePushRelayStateFile(resolveMachineAdeLayout().secretsDir);
const pushPublisherService = getSharedPushPublisherService(pushRelayFilePath, () => {
const store = createPushRegistrationStore({ filePath: pushRelayFilePath });
return {
logger,
store,
relayClient: createPushRelayClient({ store, logger }),
relayClient: createPushRelayClient({
store,
logger,
getAccountAccessToken,
getAccountUserId: () => {
const status = accountAuthService.getStatus();
return status.signedIn ? status.userId?.trim() || null : null;
},
}),
machineName: os.hostname(),
getAccountMachineIdentity: () => {
const { machineKey } = cloudRelayStore.getMachineIdentity();
let deviceId: string | null = null;
try {
deviceId = fs.readFileSync(syncDeviceIdPath, "utf8").trim() || null;
} catch {
deviceId = null;
}
return { machineKey, deviceId };
},
};
});
const detachPushSources = publishPushEvents
Expand All @@ -1445,6 +1477,8 @@ export async function createAdeRuntime(args: {
? agentChatService
: null,
ptyService,
projectName: project.displayName,
projectRoot,
subscribePrNotifications: (cb) => {
pushPrNotificationSubscribers.add(cb);
return () => pushPrNotificationSubscribers.delete(cb);
Expand Down Expand Up @@ -1551,13 +1585,7 @@ export async function createAdeRuntime(args: {
// Cloud tunnel relay (phone → Cloudflare DO → this brain). The store
// instance is shared with the sync service so the relay candidate in
// pairingConnectInfo and the tunnel client use one machine identity.
const { createSyncCloudRelayStore } = await import("./services/sync/syncCloudRelayStore");
const { createSyncTunnelClientService, getSharedSyncTunnelClientService } = await import("./services/sync/syncTunnelClientService");
const cloudRelayFilePath = path.join(
resolvedArgs.syncRuntime?.phonePairingStateDir ?? resolveMachineAdeLayout().secretsDir,
"sync-cloud-relay.json",
);
const cloudRelayStore = createSyncCloudRelayStore({ filePath: cloudRelayFilePath });
// ONE tunnel client per machine (keyed by the config file): per-scope
// instances would re-register the same machineKey with the relay on every
// project open and churn the connection paired phones dial through.
Expand Down
22 changes: 15 additions & 7 deletions apps/ade-cli/src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2276,10 +2276,11 @@ describe("ADE CLI", () => {
expect(sendParams).toMatchObject({
arguments: {
domain: "chat",
action: "sendMessage",
action: "messageSession",
args: {
sessionId: "chat-new",
text: "Fix the tests",
kind: "auto",
},
},
});
Expand Down Expand Up @@ -2351,10 +2352,11 @@ describe("ADE CLI", () => {
name: "run_ade_action",
arguments: {
domain: "chat",
action: "sendMessage",
action: "messageSession",
args: {
sessionId: "chat-new",
text: "Fix login",
kind: "auto",
},
},
});
Expand Down Expand Up @@ -2768,10 +2770,11 @@ describe("ADE CLI", () => {
},
afterCreate: [
{
action: "chat.sendMessage",
action: "chat.messageSession",
input: {
sessionId: "<created-session-id>",
text: "Fix the tests",
kind: "auto",
},
},
],
Expand Down Expand Up @@ -2811,9 +2814,10 @@ describe("ADE CLI", () => {
},
},
{
action: "chat.sendMessage",
action: "chat.messageSession",
input: {
sessionId: "<created-session-id>",
kind: "auto",
},
},
],
Expand Down Expand Up @@ -5507,7 +5511,7 @@ describe("ADE CLI", () => {
},
result: {
domain: "chat",
action: "sendMessage",
action: "messageSession",
result: { ok: true, accepted: true, sessionId: "chat-new" },
},
},
Expand All @@ -5530,7 +5534,7 @@ describe("ADE CLI", () => {
},
result: {
domain: "chat",
action: "sendMessage",
action: "messageSession",
result: { ok: true, accepted: true, sessionId: "chat-new" },
},
},
Expand Down Expand Up @@ -7116,7 +7120,11 @@ describe("ADE CLI", () => {
chat: { domain: "chat", action: "createSession", result: { id: "session-new" } },
});
expect(sendParams).toMatchObject({
arguments: { domain: "chat", action: "sendMessage", args: { sessionId: "session-new" } },
arguments: {
domain: "chat",
action: "messageSession",
args: { sessionId: "session-new", kind: "auto" },
},
});
const sendArgs = (sendParams.arguments as { args: { text: string } }).args;
expect(sendArgs.text).toContain("ENG-431");
Expand Down
24 changes: 17 additions & 7 deletions apps/ade-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2274,6 +2274,10 @@ const HELP_BY_COMMAND: Record<string, string> = {
$ ade actions run pr.submitReview --args-list-json '["pr-1",{"event":"APPROVE"}]'
$ ade actions list --text Domain-grouped action catalog
$ ade actions list --domain git --text Narrow the catalog
$ ade --role cto actions list --domain attention --text
Discover account-wide Attention actions
$ ade --role cto actions run attention.getSnapshot --input-json '{"since":0}' --json
Read work across connected machines and projects
$ ade actions run <domain.action> --input-json '{"key":"value"}'
$ ade actions run <domain> <action> --input-json '{"key":"value"}'
$ ade actions status --text Runtime action availability
Expand Down Expand Up @@ -4528,7 +4532,9 @@ function buildNewChatPlan(args: string[], defaultMode: "chat" | "cli"): CliPlan
autoCreateLane: lane.autoCreateLane,
...(lane.createLaneArgs ? { createLane: lane.createLaneArgs } : { laneId: lane.laneId }),
launch: compactPreviewObject(launchArgs),
...(mode === "chat" && prompt ? { afterCreate: [{ action: "chat.sendMessage", text: prompt }] } : {}),
...(mode === "chat" && prompt
? { afterCreate: [{ action: "chat.messageSession", input: { text: prompt, kind: "auto" } }] }
: {}),
},
};
}
Expand Down Expand Up @@ -4598,10 +4604,11 @@ function buildNewChatPlan(args: string[], defaultMode: "chat" | "cli"): CliPlan
name: "run_ade_action",
arguments: {
domain: "chat",
action: "sendMessage",
action: "messageSession",
args: {
sessionId: targetSession,
text: prompt,
kind: "auto",
},
},
};
Expand Down Expand Up @@ -4725,10 +4732,11 @@ function buildChatCreateConfigPreview(
}
if (!options.noKickoff && options.kickoffText) {
afterCreate.push({
action: "chat.sendMessage",
action: "chat.messageSession",
input: {
sessionId: "<created-session-id>",
text: options.kickoffText,
kind: "auto",
},
});
}
Expand Down Expand Up @@ -4834,8 +4842,8 @@ function buildCreateLaneFromLinearPlan(args: string[], issue: JsonObject): CliPl
name: "run_ade_action",
arguments: {
domain: "chat",
action: "sendMessage",
args: { sessionId, text: kickoff },
action: "messageSession",
args: { sessionId, text: kickoff, kind: "auto" },
},
};
},
Expand Down Expand Up @@ -7288,10 +7296,11 @@ function buildChatPlan(args: string[]): CliPlan {
name: "run_ade_action",
arguments: {
domain: "chat",
action: "sendMessage",
action: "messageSession",
args: {
sessionId: targetSession,
text: explicitKickoff,
kind: "auto",
},
},
};
Expand Down Expand Up @@ -7340,10 +7349,11 @@ function buildChatPlan(args: string[]): CliPlan {
name: "run_ade_action",
arguments: {
domain: "chat",
action: "sendMessage",
action: "messageSession",
args: {
sessionId: targetSession,
text: explicitKickoff ?? deriveLinearKickoffPrompt(issueForKickoff),
kind: "auto",
},
},
};
Expand Down
Loading