@mono-agent/web 0.20.11 → 0.21.0
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/README.md +397 -68
- package/dist/contracts.d.ts +437 -8
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +2 -0
- package/dist/contracts.js.map +1 -1
- package/dist/cron-reply-context.d.ts +27 -0
- package/dist/cron-reply-context.d.ts.map +1 -0
- package/dist/cron-reply-context.js +241 -0
- package/dist/cron-reply-context.js.map +1 -0
- package/dist/discovery.d.ts +1 -0
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +8 -6
- package/dist/discovery.js.map +1 -1
- package/dist/effort-ladder.d.ts +111 -0
- package/dist/effort-ladder.d.ts.map +1 -0
- package/dist/effort-ladder.js +155 -0
- package/dist/effort-ladder.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/long-lived-fetch.d.ts +5 -0
- package/dist/long-lived-fetch.d.ts.map +1 -0
- package/dist/long-lived-fetch.js +22 -0
- package/dist/long-lived-fetch.js.map +1 -0
- package/dist/monitor-reply.d.ts +10 -0
- package/dist/monitor-reply.d.ts.map +1 -0
- package/dist/monitor-reply.js +67 -0
- package/dist/monitor-reply.js.map +1 -0
- package/dist/notification-client.d.ts +11 -2
- package/dist/notification-client.d.ts.map +1 -1
- package/dist/notification-client.js +5 -4
- package/dist/notification-client.js.map +1 -1
- package/dist/notification-ingress.d.ts +8 -1
- package/dist/notification-ingress.d.ts.map +1 -1
- package/dist/notification-ingress.js +28 -6
- package/dist/notification-ingress.js.map +1 -1
- package/dist/operator-client.d.ts +35 -2
- package/dist/operator-client.d.ts.map +1 -1
- package/dist/operator-client.js +276 -9
- package/dist/operator-client.js.map +1 -1
- package/dist/server.d.ts +42 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +679 -52
- package/dist/server.js.map +1 -1
- package/dist/service.d.ts +299 -18
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +1915 -160
- package/dist/service.js.map +1 -1
- package/dist/store-migrations.d.ts +23 -0
- package/dist/store-migrations.d.ts.map +1 -0
- package/dist/store-migrations.js +212 -0
- package/dist/store-migrations.js.map +1 -0
- package/dist/store.d.ts +389 -21
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +2087 -245
- package/dist/store.js.map +1 -1
- package/package.json +9 -8
- package/webapp/dist/assets/{assistant-ui-BzN2E6n6.js → assistant-ui-pZmGxIp2.js} +16 -16
- package/webapp/dist/assets/index-6uQ7TVQe.css +1 -0
- package/webapp/dist/assets/index-CsSMjSgW.js +156 -0
- package/webapp/dist/assets/{markdown-Vq23xgh7.js → markdown-Du5t10ja.js} +1 -1
- package/webapp/dist/badge-96.png +0 -0
- package/webapp/dist/index.html +26 -6
- package/webapp/dist/manifest.webmanifest +1 -1
- package/webapp/dist/notification-sw.js +3 -1
- package/webapp/dist/sw.js +1 -1
- package/webapp/dist/{workbox-9c191d2f.js → workbox-2fbc6a65.js} +1 -1
- package/webapp/dist/assets/index-BT463dRM.css +0 -1
- package/webapp/dist/assets/index-Co-qDQPq.js +0 -155
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one effort rule, shared verbatim by both ends of the console.
|
|
3
|
+
*
|
|
4
|
+
* The server decides what a turn may carry; the browser decides what the
|
|
5
|
+
* picker offers and what a stored preference survives as. Written twice, those
|
|
6
|
+
* two decisions drift, and the drift is invisible: the UI hides or clears a
|
|
7
|
+
* grade the agent would have accepted, or offers one it rejects with a 400.
|
|
8
|
+
* This module is imported by `service.ts` and by
|
|
9
|
+
* `webapp/src/components/model-catalog.ts` (relatively, the way
|
|
10
|
+
* `mcp-app-document.ts` already is), so there is exactly one implementation.
|
|
11
|
+
*
|
|
12
|
+
* It must therefore stay dependency-free: the webapp is its own pnpm workspace
|
|
13
|
+
* and cannot resolve `@mono-agent/config` or anything else from the monorepo.
|
|
14
|
+
* `GLOBAL_EFFORT_LEVELS` duplicates `EFFORT_LEVELS` for that reason, and
|
|
15
|
+
* `packages/web/src/__tests__/effort-ladder.test.ts` pins the two equal.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The canonical ladder, used wherever nothing narrower is known. Mirrors
|
|
19
|
+
* `EFFORT_LEVELS` from `@mono-agent/config`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const GLOBAL_EFFORT_LEVELS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra"];
|
|
22
|
+
/** What a `reasoningMode: "toggle"` model offers: thinking on, or off. */
|
|
23
|
+
export declare const TOGGLE_EFFORT_LEVELS: readonly ["high", "none"];
|
|
24
|
+
/**
|
|
25
|
+
* What one route says about its own reasoning. A `modelOptions` entry (the
|
|
26
|
+
* configured shortlist) and a `/v1/models` catalog row are built from the same
|
|
27
|
+
* `resolveAdvertisedModelEffort` shape in `@mono-agent/agent-app`, so one rule
|
|
28
|
+
* reads both.
|
|
29
|
+
*/
|
|
30
|
+
export interface EffortAdvertisement {
|
|
31
|
+
readonly reasoning?: boolean;
|
|
32
|
+
readonly reasoningMode?: string;
|
|
33
|
+
readonly effortLevels?: readonly string[];
|
|
34
|
+
/**
|
|
35
|
+
* Configured fallback effort. A string pins it, null selects provider
|
|
36
|
+
* default, and absence means this may be an older agent advertisement.
|
|
37
|
+
*/
|
|
38
|
+
readonly effort?: string | null;
|
|
39
|
+
}
|
|
40
|
+
/** The `modelOptions`/`efforts` pair an agent advertises on `/v1/info`. */
|
|
41
|
+
export interface EffortAgentContext {
|
|
42
|
+
readonly modelOptions?: Readonly<Record<string, EffortAdvertisement>> | undefined;
|
|
43
|
+
readonly efforts?: readonly string[] | undefined;
|
|
44
|
+
/** The configured shortlist, in the order the agent advertised it. */
|
|
45
|
+
readonly models?: readonly string[] | undefined;
|
|
46
|
+
/** The route a turn carrying no explicit model runs on. */
|
|
47
|
+
readonly defaultModel?: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The model an effort decision is actually about when the selection is blank.
|
|
51
|
+
*
|
|
52
|
+
* Blank means "let the agent pick", and what the agent picks is its default
|
|
53
|
+
* route, or -- for a payload that advertises a shortlist but no default -- the
|
|
54
|
+
* first route on that shortlist. Both ends have to answer this the same way or
|
|
55
|
+
* the shared rule below is fed different models and drifts anyway: the browser
|
|
56
|
+
* fell back to `models[0]` while the server stopped at `defaultModel`, so for
|
|
57
|
+
* any `/v1/info` omitting `model` the picker offered the first route's ladder
|
|
58
|
+
* while `startTurn` judged against the global one.
|
|
59
|
+
*
|
|
60
|
+
* `undefined` means the caller knows of no route at all, which is the one case
|
|
61
|
+
* where {@link effortLevelsForModel} legitimately has nothing to look up.
|
|
62
|
+
*/
|
|
63
|
+
export declare function effectiveModelForAgent(agent: EffortAgentContext, model: string | undefined): string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* The ladder one advertisement resolves to, or `undefined` when it said
|
|
66
|
+
* nothing at all and the caller's floor applies.
|
|
67
|
+
*
|
|
68
|
+
* Read the producer's vocabulary (`agent-app/src/model-effort-capabilities.ts`,
|
|
69
|
+
* `runtime-adapter/src/local-providers.ts`) rather than the field names:
|
|
70
|
+
*
|
|
71
|
+
* - `reasoning: false` / `reasoningMode: "none"` — takes no grade at all.
|
|
72
|
+
* - `reasoningMode: "toggle"` — binary thinking; graded levels would lie.
|
|
73
|
+
* - an `effortLevels` list, empty included — exactly those grades.
|
|
74
|
+
* - `reasoningMode: "effort"` with no list — the operator's own local-provider
|
|
75
|
+
* config declared this model graded and enumerated nothing (a real Ollama
|
|
76
|
+
* `reasoning_mode: "effort"` produces exactly this). It is an affirmative
|
|
77
|
+
* claim that grades apply, so it gets the canonical ladder, the same one
|
|
78
|
+
* `channelEffortOptions` and the TUI picker offer it. Reading it as an
|
|
79
|
+
* empty ladder inverts its meaning and 400s every effort.
|
|
80
|
+
* - `reasoning: true` alone — "we looked and could not determine the grades"
|
|
81
|
+
* for a cloud model. Deliberately narrow (80a6df14): unspecified cloud
|
|
82
|
+
* grades stay hidden rather than guessed at.
|
|
83
|
+
* - nothing whatsoever — silence, not a claim. The caller's floor decides.
|
|
84
|
+
*/
|
|
85
|
+
export declare function advertisedEffortLevels(advertisement: EffortAdvertisement | undefined): readonly string[] | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The efforts a selection may carry, in the one precedence order both ends
|
|
88
|
+
* apply: the configured shortlist entry for this exact route, then whatever
|
|
89
|
+
* the `/v1/models` page said about this exact model, then the floor.
|
|
90
|
+
*
|
|
91
|
+
* `catalogLevels` is an already-resolved ladder — run the catalog row through
|
|
92
|
+
* {@link advertisedEffortLevels} first — because the server caches the resolved
|
|
93
|
+
* value rather than the row.
|
|
94
|
+
*
|
|
95
|
+
* The floor is the global ladder. An agent that predates per-model metadata
|
|
96
|
+
* describes one ladder for everything in `efforts`, so that wins for it. An
|
|
97
|
+
* agent that does carry `modelOptions` has said nothing about a model reached
|
|
98
|
+
* only through the catalog, and there the agent itself is the real gate at turn
|
|
99
|
+
* time — narrowing here would hide grades the server accepts.
|
|
100
|
+
*/
|
|
101
|
+
export declare function effortLevelsForModel(agent: EffortAgentContext, model: string | undefined, catalogLevels: readonly string[] | undefined): readonly string[];
|
|
102
|
+
/**
|
|
103
|
+
* Resolve the effort inherited by a model-only turn selection.
|
|
104
|
+
*
|
|
105
|
+
* The configured primary always keeps `runtime.effort`. A new agent publishes
|
|
106
|
+
* each fallback's tri-state route effort in `modelOptions`; older agents omit
|
|
107
|
+
* that field and retain the capability-ladder behavior. Catalog-only routes
|
|
108
|
+
* inherit only when their advertised reasoning shape admits the base effort.
|
|
109
|
+
*/
|
|
110
|
+
export declare function inheritedEffortForModel(agent: EffortAgentContext, model: string | undefined, catalogAdvertisement: EffortAdvertisement | undefined, defaultEffort: string | undefined): string | undefined;
|
|
111
|
+
//# sourceMappingURL=effort-ladder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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K,EAAE,kBAAkB,EACzB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAC3C,SAAS,MAAM,EAAE,CAQnB;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,oBAAoB,EAAE,mBAAmB,GAAG,SAAS,EACrD,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,GAAG,SAAS,CAkBpB"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one effort rule, shared verbatim by both ends of the console.
|
|
3
|
+
*
|
|
4
|
+
* The server decides what a turn may carry; the browser decides what the
|
|
5
|
+
* picker offers and what a stored preference survives as. Written twice, those
|
|
6
|
+
* two decisions drift, and the drift is invisible: the UI hides or clears a
|
|
7
|
+
* grade the agent would have accepted, or offers one it rejects with a 400.
|
|
8
|
+
* This module is imported by `service.ts` and by
|
|
9
|
+
* `webapp/src/components/model-catalog.ts` (relatively, the way
|
|
10
|
+
* `mcp-app-document.ts` already is), so there is exactly one implementation.
|
|
11
|
+
*
|
|
12
|
+
* It must therefore stay dependency-free: the webapp is its own pnpm workspace
|
|
13
|
+
* and cannot resolve `@mono-agent/config` or anything else from the monorepo.
|
|
14
|
+
* `GLOBAL_EFFORT_LEVELS` duplicates `EFFORT_LEVELS` for that reason, and
|
|
15
|
+
* `packages/web/src/__tests__/effort-ladder.test.ts` pins the two equal.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The canonical ladder, used wherever nothing narrower is known. Mirrors
|
|
19
|
+
* `EFFORT_LEVELS` from `@mono-agent/config`.
|
|
20
|
+
*/
|
|
21
|
+
export const GLOBAL_EFFORT_LEVELS = [
|
|
22
|
+
"none",
|
|
23
|
+
"minimal",
|
|
24
|
+
"low",
|
|
25
|
+
"medium",
|
|
26
|
+
"high",
|
|
27
|
+
"xhigh",
|
|
28
|
+
"max",
|
|
29
|
+
"ultra",
|
|
30
|
+
];
|
|
31
|
+
/** What a `reasoningMode: "toggle"` model offers: thinking on, or off. */
|
|
32
|
+
export const TOGGLE_EFFORT_LEVELS = ["high", "none"];
|
|
33
|
+
/**
|
|
34
|
+
* The model an effort decision is actually about when the selection is blank.
|
|
35
|
+
*
|
|
36
|
+
* Blank means "let the agent pick", and what the agent picks is its default
|
|
37
|
+
* route, or -- for a payload that advertises a shortlist but no default -- the
|
|
38
|
+
* first route on that shortlist. Both ends have to answer this the same way or
|
|
39
|
+
* the shared rule below is fed different models and drifts anyway: the browser
|
|
40
|
+
* fell back to `models[0]` while the server stopped at `defaultModel`, so for
|
|
41
|
+
* any `/v1/info` omitting `model` the picker offered the first route's ladder
|
|
42
|
+
* while `startTurn` judged against the global one.
|
|
43
|
+
*
|
|
44
|
+
* `undefined` means the caller knows of no route at all, which is the one case
|
|
45
|
+
* where {@link effortLevelsForModel} legitimately has nothing to look up.
|
|
46
|
+
*/
|
|
47
|
+
export function effectiveModelForAgent(agent, model) {
|
|
48
|
+
return model || agent.defaultModel || agent.models?.[0] || undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The ladder one advertisement resolves to, or `undefined` when it said
|
|
52
|
+
* nothing at all and the caller's floor applies.
|
|
53
|
+
*
|
|
54
|
+
* Read the producer's vocabulary (`agent-app/src/model-effort-capabilities.ts`,
|
|
55
|
+
* `runtime-adapter/src/local-providers.ts`) rather than the field names:
|
|
56
|
+
*
|
|
57
|
+
* - `reasoning: false` / `reasoningMode: "none"` — takes no grade at all.
|
|
58
|
+
* - `reasoningMode: "toggle"` — binary thinking; graded levels would lie.
|
|
59
|
+
* - an `effortLevels` list, empty included — exactly those grades.
|
|
60
|
+
* - `reasoningMode: "effort"` with no list — the operator's own local-provider
|
|
61
|
+
* config declared this model graded and enumerated nothing (a real Ollama
|
|
62
|
+
* `reasoning_mode: "effort"` produces exactly this). It is an affirmative
|
|
63
|
+
* claim that grades apply, so it gets the canonical ladder, the same one
|
|
64
|
+
* `channelEffortOptions` and the TUI picker offer it. Reading it as an
|
|
65
|
+
* empty ladder inverts its meaning and 400s every effort.
|
|
66
|
+
* - `reasoning: true` alone — "we looked and could not determine the grades"
|
|
67
|
+
* for a cloud model. Deliberately narrow (80a6df14): unspecified cloud
|
|
68
|
+
* grades stay hidden rather than guessed at.
|
|
69
|
+
* - nothing whatsoever — silence, not a claim. The caller's floor decides.
|
|
70
|
+
*/
|
|
71
|
+
export function advertisedEffortLevels(advertisement) {
|
|
72
|
+
if (advertisement === undefined)
|
|
73
|
+
return undefined;
|
|
74
|
+
if (advertisement.reasoning === false || advertisement.reasoningMode === "none")
|
|
75
|
+
return [];
|
|
76
|
+
// An explicitly empty list narrows hardest: it outranks even a mode.
|
|
77
|
+
if (advertisement.effortLevels?.length === 0)
|
|
78
|
+
return [];
|
|
79
|
+
if (advertisement.reasoningMode === "toggle")
|
|
80
|
+
return TOGGLE_EFFORT_LEVELS;
|
|
81
|
+
if (advertisement.effortLevels !== undefined)
|
|
82
|
+
return advertisement.effortLevels;
|
|
83
|
+
if (advertisement.reasoningMode === "effort")
|
|
84
|
+
return GLOBAL_EFFORT_LEVELS;
|
|
85
|
+
if (advertisement.reasoning !== undefined)
|
|
86
|
+
return [];
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The efforts a selection may carry, in the one precedence order both ends
|
|
91
|
+
* apply: the configured shortlist entry for this exact route, then whatever
|
|
92
|
+
* the `/v1/models` page said about this exact model, then the floor.
|
|
93
|
+
*
|
|
94
|
+
* `catalogLevels` is an already-resolved ladder — run the catalog row through
|
|
95
|
+
* {@link advertisedEffortLevels} first — because the server caches the resolved
|
|
96
|
+
* value rather than the row.
|
|
97
|
+
*
|
|
98
|
+
* The floor is the global ladder. An agent that predates per-model metadata
|
|
99
|
+
* describes one ladder for everything in `efforts`, so that wins for it. An
|
|
100
|
+
* agent that does carry `modelOptions` has said nothing about a model reached
|
|
101
|
+
* only through the catalog, and there the agent itself is the real gate at turn
|
|
102
|
+
* time — narrowing here would hide grades the server accepts.
|
|
103
|
+
*/
|
|
104
|
+
export function effortLevelsForModel(agent, model, catalogLevels) {
|
|
105
|
+
const advertised = advertisedEffortLevels(model === undefined ? undefined : agent.modelOptions?.[model]);
|
|
106
|
+
if (advertised !== undefined)
|
|
107
|
+
return advertised;
|
|
108
|
+
if (catalogLevels !== undefined)
|
|
109
|
+
return catalogLevels;
|
|
110
|
+
if (agent.modelOptions === undefined)
|
|
111
|
+
return agent.efforts ?? GLOBAL_EFFORT_LEVELS;
|
|
112
|
+
return GLOBAL_EFFORT_LEVELS;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Resolve the effort inherited by a model-only turn selection.
|
|
116
|
+
*
|
|
117
|
+
* The configured primary always keeps `runtime.effort`. A new agent publishes
|
|
118
|
+
* each fallback's tri-state route effort in `modelOptions`; older agents omit
|
|
119
|
+
* that field and retain the capability-ladder behavior. Catalog-only routes
|
|
120
|
+
* inherit only when their advertised reasoning shape admits the base effort.
|
|
121
|
+
*/
|
|
122
|
+
export function inheritedEffortForModel(agent, model, catalogAdvertisement, defaultEffort) {
|
|
123
|
+
const effectiveModel = effectiveModelForAgent(agent, model);
|
|
124
|
+
const primaryModel = agent.defaultModel || agent.models?.[0] || undefined;
|
|
125
|
+
if (effectiveModel === undefined || effectiveModel === primaryModel)
|
|
126
|
+
return defaultEffort;
|
|
127
|
+
const shortlistAdvertisement = agent.modelOptions?.[effectiveModel];
|
|
128
|
+
if (shortlistAdvertisement !== undefined && Object.hasOwn(shortlistAdvertisement, "effort")) {
|
|
129
|
+
return typeof shortlistAdvertisement.effort === "string"
|
|
130
|
+
? shortlistAdvertisement.effort
|
|
131
|
+
: undefined;
|
|
132
|
+
}
|
|
133
|
+
if (defaultEffort === undefined)
|
|
134
|
+
return undefined;
|
|
135
|
+
const admission = advertisedEffortAdmission(shortlistAdvertisement ?? catalogAdvertisement, defaultEffort);
|
|
136
|
+
return admission === false ? undefined : defaultEffort;
|
|
137
|
+
}
|
|
138
|
+
/** `undefined` means the advertisement cannot judge this effort. */
|
|
139
|
+
function advertisedEffortAdmission(advertisement, effort) {
|
|
140
|
+
if (advertisement === undefined)
|
|
141
|
+
return undefined;
|
|
142
|
+
if (advertisement.reasoning === false || advertisement.reasoningMode === "none")
|
|
143
|
+
return false;
|
|
144
|
+
if (advertisement.effortLevels?.length === 0)
|
|
145
|
+
return false;
|
|
146
|
+
if (advertisement.reasoningMode === "toggle")
|
|
147
|
+
return TOGGLE_EFFORT_LEVELS.includes(effort);
|
|
148
|
+
if (advertisement.effortLevels !== undefined)
|
|
149
|
+
return advertisement.effortLevels.includes(effort);
|
|
150
|
+
if (advertisement.reasoningMode === "effort")
|
|
151
|
+
return GLOBAL_EFFORT_LEVELS.includes(effort);
|
|
152
|
+
// `reasoning: true` alone is unknown cloud metadata. Stay permissive.
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=effort-ladder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effort-ladder.js","sourceRoot":"","sources":["../src/effort-ladder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM;IACN,SAAS;IACT,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACP,KAAK;IACL,OAAO;CACC,CAAC;AAEX,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AA6B9D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAyB,EACzB,KAAyB;IAEzB,OAAO,KAAK,IAAI,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,SAAS,C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AAa,CAAC,YAAY,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjG,IAAI,aAAa,CAAC,aAAa,KAAK,QAAQ;QAAE,OAAO,oBAAoB,CAAC,QAAQ,CAChF,MAA+C,CAChD,CAAC;IACF,sEAAsE;IACtE,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ export type { StartWebServerOptions, WebServerHandle } from "./server.js";
|
|
|
7
7
|
export { defaultWebStateDir, prepareWebState, prepareWebStatePaths, resetWebState, resolveWebStatePaths, } from "./state-paths.js";
|
|
8
8
|
export type { WebStatePathOptions, WebStatePaths } from "./state-paths.js";
|
|
9
9
|
export { deliverWebNotification } from "./notification-client.js";
|
|
10
|
-
export type { DeliverWebNotificationInput, DeliverWebNotificationOptions, DeliverWebNotificationResult, DeliverWebProcessJobNotificationInput, DeliverWebThreadNotificationInput, } from "./notification-client.js";
|
|
10
|
+
export type { DeliverWebNotificationInput, DeliverWebNotificationOptions, DeliverWebNotificationResult, DeliverWebMonitorNotificationInput, DeliverWebProcessJobNotificationInput, DeliverWebThreadNotificationInput, } from "./notification-client.js";
|
|
11
11
|
export { discoverAcpBridgeAgents, defaultTraceRegistryDir, discoverOperatorAgents, isTrustedOperatorBaseUrl, operatorBaseUrlFromMetadata, } from "./discovery.js";
|
|
12
12
|
export type { DiscoverAcpBridgeAgentsOptions, DiscoverOperatorAgentsOptions, DiscoveredOperatorAgent, } from "./discovery.js";
|
|
13
13
|
export { OperatorClient } from "./operator-client.js";
|
|
14
14
|
export type { OperatorClientOptions, OperatorConnection, OperatorInfo, OperatorTurnInput, OperatorTurnResult, } from "./operator-client.js";
|
|
15
|
-
export { ACP_BRIDGE_DISCOVERY_SCHEMA, ACP_BRIDGE_SOURCE_SCHEMA, ACP_BRIDGE_VERSION, ACP_PROTOCOL_VERSION, DEFAULT_WEB_THEME, WEB_API_VERSION, WEB_MAX_CONCURRENT_UPLOADS, WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES, WEB_MAX_FILES_PER_TURN, WEB_MAX_LIVE_INPUTS_PER_THREAD, WEB_MAX_STAGED_UPLOAD_BYTES, WEB_MAX_STAGED_UPLOADS, WEB_MAX_QUEUED_ATTACHMENT_TURNS, WEB_MAX_TURN_ATTACHMENT_BYTES, WEB_STAGED_UPLOAD_TTL_MS, WEB_THEMES, } from "./contracts.js";
|
|
16
|
-
export type { AcpBridgeDiscovery, AcpBridgeSourceDescriptor, AcpBridgeSourceHealth, CreateWebThreadInput, CreateWebUploadInput, PatchWebAgentInput, PatchWebThreadInput, StartWebLiveInputInput, StartWebTurnInput, WebAgentStatus, WebAgentSummary, WebAttachment, WebBootstrap, WebConsoleIdentity, WebEvent, WebEventType, WebLiveInputReceipt, WebMessage, WebMessagePart, WebMessageStatus, WebModelOption, WebNotificationTriggerKind, WebThreadNotificationTriggerKind, WebPushBootstrap, WebPushSubscriptionState, WebPushSubscriptionStatus, WebQuote, WebRunState, WebRunStatus, WebSkillAvailability, WebSkillInfo, WebSkillRegistry, WebSkillUnavailableReason, WebThread, WebThreadDetail, WebThreadSearchHit, WebThreadSearchPage, SearchWebThreadsInput, WebThreadTrigger, WebTheme, } from "./contracts.js";
|
|
15
|
+
export { ACP_BRIDGE_DISCOVERY_SCHEMA, ACP_BRIDGE_SOURCE_SCHEMA, ACP_BRIDGE_VERSION, ACP_PROTOCOL_VERSION, DEFAULT_WEB_THEME, WEB_API_VERSION, WEB_CONSOLE_NAME_MAX_CHARACTERS, WEB_MAX_CONCURRENT_UPLOADS, WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES, WEB_MAX_FILES_PER_TURN, WEB_MAX_LIVE_INPUTS_PER_THREAD, WEB_MAX_STAGED_UPLOAD_BYTES, WEB_MAX_STAGED_UPLOADS, WEB_MAX_QUEUED_ATTACHMENT_TURNS, WEB_MAX_TURN_ATTACHMENT_BYTES, WEB_STAGED_UPLOAD_TTL_MS, WEB_THEMES, } from "./contracts.js";
|
|
16
|
+
export type { AcpBridgeDiscovery, AcpBridgeSourceDescriptor, AcpBridgeSourceHealth, CreateWebCronReplyInput, CreateWebThreadInput, CreateWebUploadInput, PatchWebAgentInput, PatchWebThreadInput, PutWebAgentRunSettingsInput, StartWebLiveInputInput, StartWebSubmissionInput, StartWebTurnInput, WebAgentsChangedPayload, WebAgentStatus, WebAgentRunSettings, WebAgentSummary, WebAttachment, WebBootstrap, WebBootstrapScope, WebConsoleIdentity, WebCronReplyReceipt, WebCronReplyContextPart, WebCronReplySnapshotKind, WebEvent, WebEventType, WebLiveInputReceipt, WebSubmissionReceipt, WebMessage, WebMessageDelta, WebMessageDeltaOp, WebMessagePart, WebMessageStatus, WebModelOption, WebNotificationTriggerKind, WebThreadNotificationTriggerKind, WebPushBootstrap, WebPushSubscriptionState, WebPushSubscriptionStatus, WebQuote, WebRunState, WebRunAttribution, WebRunExecution, WebRunRetry, WebRunSelection, WebRunTransition, WebRunSettingSource, WebRunStatus, WebSkillAvailability, WebSkillInfo, WebSkillRegistry, WebSkillUnavailableReason, WebThread, WebJobActivity, WebThreadChangedPayload, WebThreadDetail, WebThreadSearchHit, WebThreadSearchPage, SearchWebThreadsInput, WebThreadTrigger, WebTheme, } from "./contracts.js";
|
|
17
17
|
export { WEB_SEARCH_HIGHLIGHT_CLOSE, WEB_SEARCH_HIGHLIGHT_OPEN, WEB_THREAD_SEARCH_MAX, WEB_THREAD_SEARCH_MIN_QUERY, } from "./store.js";
|
|
18
18
|
export { WebConsoleError } from "./errors.js";
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,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AClB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { defaultWebStateDir, prepareWebState, prepareWebStatePaths, resetWebStat
|
|
|
7
7
|
export { deliverWebNotification } from "./notification-client.js";
|
|
8
8
|
export { discoverAcpBridgeAgents, defaultTraceRegistryDir, discoverOperatorAgents, isTrustedOperatorBaseUrl, operatorBaseUrlFromMetadata, } from "./discovery.js";
|
|
9
9
|
export { OperatorClient } from "./operator-client.js";
|
|
10
|
-
export { ACP_BRIDGE_DISCOVERY_SCHEMA, ACP_BRIDGE_SOURCE_SCHEMA, ACP_BRIDGE_VERSION, ACP_PROTOCOL_VERSION, DEFAULT_WEB_THEME, WEB_API_VERSION, WEB_MAX_CONCURRENT_UPLOADS, WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES, WEB_MAX_FILES_PER_TURN, WEB_MAX_LIVE_INPUTS_PER_THREAD, WEB_MAX_STAGED_UPLOAD_BYTES, WEB_MAX_STAGED_UPLOADS, WEB_MAX_QUEUED_ATTACHMENT_TURNS, WEB_MAX_TURN_ATTACHMENT_BYTES, WEB_STAGED_UPLOAD_TTL_MS, WEB_THEMES, } from "./contracts.js";
|
|
10
|
+
export { ACP_BRIDGE_DISCOVERY_SCHEMA, ACP_BRIDGE_SOURCE_SCHEMA, ACP_BRIDGE_VERSION, ACP_PROTOCOL_VERSION, DEFAULT_WEB_THEME, WEB_API_VERSION, WEB_CONSOLE_NAME_MAX_CHARACTERS, WEB_MAX_CONCURRENT_UPLOADS, WEB_MAX_ACTIVE_ATTACHMENT_TURN_BYTES, WEB_MAX_FILES_PER_TURN, WEB_MAX_LIVE_INPUTS_PER_THREAD, WEB_MAX_STAGED_UPLOAD_BYTES, WEB_MAX_STAGED_UPLOADS, WEB_MAX_QUEUED_ATTACHMENT_TURNS, WEB_MAX_TURN_ATTACHMENT_BYTES, WEB_STAGED_UPLOAD_TTL_MS, WEB_THEMES, } from "./contracts.js";
|
|
11
11
|
export { WEB_SEARCH_HIGHLIGHT_CLOSE, WEB_SEARCH_HIGHLIGHT_OPEN, WEB_THREAD_SEARCH_MAX, WEB_THREAD_SEARCH_MIN_QUERY, } from "./store.js";
|
|
12
12
|
export { WebConsoleError } from "./errors.js";
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAUlE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAStD,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,+BAA+B,EAC/B,0BAA0B,EAC1B,oCAAoC,EACpC,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,sBAAsB,EACtB,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,EACxB,UAAU,GACX,MAAM,gBAAgB,CAAC;AAgExB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** A streamed turn may remain silent while a no-expiry interaction is pending. */
|
|
2
|
+
export declare const fetchLongLivedTurn: typeof fetch;
|
|
3
|
+
/** Host-wake delivery is bounded by its explicit AbortSignal, not parser defaults. */
|
|
4
|
+
export declare const fetchLongLivedHostWake: typeof fetch;
|
|
5
|
+
//# sourceMappingURL=long-lived-fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"long-lived-fetch.d.ts","sourceRoot":"","sources":["../src/long-lived-fetch.ts"],"names":[],"mappings":"AAgCA,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,cAE7B,CAAC;AAEH,sFAAsF;AACtF,eAAO,MAAM,sBAAsB,cAGjC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { fetch as undiciFetch, getGlobalDispatcher, } from "undici";
|
|
2
|
+
function fetchWithParserTimeoutOverrides(overrides) {
|
|
3
|
+
return async (input, init) => {
|
|
4
|
+
// Preserve the process-wide dispatcher (including any operator-owned proxy
|
|
5
|
+
// or routing policy) and override only the parser timers for this request.
|
|
6
|
+
const dispatcher = getGlobalDispatcher().compose((dispatch) => (options, handler) => dispatch({ ...options, ...overrides }, handler));
|
|
7
|
+
return await undiciFetch(input, {
|
|
8
|
+
...init,
|
|
9
|
+
dispatcher,
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** A streamed turn may remain silent while a no-expiry interaction is pending. */
|
|
14
|
+
export const fetchLongLivedTurn = fetchWithParserTimeoutOverrides({
|
|
15
|
+
bodyTimeout: 0,
|
|
16
|
+
});
|
|
17
|
+
/** Host-wake delivery is bounded by its explicit AbortSignal, not parser defaults. */
|
|
18
|
+
export const fetchLongLivedHostWake = fetchWithParserTimeoutOverrides({
|
|
19
|
+
bodyTimeout: 0,
|
|
20
|
+
headersTimeout: 0,
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=long-lived-fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"long-lived-fetch.js","sourceRoot":"","sources":["../src/long-lived-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,WAAW,EACpB,mBAAmB,GAIpB,MAAM,QAAQ,CAAC;AAOhB,SAAS,+BAA+B,CACtC,SAAiC;IAEjC,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAC3B,2EAA2E;QAC3E,2EAA2E;QAC3E,MAAM,UAAU,GAAG,mBAAmB,EAAE,CAAC,OAAO,CAC9C,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,SAAS,EAAE,EAAE,OAAO,CAAC,CACpF,CAAC;QACF,OAAO,MAAM,WAAW,CACtB,KAA0B,EAC1B;YACE,GAAI,IAAsC;YAC1C,UAAU;SACX,CACgC,CAAC;IACtC,CAAC,CAAC;AACJ,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;IAChE,WAAW,EAAE,CAAC;CACf,CAAC,CAAC;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,sBAAsB,GAAG,+BAA+B,CAAC;IACpE,WAAW,EAAE,CAAC;IACd,cAAc,EAAE,CAAC;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WebMessagePart } from "./contracts.js";
|
|
2
|
+
/** Call only after the store verifies a host-owned Monitor delivery association. */
|
|
3
|
+
export declare function normalizeMonitorTerminalReply(parts: readonly WebMessagePart[], exactOnly?: boolean): {
|
|
4
|
+
parts: WebMessagePart[];
|
|
5
|
+
changed: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function hasMonitorReplyContent(parts: readonly WebMessagePart[]): boolean;
|
|
8
|
+
/** Match the settled console's answer selection, excluding earlier commentary. */
|
|
9
|
+
export declare function monitorReplyText(parts: readonly WebMessagePart[]): string;
|
|
10
|
+
//# sourceMappingURL=monitor-reply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitor-reply.d.ts","sourceRoot":"","sources":["../src/monitor-reply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,oFAAoF;AACpF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,EAAE,SAAS,UAAQ,GAAG;IAClG,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;CAClB,CA+BA;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,GAAG,OAAO,CAGhF;AAED,kFAAkF;AAClF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,CAMzE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { classifyNotifySuppression } from "@mono-agent/agent-contracts";
|
|
2
|
+
/** Call only after the store verifies a host-owned Monitor delivery association. */
|
|
3
|
+
export function normalizeMonitorTerminalReply(parts, exactOnly = false) {
|
|
4
|
+
const explicit = parts.flatMap((part, index) => isAssistantMessageBoundary(part, "assistant_message_boundary") ? [index] : []);
|
|
5
|
+
// Current Pi emits usage and an explicit boundary for the same message.
|
|
6
|
+
// Usage is a compatibility fallback, never an additional message end.
|
|
7
|
+
const boundaries = explicit.length > 0 ? explicit
|
|
8
|
+
: parts.flatMap((part, index) => isAssistantMessageBoundary(part, "context_usage") ? [index] : []);
|
|
9
|
+
const lastBoundary = boundaries.at(-1) ?? -1;
|
|
10
|
+
const hasTrailingContent = parts.slice(lastBoundary + 1).some((part) => part.type === "text" || part.type === "reasoning");
|
|
11
|
+
const end = lastBoundary >= 0 && !hasTrailingContent ? lastBoundary : parts.length;
|
|
12
|
+
let start = end === lastBoundary ? (boundaries.at(-2) ?? -1) + 1 : lastBoundary + 1;
|
|
13
|
+
// Older providers without explicit boundaries still separate tool messages.
|
|
14
|
+
for (let index = start; index < end; index += 1) {
|
|
15
|
+
if (parts[index]?.type === "tool-call" || parts[index]?.type === "subagent")
|
|
16
|
+
start = index + 1;
|
|
17
|
+
}
|
|
18
|
+
const textParts = parts.slice(start, end).filter((part) => part.type === "text");
|
|
19
|
+
// Without a provider boundary, separate prose parts may be separate assistant
|
|
20
|
+
// messages. Do not concatenate a prior answer into a narrated no-op reply.
|
|
21
|
+
if ((boundaries.length === 0 || start === 0) && textParts.length > 1)
|
|
22
|
+
return { parts: [...parts], changed: false };
|
|
23
|
+
const text = textParts.map((part) => part.text).join("");
|
|
24
|
+
const suppression = classifyNotifySuppression(text);
|
|
25
|
+
if (exactOnly && (suppression !== "sentinel"
|
|
26
|
+
|| parts.some((part) => part.type === "attachment" || part.type === "mcp_app" || part.type === "failure"))) {
|
|
27
|
+
return { parts: [...parts], changed: false };
|
|
28
|
+
}
|
|
29
|
+
if (suppression !== "sentinel" && suppression !== "narrated-sentinel") {
|
|
30
|
+
return { parts: [...parts], changed: false };
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
parts: parts.filter((part, index) => part.type !== "text" || index < start || index >= end),
|
|
34
|
+
changed: true,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function hasMonitorReplyContent(parts) {
|
|
38
|
+
return parts.some((part) => part.type === "text" ? part.text.trim().length > 0
|
|
39
|
+
: part.type === "attachment" || part.type === "mcp_app" || part.type === "failure");
|
|
40
|
+
}
|
|
41
|
+
/** Match the settled console's answer selection, excluding earlier commentary. */
|
|
42
|
+
export function monitorReplyText(parts) {
|
|
43
|
+
for (let index = parts.length - 1; index >= 0; index -= 1) {
|
|
44
|
+
const part = parts[index];
|
|
45
|
+
if (part?.type === "text")
|
|
46
|
+
return part.text;
|
|
47
|
+
}
|
|
48
|
+
return "";
|
|
49
|
+
}
|
|
50
|
+
/** Same bounded legacy telemetry unwrapping contract as the console runtime. */
|
|
51
|
+
function isAssistantMessageBoundary(part, kind) {
|
|
52
|
+
if (part.type !== "telemetry")
|
|
53
|
+
return false;
|
|
54
|
+
let current = part.data;
|
|
55
|
+
const seen = new Set();
|
|
56
|
+
for (let depth = 0; depth < 8; depth += 1) {
|
|
57
|
+
if (current === null || typeof current !== "object" || Array.isArray(current) || seen.has(current))
|
|
58
|
+
return false;
|
|
59
|
+
seen.add(current);
|
|
60
|
+
const record = current;
|
|
61
|
+
if (record.kind === kind)
|
|
62
|
+
return true;
|
|
63
|
+
current = record.data;
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=monitor-reply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitor-reply.js","sourceRoot":"","sources":["../src/monitor-reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,oFAAoF;AACpF,MAAM,UAAU,6BAA6B,CAAC,KAAgC,EAAE,SAAS,GAAG,KAAK;IAI/F,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,0BAA0B,CAAC,IA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OAAO,OAAO,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,OAAO,KAAK,CAAC;QACjH,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAClB,MAAM,MAAM,GAAG,OAAkC,CAAC;QAClD,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QACtC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;IACxB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentReplyPart, ProcessJobProjection } from "@mono-agent/agent-contracts";
|
|
1
|
+
import type { AgentReplyPart, MonitorProjection, ProcessJobProjection } from "@mono-agent/agent-contracts";
|
|
2
2
|
import type { WebThreadNotificationTriggerKind } from "./contracts.js";
|
|
3
3
|
import { type WebStatePathOptions } from "./state-paths.js";
|
|
4
4
|
export interface DeliverWebThreadNotificationInput {
|
|
@@ -19,7 +19,16 @@ export interface DeliverWebProcessJobNotificationInput {
|
|
|
19
19
|
readonly text?: string;
|
|
20
20
|
readonly parts?: readonly AgentReplyPart[];
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
/** One owner-authenticated Monitor wake addressed to its existing web thread. */
|
|
23
|
+
export interface DeliverWebMonitorNotificationInput {
|
|
24
|
+
readonly sourceId: string;
|
|
25
|
+
readonly triggerKind: "monitor";
|
|
26
|
+
readonly deliveryKey: string;
|
|
27
|
+
readonly threadId: string;
|
|
28
|
+
readonly monitor: MonitorProjection;
|
|
29
|
+
readonly wakePrompt: string;
|
|
30
|
+
}
|
|
31
|
+
export type DeliverWebNotificationInput = DeliverWebThreadNotificationInput | DeliverWebProcessJobNotificationInput | DeliverWebMonitorNotificationInput;
|
|
23
32
|
export interface DeliverWebNotificationOptions extends WebStatePathOptions {
|
|
24
33
|
readonly fetchImpl?: typeof fetch;
|
|
25
34
|
readonly timeoutMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-client.d.ts","sourceRoot":"","sources":["../src/notification-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"notification-client.d.ts","sourceRoot":"","sources":["../src/notification-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAE3G,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQlF,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,gCAAgC,CAAC;IACvD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qCAAqC;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;CAC5C;AAED,iFAAi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{ lstat, open } from "node:fs/promises";
|
|
3
3
|
import { errorMessage, WebConsoleError } from "./errors.js";
|
|
4
|
+
import { fetchLongLivedHostWake } from "./long-lived-fetch.js";
|
|
4
5
|
import { resolveWebStatePaths } from "./state-paths.js";
|
|
5
6
|
const NOTIFICATION_INGRESS_SCHEMA = 1;
|
|
6
7
|
const NOTIFICATION_INGRESS_PATH = "/internal/v1/notifications";
|
|
@@ -11,16 +12,16 @@ const DEFAULT_TIMEOUT_MS = 5_000;
|
|
|
11
12
|
export async function deliverWebNotification(input, options = {}) {
|
|
12
13
|
const path = resolveWebStatePaths(options).notificationIngress;
|
|
13
14
|
const ingress = await readIngressRecord(path);
|
|
14
|
-
const
|
|
15
|
+
const carriesWakeTurn = input.triggerKind === "monitor"
|
|
16
|
+
|| (input.triggerKind === "job" && input.wakePrompt !== undefined);
|
|
17
|
+
const fetchImpl = options.fetchImpl ?? (carriesWakeTurn ? fetchLongLivedHostWake : fetch);
|
|
15
18
|
let response;
|
|
16
19
|
try {
|
|
17
20
|
response = await fetchImpl(ingress.url, {
|
|
18
21
|
method: "POST",
|
|
19
22
|
redirect: "error",
|
|
20
23
|
signal: AbortSignal.timeout(options.timeoutMs
|
|
21
|
-
?? (
|
|
22
|
-
? 10 * 60 * 1_000
|
|
23
|
-
: DEFAULT_TIMEOUT_MS)),
|
|
24
|
+
?? (carriesWakeTurn ? 10 * 60 * 1_000 : DEFAULT_TIMEOUT_MS)),
|
|
24
25
|
headers: {
|
|
25
26
|
authorization: `Bearer ${ingress.token}`,
|
|
26
27
|
"content-type": "application/json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-client.js","sourceRoot":"","sources":["../src/notification-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAK/C,OAAO,EAAE,YAAY,EAAE,eAAe,EA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K,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAC,KAAgC;QAClC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AgentReplyPart, type ProcessJobProjection } from "@mono-agent/agent-contracts";
|
|
1
|
+
import { type AgentReplyPart, type MonitorProjection, type ProcessJobProjection } from "@mono-agent/agent-contracts";
|
|
2
2
|
import { type WebThreadNotificationTriggerKind } from "./contracts.js";
|
|
3
3
|
import type { WebService, WebServiceLogger } from "./service.js";
|
|
4
4
|
declare const INGRESS_SCHEMA = 1;
|
|
@@ -31,6 +31,13 @@ type ParsedNotificationRequest = {
|
|
|
31
31
|
readonly wakePrompt?: string;
|
|
32
32
|
readonly text?: string;
|
|
33
33
|
readonly parts?: readonly AgentReplyPart[];
|
|
34
|
+
} | {
|
|
35
|
+
readonly sourceId: string;
|
|
36
|
+
readonly triggerKind: "monitor";
|
|
37
|
+
readonly deliveryKey: string;
|
|
38
|
+
readonly threadId: string;
|
|
39
|
+
readonly monitor: MonitorProjection;
|
|
40
|
+
readonly wakePrompt: string;
|
|
34
41
|
};
|
|
35
42
|
export declare function parseNotificationRequest(body: unknown): ParsedNotificationRequest;
|
|
36
43
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-ingress.d.ts","sourceRoot":"","sources":["../src/notification-ingress.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"notification-ingress.d.ts","sourceRoot":"","sources":["../src/notification-ingress.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAgC,KAAK,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAErG,OAAO,KAAK,EAAE,UAAU,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