@cotal-ai/connector-core 0.90.1 → 0.92.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 +14 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +11 -0
- package/dist/agent.js.map +1 -1
- package/dist/docs-bundle.generated.d.ts +1 -1
- package/dist/docs-bundle.generated.js +35 -35
- package/dist/docs-bundle.generated.js.map +1 -1
- package/dist/docs.d.ts +31 -0
- package/dist/docs.d.ts.map +1 -1
- package/dist/docs.js +34 -27
- package/dist/docs.js.map +1 -1
- package/dist/feedback.d.ts +25 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/feedback.js +37 -0
- package/dist/feedback.js.map +1 -0
- package/dist/framing.d.ts +7 -1
- package/dist/framing.d.ts.map +1 -1
- package/dist/framing.js +25 -0
- package/dist/framing.js.map +1 -1
- package/dist/gateway.d.ts +2 -1
- package/dist/gateway.d.ts.map +1 -1
- package/dist/gateway.js +45 -5
- package/dist/gateway.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/orientation.d.ts +24 -0
- package/dist/orientation.d.ts.map +1 -1
- package/dist/orientation.js +29 -2
- package/dist/orientation.js.map +1 -1
- package/dist/tool-specs.d.ts.map +1 -1
- package/dist/tool-specs.js +17 -40
- package/dist/tool-specs.js.map +1 -1
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export * from "./agui-holder.js";
|
|
|
12
12
|
export * from "./agui-render.js";
|
|
13
13
|
export * from "./agui-wal-path.js";
|
|
14
14
|
export * from "./framing.js";
|
|
15
|
+
export * from "./feedback.js";
|
|
15
16
|
export * from "./tool-specs.js";
|
|
16
17
|
export * from "./orientation.js";
|
|
17
18
|
export * from "./docs.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
package/dist/orientation.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ export declare const MESH_FIRST_STEER: string;
|
|
|
25
25
|
* at durable cotal-lang runs for coordination that must outlive their own session, so the reflex is
|
|
26
26
|
* a journalled `cotal run` rather than an improvised loop held in one agent's context. */
|
|
27
27
|
export declare const WORKFLOW_STEER: string;
|
|
28
|
+
/** Where to talk, folded in beside {@link ORIENTATION_BOOTSTRAP} for every connector. A fresh seat
|
|
29
|
+
* may start on no channel, so it is told how to find its team's channel and which surface fits
|
|
30
|
+
* which kind of message. Guidance only: it grants nothing and changes no subscription. */
|
|
31
|
+
export declare const CHANNEL_GUIDANCE: string;
|
|
28
32
|
/** A tool the agent can actually call (already gated), as it appears in the card. */
|
|
29
33
|
export interface OrientationTool {
|
|
30
34
|
name: string;
|
|
@@ -37,6 +41,26 @@ export interface Orientation {
|
|
|
37
41
|
* the identity/access/capabilities/tools fields are static for the session. */
|
|
38
42
|
generatedAt: number;
|
|
39
43
|
identity: {
|
|
44
|
+
/** Whether this endpoint has completed its mesh bind. Configured labels are not a bound identity. */
|
|
45
|
+
state: "bound" | "unbound";
|
|
46
|
+
/** Human-facing label. It is deliberately separate from the wire principal. */
|
|
47
|
+
display: {
|
|
48
|
+
name: string;
|
|
49
|
+
role: string;
|
|
50
|
+
};
|
|
51
|
+
/** Broker-routed owner+actor identity, or explicit unknowns when no principal can be established. */
|
|
52
|
+
principal: {
|
|
53
|
+
owner: string;
|
|
54
|
+
actor: string;
|
|
55
|
+
};
|
|
56
|
+
/** This incarnation's lifecycle identity. Open/legacy callers that do not expose it report unknown. */
|
|
57
|
+
lifecycleUid: string;
|
|
58
|
+
/** Replacement evidence available to this connector. A predecessor UID is never inferred. */
|
|
59
|
+
replacement: {
|
|
60
|
+
state: "replacement" | "unknown";
|
|
61
|
+
predecessorLifecycleUid: string;
|
|
62
|
+
};
|
|
63
|
+
/** Existing compatibility fields retained for renderers and callers. */
|
|
40
64
|
name: string;
|
|
41
65
|
role?: string;
|
|
42
66
|
space: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orientation.d.ts","sourceRoot":"","sources":["../src/orientation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"orientation.d.ts","sourceRoot":"","sources":["../src/orientation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAgC,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACvG,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAGzD;;2DAE2D;AAC3D,eAAO,MAAM,qBAAqB,QAEmC,CAAC;AAEtE;;;2GAG2G;AAC3G,eAAO,MAAM,gBAAgB,QAIiE,CAAC;AAE/F;;2FAE2F;AAC3F,eAAO,MAAM,cAAc,QAIuC,CAAC;AAEnE;;2FAE2F;AAC3F,eAAO,MAAM,gBAAgB,QAG+D,CAAC;AAE7F,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,gGAAgG;IAChG,CAAC,EAAE,CAAC,CAAC;IACL;oFACgF;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,qGAAqG;QACrG,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;QAC3B,+EAA+E;QAC/E,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QACxC,qGAAqG;QACrG,SAAS,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CA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C;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACxF;AAgBD;;;oEAGoE;AACpE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,CAmB1E;AAED;;wFAEwF;AACxF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,eAAe,EAAE,EAC/B,WAAW,EAAE,MAAM,GAClB,WAAW,CA2Db;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,CAyCxD"}
|
package/dist/orientation.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* The typed {@link Orientation} object is the source of truth; {@link renderOrientation} is one view of
|
|
10
10
|
* it (the text the model reads). A future MCP resource can JSON-stringify the object directly.
|
|
11
11
|
*/
|
|
12
|
-
import { peerLabel } from "@cotal-ai/core";
|
|
12
|
+
import { parsePrincipalKey, peerLabel } from "@cotal-ai/core";
|
|
13
13
|
import { presenceViewCondition } from "./agent.js";
|
|
14
14
|
import { isAuthed } from "./config.js";
|
|
15
15
|
import { DOCS_VERSION } from "./docs.js";
|
|
@@ -33,6 +33,12 @@ export const WORKFLOW_STEER = "Coordination that must survive restarts (multi-st
|
|
|
33
33
|
"fan-out over agents) belongs in a durable workflow run: a cotal-lang program driven with " +
|
|
34
34
|
"`cotal run start`, resumable on any host from its step journal. Read the `workflows` page via " +
|
|
35
35
|
"cotal_docs before improvising such a loop in your own context.";
|
|
36
|
+
/** Where to talk, folded in beside {@link ORIENTATION_BOOTSTRAP} for every connector. A fresh seat
|
|
37
|
+
* may start on no channel, so it is told how to find its team's channel and which surface fits
|
|
38
|
+
* which kind of message. Guidance only: it grants nothing and changes no subscription. */
|
|
39
|
+
export const CHANNEL_GUIDANCE = "To work with your team, find its channel with cotal_channels and join it with cotal_join, then " +
|
|
40
|
+
"post team work there with cotal_send. Use cotal_dm for one specific peer and cotal_anycast to ask " +
|
|
41
|
+
"whoever holds a role. Post on #announce only for a deliberate notice to the whole space.";
|
|
36
42
|
/** The everyday loop (the `core` group); every other tool falls into `more`. Keep in sync with the
|
|
37
43
|
* reply/loop tools an agent reaches for each turn. An unknown/new tool defaults to `more`. */
|
|
38
44
|
const CORE_TOOLS = new Set([
|
|
@@ -86,10 +92,26 @@ export function buildOrientation(agent, config, visibleTools, generatedAt) {
|
|
|
86
92
|
const summary = peers.length
|
|
87
93
|
? shown.join(", ") + (peers.length > shown.length ? `, +${peers.length - shown.length} more` : "")
|
|
88
94
|
: "no other peers present";
|
|
95
|
+
const principal = parsePrincipalKey(agent.id);
|
|
89
96
|
return {
|
|
90
97
|
v: 1,
|
|
91
98
|
generatedAt,
|
|
92
|
-
identity: {
|
|
99
|
+
identity: {
|
|
100
|
+
state: agent.connected ? "bound" : "unbound",
|
|
101
|
+
display: { name: config.name, role: config.role ?? "unknown" },
|
|
102
|
+
principal: principal ?? { owner: "unknown", actor: "unknown" },
|
|
103
|
+
lifecycleUid: config.lifecycleUid ?? "unknown",
|
|
104
|
+
replacement: {
|
|
105
|
+
state: "unknown",
|
|
106
|
+
predecessorLifecycleUid: "unknown",
|
|
107
|
+
},
|
|
108
|
+
name: config.name,
|
|
109
|
+
role: config.role,
|
|
110
|
+
space: config.space,
|
|
111
|
+
id: agent.id,
|
|
112
|
+
cotalVersion: DOCS_VERSION,
|
|
113
|
+
...(config.model ? { model: config.model } : {}),
|
|
114
|
+
},
|
|
93
115
|
access: {
|
|
94
116
|
// AUTHENTICATED, not "has static creds": a user-auth mesh has no static creds and its grants
|
|
95
117
|
// are broker-enforced, so `!!config.creds` told every agent on one that its grants were
|
|
@@ -122,6 +144,11 @@ export function renderOrientation(o) {
|
|
|
122
144
|
o.access.readAcl.some((c) => !o.access.read.includes(c));
|
|
123
145
|
const lines = [
|
|
124
146
|
`You are ${who} in space "${o.identity.space}" (id ${o.identity.id.slice(0, 8)}…).`,
|
|
147
|
+
`Identity state: ${o.identity.state}`,
|
|
148
|
+
` • display: ${o.identity.display.name}/${o.identity.display.role}`,
|
|
149
|
+
` • principal: ${o.identity.principal.owner}.${o.identity.principal.actor}`,
|
|
150
|
+
` • lifecycle UID: ${o.identity.lifecycleUid}`,
|
|
151
|
+
` • replacement: ${o.identity.replacement.state} · predecessor lifecycle UID: ${o.identity.replacement.predecessorLifecycleUid}`,
|
|
125
152
|
`Cotal v${o.identity.cotalVersion} — call cotal_docs for the version-exact spec, schema, and guides. ` +
|
|
126
153
|
"Consult it before answering about Cotal or writing code against it; don't rely on training memory.",
|
|
127
154
|
o.identity.model
|
package/dist/orientation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orientation.js","sourceRoot":"","sources":["../src/orientation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAA2C,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"orientation.js","sourceRoot":"","sources":["../src/orientation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAA2C,MAAM,gBAAgB,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAkB,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAoB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;2DAE2D;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAChC,uIAAuI;IACvI,mEAAmE,CAAC;AAEtE;;;2GAG2G;AAC3G,MAAM,CAAC,MAAM,gBAAgB,GAC3B,qGAAqG;IACrG,qGAAqG;IACrG,mGAAmG;IACnG,4FAA4F,CAAC;AAE/F;;2FAE2F;AAC3F,MAAM,CAAC,MAAM,cAAc,GACzB,6FAA6F;IAC7F,2FAA2F;IAC3F,gGAAgG;IAChG,gEAAgE,CAAC;AAEnE;;2FAE2F;AA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CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,EACpE,EAAE,EACF,yBAAyB,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,IAAI,EAClE,eAAe,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,SAAS,EAAE,EACnE,sBAAsB,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,EAC5D,sBAAsB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,EACpF,eAAe,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,EAC/B,EAAE,EACF,eAAe,CAAC,CAAC,OAAO,CAAC,IAAI,0BAA0B,CAAC,CAAC,OAAO,CAAC,YAAY,KAAK;QAChF,YAAY,CAAC,CAAC,OAAO,CAAC,YAAY,kBAAkB,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAC1E,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/tool-specs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-specs.d.ts","sourceRoot":"","sources":["../src/tool-specs.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAI7E,OAAO,
|
|
1
|
+
{"version":3,"file":"tool-specs.d.ts","sourceRoot":"","sources":["../src/tool-specs.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAmB,KAAK,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EAAkE;IAClE,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,oCAAoC;IACpC,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB;gEAC4D;IAC5D,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B,uEAAuE;IACvE,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,KAAK,MAAM,CAAC;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACjC,GAAG,aAAa,CA4FhB;AAqRD,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,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,CA+nCjB"}
|
package/dist/tool-specs.js
CHANGED
|
@@ -14,7 +14,8 @@ import { afterRecallMark } from "./agent.js";
|
|
|
14
14
|
// The neutralization and the per-item rendering live in `framing.ts`, one convention shared with
|
|
15
15
|
// the auto-injected block, and are used here rather than restated. See that file for the rule.
|
|
16
16
|
import { attributionSafe, fmtBody, fmtItem, fmtFrom } from "./framing.js";
|
|
17
|
-
import {
|
|
17
|
+
import { isAuthed } from "./config.js";
|
|
18
|
+
import { submitFeedback } from "./feedback.js";
|
|
18
19
|
import { buildOrientation, presenceLiveness, renderOrientation } from "./orientation.js";
|
|
19
20
|
import { runDocs } from "./docs.js";
|
|
20
21
|
const ok = (text) => ({ text });
|
|
@@ -563,7 +564,7 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
563
564
|
{
|
|
564
565
|
name: "cotal_orientation",
|
|
565
566
|
title: "Cotal: orient (who you are & what you can do)",
|
|
566
|
-
description: "Your orientation card: who you are (name/role
|
|
567
|
+
description: "Your orientation card: who you are (bound state, display name/role, owner+actor principal, lifecycle and replacement identity, space), the recorded model pin if one was set, the channels you can read and post to, " +
|
|
567
568
|
"your capabilities, the tools available to you (grouped into a core loop plus the rest), who's " +
|
|
568
569
|
"present, your status/attention, and how many messages are unread. Call this first to get your " +
|
|
569
570
|
"bearings; it's read-only and safe to re-check anytime.",
|
|
@@ -983,7 +984,12 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
983
984
|
const at = recipientStatusAtSend === "unrostered"
|
|
984
985
|
? "recipient had no roster row at send: it messaged you from a connection that never joined the roster or has left it, so the space's DM history keeps this DM under its id and it may never reach an inbox"
|
|
985
986
|
: `recipient was ${recipientStatusAtSend} at send`;
|
|
986
|
-
|
|
987
|
+
// The DM durable belongs to the recipient's lifecycle (SPEC §8): the same session gets it on
|
|
988
|
+
// reconnect, and a new spawn under that name starts after it.
|
|
989
|
+
const offline = recipientStatusAtSend === "offline"
|
|
990
|
+
? ` ${recipient.name} is offline: the DM is delivered when ${recipient.name} reconnects, and a new agent spawned as ${recipient.name} does not receive it.`
|
|
991
|
+
: "";
|
|
992
|
+
return ok(`DM stored as seq ${ack.seq} for ${recipient.name} (${at}; delivery not confirmed).${offline}${dup}`);
|
|
987
993
|
}
|
|
988
994
|
catch (e) {
|
|
989
995
|
if (e instanceof AmbiguousPeerError) {
|
|
@@ -1184,7 +1190,7 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1184
1190
|
{
|
|
1185
1191
|
name: "cotal_spawn",
|
|
1186
1192
|
title: "Cotal: spawn a new teammate",
|
|
1187
|
-
description: "Ask the manager to start a new peer endpoint in your space. It joins the mesh as a lateral peer and, under the cmux runtime, appears in its own tab. A Cotal peer is a real, addressable process the user can watch; you can reach it by DM, find it on the roster, and coordinate with it later. Use it for teammate work that should stay visible on the mesh. Pass `prompt` when it should begin immediately; the connector auto-submits that prompt as its first turn. When you first bring a team online, if the live web dashboard is down, suggest `cotal
|
|
1193
|
+
description: "Ask the manager to start a new peer endpoint in your space. It joins the mesh as a lateral peer and, under the cmux runtime, appears in its own tab. A Cotal peer is a real, addressable process the user can watch; you can reach it by DM, find it on the roster, and coordinate with it later. Use it for teammate work that should stay visible on the mesh. Pass `prompt` when it should begin immediately; the connector auto-submits that prompt as its first turn. When you first bring a team online, if the live web dashboard is down, suggest `cotal watch` for a live terminal view. The dashboard service is configured and started separately; do not install or launch it implicitly.",
|
|
1188
1194
|
schema: {
|
|
1189
1195
|
name: z.string().describe("Which persona to spawn: the persona FILENAME in .cotal/agents (e.g. `review-critic`), without the .md. The new peer joins under the persona's own `name:` (auto-numbered with an underscore, e.g. socrates_2, if that's taken). Fails if no such persona file exists; spawn an existing persona, don't invent a name."),
|
|
1190
1196
|
instance: z
|
|
@@ -1293,37 +1299,8 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1293
1299
|
},
|
|
1294
1300
|
async run(_agent, _config, args) {
|
|
1295
1301
|
const { email, ...payload } = args;
|
|
1296
|
-
const
|
|
1297
|
-
|
|
1298
|
-
const body = { ...payload, source };
|
|
1299
|
-
if (config.feedbackKey) {
|
|
1300
|
-
headers.authorization = `Bearer ${config.feedbackKey}`;
|
|
1301
|
-
}
|
|
1302
|
-
else {
|
|
1303
|
-
const contact = resolveFeedbackEmail(email, env);
|
|
1304
|
-
if (!contact)
|
|
1305
|
-
return err("Keyless feedback goes to the public cotal.ai intake, which requires a traceable contact email — ask the user for one and retry with the email argument (or set COTAL_FEEDBACK_EMAIL).");
|
|
1306
|
-
body.email = contact;
|
|
1307
|
-
}
|
|
1308
|
-
try {
|
|
1309
|
-
const res = await fetch(url, { method: "POST", headers, body: JSON.stringify(body) });
|
|
1310
|
-
const raw = await res.text();
|
|
1311
|
-
let reply = {};
|
|
1312
|
-
if (raw)
|
|
1313
|
-
try {
|
|
1314
|
-
reply = JSON.parse(raw);
|
|
1315
|
-
}
|
|
1316
|
-
catch {
|
|
1317
|
-
reply = { error: raw };
|
|
1318
|
-
}
|
|
1319
|
-
if (!res.ok)
|
|
1320
|
-
return err(`Feedback rejected (${res.status}${reply.error ? `: ${reply.error}` : ""}).`);
|
|
1321
|
-
const note = reply.published === false ? " (stored, but the internal feedback channel publish failed)" : "";
|
|
1322
|
-
return ok(`Feedback sent${reply.id ? ` (id ${reply.id})` : ""}${note}. Thanks!`);
|
|
1323
|
-
}
|
|
1324
|
-
catch (e) {
|
|
1325
|
-
return err(`Couldn't reach the feedback intake at ${url}: ${e.message}`);
|
|
1326
|
-
}
|
|
1302
|
+
const contact = config.feedbackKey ? undefined : resolveFeedbackEmail(email, env);
|
|
1303
|
+
return submitFeedback({ ...payload, source }, { key: config.feedbackKey, url: config.feedbackUrl, email: contact });
|
|
1327
1304
|
},
|
|
1328
1305
|
},
|
|
1329
1306
|
{
|
|
@@ -1381,7 +1358,7 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1381
1358
|
{
|
|
1382
1359
|
name: "cotal_run",
|
|
1383
1360
|
title: "Cotal: run a workflow program",
|
|
1384
|
-
description: "Use Cotal Lang to program multi-step coordination between agents: sequence work, run tasks in parallel, branch on results, wait for events, and request human decisions. Agents own their reasoning and conversations; the workflow specifies when they act and which outcomes determine the next step.\n\nBefore writing a program, read cotal_docs pages `workflows` and `lang-card`. Hosted execution requires a running execution-capable manager, the `run` capability, and issued caller authority. A managed agent on a user-auth mesh uses its own bearer command and selected participant manager; both its current grant and its direct parent's current grant must allow `run`. Open meshes, unsupported local user-mode hosts and execution-free control managers refuse hosted runs. `@cotal-ai/lang` provides validation and simulation separately; those are not verbs of this tool.\n\nSTART: pass `verb: \"start\"` and the program text in `source`. Example: `{\"verb\":\"start\",\"source\":\"await sleep(\\\"1s\\\", { name: \\\"first-run\\\" });\"}`. Optional `file` labels diagnostics only; it reads nothing from disk. The manager validates before recording the run and returns a runId. Acceptance is not completion.\n\nINSPECT: use `verb: \"status\"` with that `runId` for state and step journal, or `verb: \"ps\"` to list runs. Both are read-only. Report completion only after observing state `completed`; surface failures or unresolved steps.\n\nANSWER: first inspect status, then pass `verb: \"answer\"`, `runId`, the exact open `stepKey`, and, when requested, `value` matching the answer shape. An ask requires its requested record; a checkpoint can resolve without a value. `artifact` may name the evidence reviewed. Answer only with authority to make that decision; never invent an approval.\n\nRESUME: pass `verb: \"resume\"` and `runId` to continue a run from its recorded source. A held run appears as `released` in status. Do not start a duplicate run to continue it or resume one the manager is already driving.\n\nRuns continue independently of your session and can recover after a manager restart. Their channel effects are bounded by the starting credential's issued channel scope. To report that your assigned agent turn is blocked or handed off, use `cotal_yield` instead.",
|
|
1361
|
+
description: "Use Cotal Lang to program multi-step coordination between agents: sequence work, run tasks in parallel, branch on results, wait for events, and request human decisions. Agents own their reasoning and conversations; the workflow specifies when they act and which outcomes determine the next step.\n\nBefore writing a program, read cotal_docs pages `workflows` and `lang-card`. Hosted execution requires a running execution-capable manager, the `run` capability, and issued caller authority. A managed agent on a user-auth mesh uses its own bearer command and selected participant manager; both its current grant and its direct parent's current grant must allow `run`. Open meshes, unsupported local user-mode hosts and execution-free control managers refuse hosted runs. `@cotal-ai/lang` provides validation and simulation separately; those are not verbs of this tool.\n\nSTART: pass `verb: \"start\"` and the program text in `source`. Example: `{\"verb\":\"start\",\"source\":\"await sleep(\\\"1s\\\", { name: \\\"first-run\\\" });\"}`. Optional `file` labels diagnostics only; it reads nothing from disk. The manager validates before recording the run and returns a runId. Acceptance is not completion.\n\nINSPECT: use `verb: \"status\"` with that `runId` for state and step journal, or `verb: \"ps\"` to list runs. Both are read-only. Report completion only after observing state `completed`; surface failures or unresolved steps.\n\nANSWER: first inspect status, then pass `verb: \"answer\"`, `runId`, the exact open `stepKey`, and, when requested, `value` matching the answer shape. An ask requires its requested record; a checkpoint can resolve without a value. `artifact` may name the evidence reviewed. Answer only with authority to make that decision; never invent an approval.\n\nRESUME: pass `verb: \"resume\"` and `runId` to continue a run from its recorded source. A held run appears as `released` in status. Do not start a duplicate run to continue it or resume one the manager is already driving.\n\nRuns continue independently of your session and can recover after a manager restart. Their channel effects are bounded by the starting credential's issued channel scope. To report that your assigned agent turn is blocked or handed off, use `cotal_yield` instead. Pass `instance` for the exact manager when an unbound user-auth caller has several managers; a failed pin does not fall back.",
|
|
1385
1362
|
schema: {
|
|
1386
1363
|
verb: z.enum(["start", "status", "ps", "answer", "resume"]).describe("start = validate and drive a new program; status = one run's record + journal; ps = list runs; answer = resolve an open checkpoint/ask; resume = take a released or held run over."),
|
|
1387
1364
|
source: z.string().min(1).optional().describe("start only: the cotal-lang program source, inline. Required for start."),
|
|
@@ -1413,7 +1390,7 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1413
1390
|
if (!reply.ok)
|
|
1414
1391
|
return err(renderRunRefusal("start", reply));
|
|
1415
1392
|
const { runId } = reply.data;
|
|
1416
|
-
return ok(`Started run ${runId} on the manager. It runs there until it completes or is held; cotal_run(verb="status", runId="${runId}") follows its steps, and an open checkpoint is answered with verb="answer".`);
|
|
1393
|
+
return ok(`Started run ${runId} on the manager. It runs there until it completes or is held; cotal_run(verb="status", runId="${runId}"${a.instance ? `, instance="${a.instance}"` : ""}) follows its steps, and an open checkpoint is answered with verb="answer"${a.instance ? ` on instance="${a.instance}"` : ""}.`);
|
|
1417
1394
|
}
|
|
1418
1395
|
if (a.verb === "resume") {
|
|
1419
1396
|
const missing = need("runId", "resume");
|
|
@@ -1422,7 +1399,7 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1422
1399
|
const reply = await agent.run("resume", { runId: a.runId, timeout: a.timeout }, a.instance);
|
|
1423
1400
|
if (!reply.ok)
|
|
1424
1401
|
return err(renderRunRefusal("resume", reply));
|
|
1425
|
-
return ok(`Resumed run ${a.runId} on the manager from its recorded program.`);
|
|
1402
|
+
return ok(`Resumed run ${a.runId} on the manager from its recorded program.${a.instance ? ` Use instance="${a.instance}" for subsequent status and answer calls to this manager.` : ""}`);
|
|
1426
1403
|
}
|
|
1427
1404
|
if (a.verb === "ps") {
|
|
1428
1405
|
const reply = await agent.run("ps", { endpoint: a.endpoint, ...(a.page !== undefined ? { page: a.page } : {}) }, a.instance);
|
|
@@ -1474,7 +1451,7 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1474
1451
|
{
|
|
1475
1452
|
name: "cotal_persona",
|
|
1476
1453
|
title: "Cotal: define a persona",
|
|
1477
|
-
description: "Define a new persona and save it as config (the manager writes .cotal/agents/<name>.md). It stays silent unless you pass `announce` with a channel. Afterwards cotal_spawn(name) launches a real agent wearing this persona/model. A prompt that is already a complete agent file (its own --- frontmatter) is merged into one block: grants, role, and agent from that block survive, and explicit arguments such as model win. A malformed leading frontmatter block is refused rather than wrapped.",
|
|
1454
|
+
description: "Define a new persona and save it as config (the manager writes .cotal/agents/<name>.md). It stays silent unless you pass `announce` with a channel. Afterwards cotal_spawn(name) launches a real agent wearing this persona/model. A prompt that is already a complete agent file (its own --- frontmatter) is merged into one block: grants, role, and agent from that block survive, and explicit arguments such as model win. A malformed leading frontmatter block is refused rather than wrapped. Pass `instance` to save on one full manager instance in a multi-manager space; a failed pin never falls back.",
|
|
1478
1455
|
schema: {
|
|
1479
1456
|
name: z
|
|
1480
1457
|
.string()
|
|
@@ -1534,7 +1511,7 @@ export function cotalToolSpecs(config, source = "connector", env, offered) {
|
|
|
1534
1511
|
{
|
|
1535
1512
|
name: "cotal_personas",
|
|
1536
1513
|
title: "Cotal: list or show personas",
|
|
1537
|
-
description: "Read the workspace persona catalog the manager owns (.cotal/agents). Omit `name` to list spawnable persona names (role, model, and a one-line description when you own the file). Pass `name` to show one card you own, including the persona body. Same ownership as cotal_persona: a file you do not own lists as a name only, while unauthorized, unknown, and unparseable shows are all not-found. Use this to see whether a name is taken before cotal_persona, or what a teammate's persona says, without shelling out.",
|
|
1514
|
+
description: "Read the workspace persona catalog the manager owns (.cotal/agents). Omit `name` to list spawnable persona names (role, model, and a one-line description when you own the file). Pass `name` to show one card you own, including the persona body. Same ownership as cotal_persona: a file you do not own lists as a name only, while unauthorized, unknown, and unparseable shows are all not-found. Use this to see whether a name is taken before cotal_persona, or what a teammate's persona says, without shelling out. Pass `instance` to read one manager's catalog when the owner has several managers.",
|
|
1538
1515
|
schema: {
|
|
1539
1516
|
name: z
|
|
1540
1517
|
.string()
|