@cotal-ai/connector-core 0.115.2 → 0.116.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/dist/agent.d.ts +2 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +9 -4
- package/dist/agent.js.map +1 -1
- package/dist/agui-emitter.d.ts.map +1 -1
- package/dist/agui-emitter.js +3 -4
- package/dist/agui-emitter.js.map +1 -1
- package/dist/docs-bundle.generated.d.ts +1 -1
- package/dist/docs-bundle.generated.js +15 -15
- package/dist/docs-bundle.generated.js.map +1 -1
- package/dist/framing.d.ts.map +1 -1
- package/dist/framing.js +2 -13
- package/dist/framing.js.map +1 -1
- package/dist/manager-call.d.ts +2 -0
- package/dist/manager-call.d.ts.map +1 -1
- package/dist/manager-call.js +40 -8
- package/dist/manager-call.js.map +1 -1
- package/dist/seat-compile-cache.d.ts +51 -0
- package/dist/seat-compile-cache.d.ts.map +1 -0
- package/dist/seat-compile-cache.js +113 -0
- package/dist/seat-compile-cache.js.map +1 -0
- package/dist/tool-specs.d.ts.map +1 -1
- package/dist/tool-specs.js +7 -5
- package/dist/tool-specs.js.map +1 -1
- package/package.json +7 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-bundle.generated.js","sourceRoot":"","sources":["../src/docs-bundle.generated.ts"],"names":[],"mappings":"AAKA,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AAEtC,MAAM,UAAU,cAAc;IAC5B,OAAO;QACP,SAAS,EAAE,SAAS;QACpB,eAAe,EAAE,mEAAmE;QACpF,OAAO,EAAE;YACP;gBACE,MAAM,EAAE,eAAe;gBACvB,OAAO,EAAE,eAAe;gBACxB,MAAM,EAAE,0BAA0B;gBAClC,UAAU,EAAE,YAAY;gBACxB,SAAS,EAAE,yFAAyF;gBACpG,MAAM,EAAE,6rKAA6rK;aACtsK;YACD;gBACE,MAAM,EAAE,iBAAiB;gBACzB,OAAO,EAAE,YAAY;gBACrB,MAAM,EAAE,0BAA0B;gBAClC,UAAU,EAAE,YAAY;gBACxB,SAAS,EAAE,gHAAgH;gBAC3H,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"docs-bundle.generated.js","sourceRoot":"","sources":["../src/docs-bundle.generated.ts"],"names":[],"mappings":"AAKA,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AAEtC,MAAM,UAAU,cAAc;IAC5B,OAAO;QACP,SAAS,EAAE,SAAS;QACpB,eAAe,EAAE,mEAAmE;QACpF,OAAO,EAAE;YACP;gBACE,MAAM,EAAE,eAAe;gBACvB,OAAO,EAAE,eAAe;gBACxB,MAAM,EAAE,0BAA0B;gBAClC,UAAU,EAAE,YAAY;gBACxB,SAAS,EAAE,yFAAyF;gBACpG,MAAM,EAAE,6rKAA6rK;aACtsK;YACD;gBACE,MAAM,EAAE,iBAAiB;gBACzB,OAAO,EAAE,YAAY;gBACrB,MAAM,EAAE,0BAA0B;gBAClC,UAAU,EAAE,YAAY;gBACxB,SAAS,EAAE,gHAAgH;gBAC3H,MAAM,EAAE,kqfAAkqf;aAC3qf;YACD;gBACE,MAAM,EAAE,cAAc;gBACtB,OAAO,EAAE,cAAc;gBACvB,MAAM,EAAE,uBAAuB;gBAC/B,UAAU,EAAE,SAAS;gBACrB,SAAS,EAAE,wMAAwM;gBACnN,MAAM,EAAE,0ktBAA0ktB;aACnltB;YACD;gBACE,MAAM,EAAE,WAAW;gBACnB,OAAO,EAAE,kBAAkB;gBAC3B,MAAM,EAAE,mEAAmE;gBAC3E,UAAU,EAAE,WAAW;gBACvB,SAAS,EAAE,wMAAwM;gBACnN,MAAM,EAAE,wh7CAAwh7C;aACji7C;YACD;gBACE,MAAM,EAAE,0BAA0B;gBAClC,OAAO,EAAE,qBAAqB;gBAC9B,MAAM,EAAE,mCAAmC;gBAC3C,UAAU,EAAE,WAAW;gBACvB,SAAS,EAAE,gGAAgG;gBAC3G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AC/8tB;KACF,CAAC;AACF,CAAC"}
|
package/dist/framing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../src/framing.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAoBD,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,EAAE,gBAAgB,SAAM,GAAG,oBAAoB,CAOxG;
|
|
1
|
+
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../src/framing.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAoBD,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,EAAE,gBAAgB,SAAM,GAAG,oBAAoB,CAOxG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,iFAAiF;AACjF,wBAAgB,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAE5C;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAE5C;AAED;iGACiG;AACjG,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAOpD;AAYD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG9D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGxD"}
|
package/dist/framing.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* core's peer label, so the hook relay can reach it without pulling a tool surface in behind it, and
|
|
16
16
|
* so neither surface can drift into a second convention.
|
|
17
17
|
*/
|
|
18
|
-
import { peerLabel } from "@cotal-ai/core/peer-label";
|
|
18
|
+
import { LINE_BREAK, peerLabel } from "@cotal-ai/core/peer-label";
|
|
19
19
|
/**
|
|
20
20
|
* Control characters and lone surrogates a peer can put in a preview row, apart from the newline that
|
|
21
21
|
* `fmtBody` writes before each indented continuation.
|
|
@@ -41,17 +41,6 @@ export function renderInboxPreview(snapshot, maxRowCodePoints = 240) {
|
|
|
41
41
|
rows: snapshot.items.map((item) => boundedRow(fmtItem(item).replace(PREVIEW_CONTROL, "\uFFFD"), maxRowCodePoints)),
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
* What counts as a line break, which is more than what JavaScript splits on.
|
|
46
|
-
*
|
|
47
|
-
* Measured through the host frame a model is handed (an MCP text content part, stringified and
|
|
48
|
-
* parsed back): U+2028, U+2029 and U+0085 survive JSON transport intact, so a message carrying one
|
|
49
|
-
* of them put an unindented attribution line into the bytes the model receives. A JavaScript split
|
|
50
|
-
* on a newline does not see a line there and neither does `wc -l`, but a Unicode-aware splitter
|
|
51
|
-
* does, and the rule this serves is stated absolutely. The class is therefore every code point a
|
|
52
|
-
* line splitter may honour, not the two this repo used to know.
|
|
53
|
-
*/
|
|
54
|
-
const LINE_BREAK = /\r\n?|[\n\v\f\u0085\u2028\u2029]/g;
|
|
55
44
|
/**
|
|
56
45
|
* A PEER NAMES ITSELF, so its name is data and never framing.
|
|
57
46
|
*
|
|
@@ -81,7 +70,7 @@ export function fmtFrom(i) {
|
|
|
81
70
|
* attributed to another named peer, in a frame with nothing to tell the forgery from the frame.
|
|
82
71
|
*/
|
|
83
72
|
export function fmtBody(text) {
|
|
84
|
-
return text.
|
|
73
|
+
return text.split(LINE_BREAK).join("\n ");
|
|
85
74
|
}
|
|
86
75
|
/**
|
|
87
76
|
* One message as one line: the attribution in brackets, then the body.
|
package/dist/framing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framing.js","sourceRoot":"","sources":["../src/framing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"framing.js","sourceRoot":"","sources":["../src/framing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAQlE;;;;;;;;;GASG;AACH,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAEjD,mGAAmG;AACnG,SAAS,UAAU,CAAC,GAAW,EAAE,aAAqB;IACpD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC,MAAM,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC;AAClG,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,kBAAkB,CAAC,QAAuB,EAAE,gBAAgB,GAAG,GAAG;IAChF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,GAAG,EAAE,IAAI,gBAAgB,GAAG,KAAK;QAC1F,MAAM,IAAI,KAAK,CAAC,uEAAuE,gBAAgB,EAAE,CAAC,CAAC;IAC7G,OAAO;Q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CAAC;IACrD,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,YAAY,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;IAC9D,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;IACrG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;AACtG,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CAAC,OAA2B;IACpD,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,OAAO,CAAC,IAAwB;IAC9C,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAChD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACxC,CAAC"}
|
package/dist/manager-call.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type EpAttributedReply, type EpVerbTarget } from "@cotal-ai/core";
|
|
2
2
|
import type { AgentConfig } from "./config.js";
|
|
3
3
|
type ManagerConfig = Pick<AgentConfig, "space" | "servers" | "tls" | "lifecycleUid" | "userAuth" | "managerInstanceId">;
|
|
4
|
+
/** Forget every remembered legacy-rail verdict. For tests that reuse a process across stacks. */
|
|
5
|
+
export declare function forgetLegacyRail(): void;
|
|
4
6
|
/** Runs a call's submission under a goal follow. `prepare` runs the bearer command, opens the
|
|
5
7
|
* control connection and resolves the manager by the follow's deadline. It publishes nothing, so
|
|
6
8
|
* its failures surface as their own: a describe that draws no reply reports itself as unanswered,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager-call.d.ts","sourceRoot":"","sources":["../src/manager-call.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EAElB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,KAAK,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,GAAG,cAAc,GAAG,UAAU,GAAG,mBAAmB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"manager-call.d.ts","sourceRoot":"","sources":["../src/manager-call.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EAElB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,KAAK,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,GAAG,cAAc,GAAG,UAAU,GAAG,mBAAmB,CAAC,CAAC;AAqBxH,iGAAiG;AACjG,wBAAgB,gBAAgB,IAAI,IAAI,CAAwB;AAEhE;;;oFAGoF;AACpF,KAAK,iBAAiB,GAAG,CACvB,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,iBAAiB,CAAC,EAC5D,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,KAC9D,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhC,mGAAmG;AACnG,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,EACjD,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,YAAY,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GAC1G,OAAO,CAAC,iBAAiB,CAAC,CAqG5B"}
|
package/dist/manager-call.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import { BASELINE_LIFECYCLE_ENDPOINT, EpEnvelopeError, dialerFor, goalFollowRefusal, invokeCommand, isPermissionDenied, issuedUserCaller, managerCallerBinding, replyRefusedBeforeEffect, resolveService, standaloneConnectOpts, } from "@cotal-ai/core";
|
|
2
|
+
/** Credentials whose manager-call view the broker refused an accepted row for: legacy-rail views,
|
|
3
|
+
* asked once per credential per {@link LEGACY_RAIL_RECHECK_MS}. Keyed by the credential the bearer
|
|
4
|
+
* was minted from (its renewals keep it), else by the bearer itself. The recheck is what lets an
|
|
5
|
+
* issuer that starts issuing for this credential be noticed without a seat restart. */
|
|
6
|
+
const legacyRail = new Map();
|
|
7
|
+
const LEGACY_RAIL_RECHECK_MS = 60 * 60_000;
|
|
8
|
+
const LEGACY_RAIL_MAX = 32;
|
|
9
|
+
function onLegacyRail(key) {
|
|
10
|
+
const until = legacyRail.get(key);
|
|
11
|
+
if (until === undefined)
|
|
12
|
+
return false;
|
|
13
|
+
if (Date.now() < until)
|
|
14
|
+
return true;
|
|
15
|
+
legacyRail.delete(key);
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
function rememberLegacyRail(key) {
|
|
19
|
+
legacyRail.set(key, Date.now() + LEGACY_RAIL_RECHECK_MS);
|
|
20
|
+
if (legacyRail.size > LEGACY_RAIL_MAX)
|
|
21
|
+
legacyRail.delete(legacyRail.keys().next().value);
|
|
22
|
+
}
|
|
23
|
+
/** Forget every remembered legacy-rail verdict. For tests that reuse a process across stacks. */
|
|
24
|
+
export function forgetLegacyRail() { legacyRail.clear(); }
|
|
2
25
|
/** A control connection never replaces the seat's presence, messages or standing bearer source. */
|
|
3
26
|
export async function invokeUserManager(config, bearer, command, args, opts = {}) {
|
|
4
27
|
opts.signal?.throwIfAborted();
|
|
@@ -12,7 +35,8 @@ export async function invokeUserManager(config, bearer, command, args, opts = {}
|
|
|
12
35
|
const resolve = (signal = opts.signal, deadlineMs = opts.deadlineMs ?? 10_000) => resolveService(nc, config.space, endpoint, caller, { instanceId, deadlineMs, signal });
|
|
13
36
|
const connect = async (signal = opts.signal, deadline = Date.now() + (opts.deadlineMs ?? 10_000)) => {
|
|
14
37
|
const token = await bearer(signal);
|
|
15
|
-
|
|
38
|
+
let credentialId;
|
|
39
|
+
({ caller, instanceId, credentialId } = managerCallerBinding(token, {
|
|
16
40
|
space: config.space, owner: user.owner, actor: user.actor, lifecycleUid: config.lifecycleUid, instanceId: config.managerInstanceId,
|
|
17
41
|
}));
|
|
18
42
|
const connectOpts = standaloneConnectOpts({ bearer: token, sentinelCreds: user.sentinelCreds, tls: config.tls });
|
|
@@ -33,13 +57,21 @@ export async function invokeUserManager(config, bearer, command, args, opts = {}
|
|
|
33
57
|
signal?.throwIfAborted();
|
|
34
58
|
// Issued interactive views and eligible managed run views carry their own accepted-row read
|
|
35
59
|
// (SPEC 13.15). A managed view without that issuance remains on its legacy rail: the broker
|
|
36
|
-
// refuses the read as a RequestError whose cause is the permission violation.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
60
|
+
// refuses the read as a RequestError whose cause is the permission violation. That verdict is
|
|
61
|
+
// the credential's, not the connection's (the issuer wrote a row for an issued view at every
|
|
62
|
+
// callout, and never for a legacy one), so it is asked once per credential and rechecked
|
|
63
|
+
// hourly: a seat that pulls its turns every 15 s on a legacy view used to put one refused
|
|
64
|
+
// request in the broker's log each time, forever (#5040).
|
|
65
|
+
const railKey = credentialId ?? token;
|
|
66
|
+
if (!onLegacyRail(railKey)) {
|
|
67
|
+
try {
|
|
68
|
+
caller = await issuedUserCaller(nc, config.space, String(connectOpts.name), caller);
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
if (!isPermissionDenied(e))
|
|
72
|
+
throw e;
|
|
73
|
+
rememberLegacyRail(railKey);
|
|
74
|
+
}
|
|
43
75
|
}
|
|
44
76
|
};
|
|
45
77
|
// The describe spends what is left of the follow's deadline, so a silent manager reports itself.
|
package/dist/manager-call.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager-call.js","sourceRoot":"","sources":["../src/manager-call.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,GAKtB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"manager-call.js","sourceRoot":"","sources":["../src/manager-call.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,GAKtB,MAAM,gBAAgB,CAAC;AAMxB;;;wFAGwF;AACxF,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC7C,MAAM,sBAAsB,GAAG,EAAE,GAAG,MAAM,CAAC;AAC3C,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,SAAS,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/**
|
|
2
|
+
* The oldest Node a seat entry runs on. `enableCompileCache()` arrived in v22.8.0 and
|
|
3
|
+
* `flushCompileCache()` in v22.10.0, and the entry calls both, so v22.10.0 is the first Node that
|
|
4
|
+
* has all of it. The published `engines.node` says the same thing.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SEAT_NODE_FLOOR = "22.10.0";
|
|
7
|
+
/**
|
|
8
|
+
* Where the seat keeps its compile cache: `compile-cache` under this OS user's own Cotal
|
|
9
|
+
* directory, so it persists across restarts and upgrades and is never in a temp directory that a
|
|
10
|
+
* reboot clears. Node keys a subdirectory inside it, so a Node upgrade pays one compile instead of
|
|
11
|
+
* reading a stale entry.
|
|
12
|
+
*
|
|
13
|
+
* This repeats `userCotalDir()` from `@cotal-ai/workspace` because a connector peer-depends on
|
|
14
|
+
* `@cotal-ai/core` alone and cannot import the workspace layer. `pnpm smoke:seat-compile-cache`
|
|
15
|
+
* asserts the two agree, so they cannot drift apart.
|
|
16
|
+
*/
|
|
17
|
+
export declare function seatCompileCacheDir(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Refuse a runtime that cannot cache a seat's compile, before anything calls into the cache.
|
|
20
|
+
*
|
|
21
|
+
* Serving anyway without a cache is a silent downgrade of the one thing this entry exists for, so
|
|
22
|
+
* an old runtime is refused rather than degraded. The version is checked first and the two
|
|
23
|
+
* functions after it, so a runtime that reports the version without shipping the API gets this
|
|
24
|
+
* sentence instead of a `TypeError` from the next line. `label` prefixes the line, matching the
|
|
25
|
+
* seat's other stderr lines.
|
|
26
|
+
*/
|
|
27
|
+
export declare function assertSeatRuntime(label: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Enable the compile cache for everything this process loads after the call.
|
|
30
|
+
*
|
|
31
|
+
* The directory is created the way the rest of `~/.cotal` is created, 0700 and owner-only, because
|
|
32
|
+
* `enableCompileCache()` would otherwise create it at whatever the process umask allows and a
|
|
33
|
+
* seat's compiled bundle belongs to one user. Node still creates its own version-keyed directory
|
|
34
|
+
* inside it at the umask, and the 0700 above that is what keeps another user out.
|
|
35
|
+
*
|
|
36
|
+
* Neither step is allowed to end a seat. `enableCompileCache()` does not throw, it returns a
|
|
37
|
+
* status, so a cache this process cannot open prints one line with the real reason and the seat
|
|
38
|
+
* runs on without a cache. `label` prefixes that line.
|
|
39
|
+
*/
|
|
40
|
+
export declare function enableSeatCompileCache(label: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Write the code cache this process has accumulated to disk now.
|
|
43
|
+
*
|
|
44
|
+
* Node flushes the cache when the instance is about to exit, and a seat is normally ended by a
|
|
45
|
+
* signal, which runs no exit handler. Without this call the first seat on a new bundle would
|
|
46
|
+
* compile it, die to a signal, and leave the next seat nothing to read. Node documents this call
|
|
47
|
+
* for that case. It reports no errors by design: a cache write that fails must not disturb the
|
|
48
|
+
* seat.
|
|
49
|
+
*/
|
|
50
|
+
export declare function flushSeatCompileCache(): void;
|
|
51
|
+
//# sourceMappingURL=seat-compile-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-compile-cache.d.ts","sourceRoot":"","sources":["../src/seat-compile-cache.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAK5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAQrD;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAgB1D;AAMD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node's own compile cache, for the entry that launches a seat.
|
|
3
|
+
*
|
|
4
|
+
* A seat's shipped bundle is one 5-6 MB module. V8 parses it on every launch, and the parse leaves
|
|
5
|
+
* about 5.7 MiB retained in the process's main malloc arena for as long as the seat lives. Node's
|
|
6
|
+
* compile cache stores the V8 code cache on disk and removes that parse from every launch after the
|
|
7
|
+
* first one.
|
|
8
|
+
*
|
|
9
|
+
* It has to run from an entry IN FRONT of the bundle, never inside it. The cache covers modules
|
|
10
|
+
* compiled after `enableCompileCache()` returns, and a bundle's own compile is already finished
|
|
11
|
+
* before its first statement runs, so a call the bundler inlined into the bundle caches nothing.
|
|
12
|
+
* The seat entry (`dist/seat.cjs`) therefore enables the cache and then loads the bundle.
|
|
13
|
+
*/
|
|
14
|
+
import { constants, enableCompileCache, flushCompileCache } from "node:module";
|
|
15
|
+
import { homedir } from "node:os";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { mkSecretDir } from "@cotal-ai/core/secret-fs";
|
|
18
|
+
/**
|
|
19
|
+
* The oldest Node a seat entry runs on. `enableCompileCache()` arrived in v22.8.0 and
|
|
20
|
+
* `flushCompileCache()` in v22.10.0, and the entry calls both, so v22.10.0 is the first Node that
|
|
21
|
+
* has all of it. The published `engines.node` says the same thing.
|
|
22
|
+
*/
|
|
23
|
+
export const SEAT_NODE_FLOOR = "22.10.0";
|
|
24
|
+
/**
|
|
25
|
+
* Where the seat keeps its compile cache: `compile-cache` under this OS user's own Cotal
|
|
26
|
+
* directory, so it persists across restarts and upgrades and is never in a temp directory that a
|
|
27
|
+
* reboot clears. Node keys a subdirectory inside it, so a Node upgrade pays one compile instead of
|
|
28
|
+
* reading a stale entry.
|
|
29
|
+
*
|
|
30
|
+
* This repeats `userCotalDir()` from `@cotal-ai/workspace` because a connector peer-depends on
|
|
31
|
+
* `@cotal-ai/core` alone and cannot import the workspace layer. `pnpm smoke:seat-compile-cache`
|
|
32
|
+
* asserts the two agree, so they cannot drift apart.
|
|
33
|
+
*/
|
|
34
|
+
export function seatCompileCacheDir() {
|
|
35
|
+
const user = process.platform === "win32" && process.env.LOCALAPPDATA
|
|
36
|
+
? join(process.env.LOCALAPPDATA, "Cotal")
|
|
37
|
+
: join(homedir(), ".cotal");
|
|
38
|
+
return join(user, "compile-cache");
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Refuse a runtime that cannot cache a seat's compile, before anything calls into the cache.
|
|
42
|
+
*
|
|
43
|
+
* Serving anyway without a cache is a silent downgrade of the one thing this entry exists for, so
|
|
44
|
+
* an old runtime is refused rather than degraded. The version is checked first and the two
|
|
45
|
+
* functions after it, so a runtime that reports the version without shipping the API gets this
|
|
46
|
+
* sentence instead of a `TypeError` from the next line. `label` prefixes the line, matching the
|
|
47
|
+
* seat's other stderr lines.
|
|
48
|
+
*/
|
|
49
|
+
export function assertSeatRuntime(label) {
|
|
50
|
+
const reason = unsupportedRuntime();
|
|
51
|
+
if (!reason)
|
|
52
|
+
return;
|
|
53
|
+
process.stderr.write(`[${label}] fatal: unsupported_node: a Cotal seat needs Node >= ${SEAT_NODE_FLOOR}, ${reason}. ` +
|
|
54
|
+
`Upgrade Node, or run the server bundle dist/mcp.cjs, which needs no compile cache.\n`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
/** Why this runtime cannot run a seat entry, or nothing when it can. */
|
|
58
|
+
function unsupportedRuntime() {
|
|
59
|
+
const [floorMajor, floorMinor] = SEAT_NODE_FLOOR.split(".").map(Number);
|
|
60
|
+
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
61
|
+
if (major < floorMajor || (major === floorMajor && minor < floorMinor))
|
|
62
|
+
return `this is v${process.versions.node}`;
|
|
63
|
+
if (typeof enableCompileCache !== "function" || typeof flushCompileCache !== "function")
|
|
64
|
+
return `v${process.versions.node} reports the version but has no module compile cache`;
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Enable the compile cache for everything this process loads after the call.
|
|
69
|
+
*
|
|
70
|
+
* The directory is created the way the rest of `~/.cotal` is created, 0700 and owner-only, because
|
|
71
|
+
* `enableCompileCache()` would otherwise create it at whatever the process umask allows and a
|
|
72
|
+
* seat's compiled bundle belongs to one user. Node still creates its own version-keyed directory
|
|
73
|
+
* inside it at the umask, and the 0700 above that is what keeps another user out.
|
|
74
|
+
*
|
|
75
|
+
* Neither step is allowed to end a seat. `enableCompileCache()` does not throw, it returns a
|
|
76
|
+
* status, so a cache this process cannot open prints one line with the real reason and the seat
|
|
77
|
+
* runs on without a cache. `label` prefixes that line.
|
|
78
|
+
*/
|
|
79
|
+
export function enableSeatCompileCache(label) {
|
|
80
|
+
// Node's two cache environment variables decide this before we do: `NODE_COMPILE_CACHE` enables
|
|
81
|
+
// the cache in the operator's directory at startup, and `NODE_DISABLE_COMPILE_CACHE` turns it
|
|
82
|
+
// off. Either way the directory below is not the one in use, so do not create it and do not
|
|
83
|
+
// report on a cache this call does not own.
|
|
84
|
+
if (process.env.NODE_COMPILE_CACHE || process.env.NODE_DISABLE_COMPILE_CACHE)
|
|
85
|
+
return;
|
|
86
|
+
const dir = seatCompileCacheDir();
|
|
87
|
+
try {
|
|
88
|
+
mkSecretDir(dir);
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
unavailable(label, e.message);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const result = enableCompileCache(dir);
|
|
95
|
+
if (result.status === constants.compileCacheStatus.FAILED)
|
|
96
|
+
unavailable(label, result.message ?? "no reason reported");
|
|
97
|
+
}
|
|
98
|
+
function unavailable(label, reason) {
|
|
99
|
+
process.stderr.write(`[${label}] compile cache unavailable, continuing without it: ${reason}\n`);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Write the code cache this process has accumulated to disk now.
|
|
103
|
+
*
|
|
104
|
+
* Node flushes the cache when the instance is about to exit, and a seat is normally ended by a
|
|
105
|
+
* signal, which runs no exit handler. Without this call the first seat on a new bundle would
|
|
106
|
+
* compile it, die to a signal, and leave the next seat nothing to read. Node documents this call
|
|
107
|
+
* for that case. It reports no errors by design: a cache write that fails must not disturb the
|
|
108
|
+
* seat.
|
|
109
|
+
*/
|
|
110
|
+
export function flushSeatCompileCache() {
|
|
111
|
+
flushCompileCache();
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=seat-compile-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-compile-cache.js","sourceRoot":"","sources":["../src/seat-compile-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY;QACnE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC;QACzC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IACpC,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,IAAI,KAAK,yDAAyD,eAAe,KAAK,MAAM,IAAI;QAC9F,sFAAsF,CACzF,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,wEAAwE;AACxE,S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,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQhE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,OAAO,GAAG,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAGnJ;AAKD;;;;8CAI8C;AAC9C,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,MAAM,SAAc,EACpB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,EACvB,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAC5B,aAAa,EAAE,CAktCjB"}
|
package/dist/tool-specs.js
CHANGED
|
@@ -1260,7 +1260,7 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
}, "instance must be a lifecycle token ([a-z0-9]{26,32})")
|
|
1262
1262
|
.optional()
|
|
1263
|
-
.describe("Optional manager instance id for a multi-manager space.
|
|
1263
|
+
.describe("Optional manager instance id for a multi-manager space. An open managed seat defaults to its launching manager; an unbound open or static caller uses class anycast. User-auth selection remains issuer-bound. A pin that cannot be resolved is refused without falling back to another manager."),
|
|
1264
1264
|
role: z
|
|
1265
1265
|
.string()
|
|
1266
1266
|
.optional()
|
|
@@ -1664,9 +1664,10 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1664
1664
|
endpoint: z.string().min(1).max(200).describe("The endpoint name, e.g. com.example.orders."),
|
|
1665
1665
|
refresh: z.boolean().optional().describe("Resolve again instead of using this session's cached surface."),
|
|
1666
1666
|
},
|
|
1667
|
-
async run(agent,
|
|
1667
|
+
async run(agent, config, { endpoint, refresh }) {
|
|
1668
1668
|
try {
|
|
1669
|
-
const
|
|
1669
|
+
const instanceId = endpoint === "manager" && !isAuthed(config) ? config.managerInstanceId : undefined;
|
|
1670
|
+
const svc = await agent.ep.describeService(endpoint, { refresh, ...(instanceId !== undefined ? { instanceId } : {}) });
|
|
1670
1671
|
const commands = [...svc.commands.values()]
|
|
1671
1672
|
.sort((a, b) => a.command.localeCompare(b.command))
|
|
1672
1673
|
.map((c) => ({
|
|
@@ -1696,9 +1697,10 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1696
1697
|
self: z.boolean().optional().describe("Targeted commands only: act on this session itself."),
|
|
1697
1698
|
timeoutMs: z.number().int().min(1).max(120000).optional().describe("Reply deadline in milliseconds (default 30000)."),
|
|
1698
1699
|
},
|
|
1699
|
-
async run(agent,
|
|
1700
|
+
async run(agent, config, { endpoint, command, args, self, timeoutMs }) {
|
|
1700
1701
|
try {
|
|
1701
|
-
const
|
|
1702
|
+
const instanceId = endpoint === "manager" && self && !isAuthed(config) ? config.managerInstanceId : undefined;
|
|
1703
|
+
const r = await agent.ep.invokeService(endpoint, command, args, { deadlineMs: timeoutMs ?? 30_000, ...(self ? { target: { mode: "self" } } : {}), ...(instanceId !== undefined ? { instanceId } : {}) });
|
|
1702
1704
|
if (r.reply.ok !== true) {
|
|
1703
1705
|
const e = r.reply.error;
|
|
1704
1706
|
// An endpoint's error text is bounded like its data: nothing over the limit is cut, and
|