@gajae-code/coding-agent 0.12.11 → 0.12.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/types/cli/notify-cli.d.ts +42 -1
- package/dist/types/cli/update-cli.d.ts +9 -3
- package/dist/types/commands/notify.d.ts +6 -0
- package/dist/types/config/file-lock.d.ts +3 -0
- package/dist/types/coordinator/contract.d.ts +1 -1
- package/dist/types/coordinator-mcp/question-state.d.ts +3 -1
- package/dist/types/extensibility/extensions/index.d.ts +1 -0
- package/dist/types/extensibility/extensions/ouroboros-ooo-bridge.d.ts +13 -0
- package/dist/types/extensibility/extensions/prefix-command-bridge.d.ts +0 -1
- package/dist/types/extensibility/extensions/types.d.ts +2 -0
- package/dist/types/main.d.ts +6 -2
- package/dist/types/modes/components/session-selector.d.ts +1 -1
- package/dist/types/modes/utils/host-status.d.ts +23 -0
- package/dist/types/runtime-mcp/types.d.ts +2 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +12 -0
- package/dist/types/sdk/bus/chat-daemon-cli.d.ts +3 -0
- package/dist/types/sdk/bus/chat-daemon-command-channel.d.ts +244 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +11 -1
- package/dist/types/sdk/bus/chat-daemon-runtime.d.ts +7 -0
- package/dist/types/sdk/bus/control-plane-frames.d.ts +43 -0
- package/dist/types/sdk/bus/conversation-store.d.ts +18 -0
- package/dist/types/sdk/bus/existing-thread-readiness.d.ts +71 -0
- package/dist/types/sdk/bus/notification-service.d.ts +10 -0
- package/dist/types/sdk/bus/slack-daemon.d.ts +27 -0
- package/dist/types/sdk/bus/slack-live-provider.d.ts +11 -0
- package/dist/types/sdk/bus/slack-provider.d.ts +14 -0
- package/dist/types/sdk/bus/slack-thread-binding.d.ts +140 -0
- package/dist/types/sdk/bus/telegram-daemon-cli.d.ts +2 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +24 -7
- package/dist/types/sdk/bus/telegram-daemon.d.ts +104 -16
- package/dist/types/sdk/bus/telegram-reference.d.ts +10 -1
- package/dist/types/sdk/bus/topic-registry.d.ts +130 -85
- package/dist/types/sdk/host/host.d.ts +52 -0
- package/dist/types/sdk/lifecycle-session.d.ts +6 -0
- package/dist/types/sdk/session-activation.d.ts +41 -0
- package/dist/types/sdk/session.d.ts +18 -0
- package/dist/types/sdk/startup-capability.d.ts +8 -1
- package/dist/types/session/agent-session.d.ts +7 -0
- package/dist/types/session/artifacts.d.ts +2 -2
- package/dist/types/session/session-manager.d.ts +23 -5
- package/dist/types/tools/index.d.ts +8 -0
- package/dist/types/utils/npm-registry.d.ts +71 -0
- package/examples/extensions/README.md +38 -4
- package/examples/extensions/ooo-bridge.ts +15 -0
- package/package.json +8 -8
- package/scripts/generate-sdk-operation-inventory.ts +4 -0
- package/src/async/job-manager.ts +9 -2
- package/src/cli/notify-cli.ts +226 -2
- package/src/cli/update-cli.ts +90 -23
- package/src/commands/notify.ts +27 -3
- package/src/commands/sdk.ts +1 -0
- package/src/config/file-lock-gc.ts +18 -0
- package/src/config/file-lock.ts +61 -16
- package/src/config/model-profiles.ts +31 -15
- package/src/coordinator/contract.ts +1 -0
- package/src/coordinator-mcp/question-state.ts +2 -0
- package/src/coordinator-mcp/server.ts +358 -7
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +2 -0
- package/src/extensibility/extensions/index.ts +1 -0
- package/src/extensibility/extensions/ouroboros-ooo-bridge.ts +235 -0
- package/src/extensibility/extensions/prefix-command-bridge.ts +4 -9
- package/src/extensibility/extensions/runner.ts +15 -2
- package/src/extensibility/extensions/types.ts +2 -0
- package/src/gjc-runtime/launch-tmux.ts +53 -1
- package/src/internal-urls/docs-index.generated.ts +11 -10
- package/src/main.ts +203 -67
- package/src/modes/DESIGN.md +8 -5
- package/src/modes/components/footer.ts +10 -18
- package/src/modes/components/session-selector.ts +26 -3
- package/src/modes/components/status-line/gh.ts +23 -2
- package/src/modes/controllers/event-controller.ts +3 -0
- package/src/modes/controllers/extension-ui-controller.ts +2 -0
- package/src/modes/controllers/input-controller.ts +11 -0
- package/src/modes/controllers/selector-controller.ts +8 -2
- package/src/modes/interactive-mode.ts +7 -1
- package/src/modes/utils/host-status.ts +38 -0
- package/src/runtime-mcp/types.ts +2 -0
- package/src/sdk/broker/lifecycle.ts +60 -3
- package/src/sdk/bus/chat-daemon-cli.ts +42 -0
- package/src/sdk/bus/chat-daemon-command-channel.ts +921 -0
- package/src/sdk/bus/chat-daemon-control.ts +16 -3
- package/src/sdk/bus/chat-daemon-runtime.ts +257 -21
- package/src/sdk/bus/control-plane-frames.ts +51 -0
- package/src/sdk/bus/conversation-store.ts +29 -1
- package/src/sdk/bus/existing-thread-readiness.ts +155 -0
- package/src/sdk/bus/index.ts +70 -0
- package/src/sdk/bus/notification-service.ts +28 -1
- package/src/sdk/bus/rich-render.ts +3 -2
- package/src/sdk/bus/slack-daemon.ts +99 -4
- package/src/sdk/bus/slack-live-provider.ts +32 -2
- package/src/sdk/bus/slack-provider.ts +11 -0
- package/src/sdk/bus/slack-thread-binding.ts +641 -0
- package/src/sdk/bus/telegram-daemon-cli.ts +11 -0
- package/src/sdk/bus/telegram-daemon-contract.ts +24 -7
- package/src/sdk/bus/telegram-daemon.ts +1961 -497
- package/src/sdk/bus/telegram-reference.ts +42 -6
- package/src/sdk/bus/topic-registry.ts +674 -181
- package/src/sdk/host/host.ts +180 -1
- package/src/sdk/lifecycle-session.ts +8 -2
- package/src/sdk/protocol/operation-inventory.generated.json +22 -0
- package/src/sdk/session-activation.ts +127 -0
- package/src/sdk/session.ts +139 -28
- package/src/sdk/startup-capability.ts +10 -1
- package/src/session/agent-session.ts +220 -9
- package/src/session/artifacts.ts +56 -13
- package/src/session/internal/managed-session-storage.ts +206 -7
- package/src/session/session-manager.ts +148 -38
- package/src/setup/provider-presets.json +1 -1
- package/src/task/index.ts +92 -44
- package/src/tools/index.ts +8 -0
- package/src/utils/npm-registry.ts +660 -0
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* Dependency-free: uses global `fetch` and `WebSocket` (Bun/Node 22+).
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import * as crypto from "node:crypto";
|
|
17
18
|
import * as fs from "node:fs";
|
|
18
19
|
import {
|
|
19
20
|
bold,
|
|
@@ -85,18 +86,27 @@ export interface CallbackRoute {
|
|
|
85
86
|
sessionId: string;
|
|
86
87
|
actionId: string;
|
|
87
88
|
answer: TelegramCallbackAnswer;
|
|
89
|
+
/** Durable audit metadata only; never sufficient to route a callback after restart. */
|
|
90
|
+
chatId?: string;
|
|
91
|
+
messageId?: number;
|
|
92
|
+
ownerId?: string;
|
|
93
|
+
generation?: number;
|
|
88
94
|
}
|
|
89
95
|
|
|
90
96
|
export interface SerializedAliasTable {
|
|
91
|
-
version: 1;
|
|
97
|
+
version: 1 | 2;
|
|
92
98
|
next: number;
|
|
93
99
|
routes: Record<string, CallbackRoute>;
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
export interface AliasTable {
|
|
103
|
+
allocate(isReserved?: (alias: string) => boolean): string;
|
|
104
|
+
activate(alias: string, route: CallbackRoute): boolean;
|
|
97
105
|
put(route: CallbackRoute): string;
|
|
98
106
|
get(alias: string): CallbackRoute | undefined;
|
|
107
|
+
update(alias: string, patch: Partial<CallbackRoute>): boolean;
|
|
99
108
|
delete(alias: string): boolean;
|
|
109
|
+
clear(): void;
|
|
100
110
|
serialize(): SerializedAliasTable;
|
|
101
111
|
load(json: unknown): void;
|
|
102
112
|
entries(): Array<[string, CallbackRoute]>;
|
|
@@ -112,7 +122,11 @@ function isCallbackRoute(value: unknown): value is CallbackRoute {
|
|
|
112
122
|
typeof route.answer === "number" ||
|
|
113
123
|
(typeof route.answer === "object" &&
|
|
114
124
|
route.answer !== null &&
|
|
115
|
-
(route.answer as { controlId?: unknown }).controlId === "navigation_forward"))
|
|
125
|
+
(route.answer as { controlId?: unknown }).controlId === "navigation_forward")) &&
|
|
126
|
+
(route.chatId === undefined || typeof route.chatId === "string") &&
|
|
127
|
+
(route.messageId === undefined || (Number.isSafeInteger(route.messageId) && route.messageId > 0)) &&
|
|
128
|
+
(route.ownerId === undefined || typeof route.ownerId === "string") &&
|
|
129
|
+
(route.generation === undefined || (Number.isSafeInteger(route.generation) && route.generation >= 0))
|
|
116
130
|
);
|
|
117
131
|
}
|
|
118
132
|
|
|
@@ -121,24 +135,46 @@ export function createAliasTable(): AliasTable {
|
|
|
121
135
|
let next = 1;
|
|
122
136
|
const routes = new Map<string, CallbackRoute>();
|
|
123
137
|
return {
|
|
124
|
-
|
|
138
|
+
allocate(isReserved) {
|
|
125
139
|
let alias: string;
|
|
126
140
|
do {
|
|
127
|
-
|
|
128
|
-
|
|
141
|
+
// `b1_` is intentionally disjoint from every legacy sequential `aN`
|
|
142
|
+
// token, including accepted keyboards lost before their old daemon
|
|
143
|
+
// could persist them.
|
|
144
|
+
alias = `b1_${crypto.randomBytes(18).toString("base64url")}`;
|
|
145
|
+
} while (routes.has(alias) || isReserved?.(alias) === true);
|
|
146
|
+
next++;
|
|
129
147
|
if (Buffer.byteLength(alias, "utf8") > 64) throw new Error("callback alias exceeded Telegram limit");
|
|
148
|
+
return alias;
|
|
149
|
+
},
|
|
150
|
+
activate(alias, route) {
|
|
151
|
+
if (routes.has(alias) || Buffer.byteLength(alias, "utf8") > 64 || !isCallbackRoute(route)) return false;
|
|
130
152
|
routes.set(alias, { ...route });
|
|
153
|
+
return true;
|
|
154
|
+
},
|
|
155
|
+
put(route) {
|
|
156
|
+
const alias = this.allocate();
|
|
157
|
+
if (!this.activate(alias, route)) throw new Error("callback alias activation failed");
|
|
131
158
|
return alias;
|
|
132
159
|
},
|
|
133
160
|
get(alias) {
|
|
134
161
|
const route = routes.get(alias);
|
|
135
162
|
return route ? { ...route } : undefined;
|
|
136
163
|
},
|
|
164
|
+
update(alias, patch) {
|
|
165
|
+
const route = routes.get(alias);
|
|
166
|
+
if (!route) return false;
|
|
167
|
+
routes.set(alias, { ...route, ...patch });
|
|
168
|
+
return true;
|
|
169
|
+
},
|
|
137
170
|
delete(alias) {
|
|
138
171
|
return routes.delete(alias);
|
|
139
172
|
},
|
|
173
|
+
clear() {
|
|
174
|
+
routes.clear();
|
|
175
|
+
},
|
|
140
176
|
serialize() {
|
|
141
|
-
return { version:
|
|
177
|
+
return { version: 2, next, routes: Object.fromEntries(routes.entries()) };
|
|
142
178
|
},
|
|
143
179
|
load(json) {
|
|
144
180
|
routes.clear();
|