@flowy-agent-store/protocol 0.1.0-beta.6 → 0.1.0-beta.7

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/index.cjs CHANGED
@@ -57,8 +57,23 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
57
57
  * `source_kind: "zip"`, one archive whose root *is* the market root. The
58
58
  * official bundles move to it because the old `url` form made a first fetch
59
59
  * mirror 14,714 files (611 MiB) for `experts` alone (doc `30`).
60
+ * **`fp-8` adds expert definition export**: `agent/export` and `team/export`
61
+ * return an {@link ExpertPack} — the persona, model hints, skill references and
62
+ * (for a team) the roster with every member expanded. Nothing existing changes
63
+ * shape, but the response carries the Agent Markdown body, which the catalog
64
+ * faces deliberately never do; both methods are WebSocket-only, so the
65
+ * documented route split becomes `48 / 73` (doc `32`).
60
66
  */
61
- const APP_SERVER_PROTOCOL_VERSION = "fp-7";
67
+ const APP_SERVER_PROTOCOL_VERSION = "fp-8";
68
+ /**
69
+ * Format version of {@link ExpertPack}.
70
+ *
71
+ * **Independent of {@link APP_SERVER_PROTOCOL_VERSION}** on purpose: the
72
+ * fingerprint versions *our* wire compatibility, this versions the **artifact
73
+ * contract for third-party runtimes**. Gate on this one; the fingerprint is
74
+ * about whether your client can talk to the host at all.
75
+ */
76
+ const APP_SERVER_EXPERT_PACK_FORMAT = 1;
62
77
  //#endregion
63
78
  //#region src/errors.ts
64
79
  var AppServerError = class extends Error {
@@ -450,6 +465,7 @@ function decodeConversationEvent(event) {
450
465
  }
451
466
  }
452
467
  //#endregion
468
+ exports.APP_SERVER_EXPERT_PACK_FORMAT = APP_SERVER_EXPERT_PACK_FORMAT;
453
469
  exports.APP_SERVER_PROTOCOL_VERSION = APP_SERVER_PROTOCOL_VERSION;
454
470
  exports.AppServerError = AppServerError;
455
471
  exports.ProtocolError = ProtocolError;
package/dist/index.d.cts CHANGED
@@ -56,8 +56,14 @@
56
56
  * `source_kind: "zip"`, one archive whose root *is* the market root. The
57
57
  * official bundles move to it because the old `url` form made a first fetch
58
58
  * mirror 14,714 files (611 MiB) for `experts` alone (doc `30`).
59
+ * **`fp-8` adds expert definition export**: `agent/export` and `team/export`
60
+ * return an {@link ExpertPack} — the persona, model hints, skill references and
61
+ * (for a team) the roster with every member expanded. Nothing existing changes
62
+ * shape, but the response carries the Agent Markdown body, which the catalog
63
+ * faces deliberately never do; both methods are WebSocket-only, so the
64
+ * documented route split becomes `48 / 73` (doc `32`).
59
65
  */
60
- export declare const APP_SERVER_PROTOCOL_VERSION = "fp-7";
66
+ export declare const APP_SERVER_PROTOCOL_VERSION = "fp-8";
61
67
  export interface JsonRpcRequest {
62
68
  jsonrpc: "2.0";
63
69
  id: number | string;
@@ -193,6 +199,17 @@ export interface Capabilities {
193
199
  marketplaces: boolean;
194
200
  store: boolean;
195
201
  models: boolean;
202
+ /**
203
+ * The expert **definition export** face (`agent/export` / `team/export`,
204
+ * doc 32).
205
+ *
206
+ * Reports the *seam*, not the policy — same split as `connector_calls`. A host
207
+ * wires it and then decides per request whether its `[expert_export]` table
208
+ * allows the id, so this flag says the methods exist, not that any given
209
+ * expert is exportable: a refusal arrives as `policy_denied`. Do not use it to
210
+ * grey out a button and assume that is the whole answer.
211
+ */
212
+ expert_export: boolean;
196
213
  }
197
214
  export interface WorkspaceRef {
198
215
  id: string;
@@ -1291,6 +1308,129 @@ export interface TeamDetail extends TeamSummary {
1291
1308
  */
1292
1309
  connectors: string[];
1293
1310
  }
1311
+ /**
1312
+ * Format version of {@link ExpertPack}.
1313
+ *
1314
+ * **Independent of {@link APP_SERVER_PROTOCOL_VERSION}** on purpose: the
1315
+ * fingerprint versions *our* wire compatibility, this versions the **artifact
1316
+ * contract for third-party runtimes**. Gate on this one; the fingerprint is
1317
+ * about whether your client can talk to the host at all.
1318
+ */
1319
+ export declare const APP_SERVER_EXPERT_PACK_FORMAT = 1;
1320
+ export type ExpertPackKind = "agent" | "team";
1321
+ /** The expert's persona — the only body of text this face carries. */
1322
+ export interface ExpertPersona {
1323
+ /**
1324
+ * The Agent Markdown body, verbatim. The catalog face deliberately has no
1325
+ * field that could carry it (`AgentDetail`), so this is the only place it
1326
+ * appears — see doc 32 §2.
1327
+ */
1328
+ instructions: string;
1329
+ memory?: string | null;
1330
+ background?: string | null;
1331
+ }
1332
+ export interface ExpertModelRef {
1333
+ /** Host-local row id on the host that produced the pack; not portable. */
1334
+ provider_id?: string | null;
1335
+ model: string;
1336
+ }
1337
+ /**
1338
+ * Declared and resolved model hints. Neither is binding: `declared` is the
1339
+ * source frontmatter string and `resolved` is what the producing host resolved
1340
+ * it to. A consumer resolves its own model (doc 32 §5 R6).
1341
+ */
1342
+ export interface ExpertModel {
1343
+ declared?: string | null;
1344
+ resolved?: ExpertModelRef | null;
1345
+ effort?: string | null;
1346
+ max_turns?: number | null;
1347
+ }
1348
+ /**
1349
+ * One Skill the expert declares, **by reference** — fetch the bytes with
1350
+ * `skills.files()` / `skills.readFile()`. `name` and `id` are the same string:
1351
+ * `skill/list` publishes the Skill name as its id.
1352
+ */
1353
+ export interface ExpertSkillRef {
1354
+ name: string;
1355
+ id: string;
1356
+ }
1357
+ /**
1358
+ * One Connector a **team's own snapshot** installed and left enabled. Identity
1359
+ * and switch only — never transport, env, headers or token (doc 24 §2/§5.3);
1360
+ * tool schemas stay on `connector/get`.
1361
+ *
1362
+ * An **agent** pack's list is always empty, faithfully: this format has no
1363
+ * agent-level connector dependency (doc 02 §5.1).
1364
+ */
1365
+ export interface ExpertConnectorRef {
1366
+ id: string;
1367
+ name: string;
1368
+ enabled: boolean;
1369
+ }
1370
+ /** A declaration, never a permission boundary (doc 32 §5 R9). */
1371
+ export interface ExpertToolPolicy {
1372
+ tools: string[];
1373
+ disallowed_tools: string[];
1374
+ }
1375
+ export interface ExpertProvenance {
1376
+ source: string;
1377
+ snapshot_id: string;
1378
+ content_digest: string;
1379
+ preset_id?: string | null;
1380
+ preset_revision?: number | null;
1381
+ }
1382
+ /**
1383
+ * Which engine the definition was bound to on the producing host.
1384
+ *
1385
+ * `portable: false` is the normal case, not an error: an installed expert is a
1386
+ * Preset pinned to that host's runtime agent, which no other runtime has.
1387
+ */
1388
+ export interface ExpertRuntimeBinding {
1389
+ runtime: string;
1390
+ portable: boolean;
1391
+ }
1392
+ /** Team roster and policy. The roster is a hard boundary; the rest is intent. */
1393
+ export interface ExpertTeamPack {
1394
+ lead_agent_id: string;
1395
+ member_agent_ids: string[];
1396
+ planner_policy: string;
1397
+ routing_constraints: string[];
1398
+ workflow_limits: Record<string, unknown>;
1399
+ team_runtime_capabilities: string[];
1400
+ /** Fully expanded member packs, **leader first**. */
1401
+ members: ExpertPack[];
1402
+ }
1403
+ /**
1404
+ * A portable expert definition (`agent/export` / `team/export`, doc 32).
1405
+ *
1406
+ * A **definition, not execution semantics**: how a team plans and schedules its
1407
+ * steps, how tool and credential policy is applied, and the shape of its events
1408
+ * are all enforced by the runtime and are absent here. Doc 32 §5 (R1–R11) lists
1409
+ * what a consumer has to implement itself — answer that list rather than only
1410
+ * reading this shape.
1411
+ *
1412
+ * There is deliberately no export timestamp, so two exports of one snapshot are
1413
+ * byte-identical: `provenance.content_digest` is usable as a cache key, and two
1414
+ * exports can be diffed to answer "what changed upstream".
1415
+ */
1416
+ export interface ExpertPack {
1417
+ pack_format: number;
1418
+ kind: ExpertPackKind;
1419
+ id: string;
1420
+ version: string;
1421
+ name: string;
1422
+ display_name?: LocalizedText | null;
1423
+ description?: string | null;
1424
+ persona: ExpertPersona;
1425
+ model: ExpertModel;
1426
+ skills: ExpertSkillRef[];
1427
+ connectors: ExpertConnectorRef[];
1428
+ tool_policy: ExpertToolPolicy;
1429
+ /** Present exactly when `kind === "team"`. */
1430
+ team?: ExpertTeamPack | null;
1431
+ provenance: ExpertProvenance;
1432
+ runtime_binding: ExpertRuntimeBinding;
1433
+ }
1294
1434
  //#endregion
1295
1435
  //#region src/errors.d.ts
1296
1436
  export type ErrorCode = string;
package/dist/index.d.mts CHANGED
@@ -56,8 +56,14 @@
56
56
  * `source_kind: "zip"`, one archive whose root *is* the market root. The
57
57
  * official bundles move to it because the old `url` form made a first fetch
58
58
  * mirror 14,714 files (611 MiB) for `experts` alone (doc `30`).
59
+ * **`fp-8` adds expert definition export**: `agent/export` and `team/export`
60
+ * return an {@link ExpertPack} — the persona, model hints, skill references and
61
+ * (for a team) the roster with every member expanded. Nothing existing changes
62
+ * shape, but the response carries the Agent Markdown body, which the catalog
63
+ * faces deliberately never do; both methods are WebSocket-only, so the
64
+ * documented route split becomes `48 / 73` (doc `32`).
59
65
  */
60
- export declare const APP_SERVER_PROTOCOL_VERSION = "fp-7";
66
+ export declare const APP_SERVER_PROTOCOL_VERSION = "fp-8";
61
67
  export interface JsonRpcRequest {
62
68
  jsonrpc: "2.0";
63
69
  id: number | string;
@@ -193,6 +199,17 @@ export interface Capabilities {
193
199
  marketplaces: boolean;
194
200
  store: boolean;
195
201
  models: boolean;
202
+ /**
203
+ * The expert **definition export** face (`agent/export` / `team/export`,
204
+ * doc 32).
205
+ *
206
+ * Reports the *seam*, not the policy — same split as `connector_calls`. A host
207
+ * wires it and then decides per request whether its `[expert_export]` table
208
+ * allows the id, so this flag says the methods exist, not that any given
209
+ * expert is exportable: a refusal arrives as `policy_denied`. Do not use it to
210
+ * grey out a button and assume that is the whole answer.
211
+ */
212
+ expert_export: boolean;
196
213
  }
197
214
  export interface WorkspaceRef {
198
215
  id: string;
@@ -1291,6 +1308,129 @@ export interface TeamDetail extends TeamSummary {
1291
1308
  */
1292
1309
  connectors: string[];
1293
1310
  }
1311
+ /**
1312
+ * Format version of {@link ExpertPack}.
1313
+ *
1314
+ * **Independent of {@link APP_SERVER_PROTOCOL_VERSION}** on purpose: the
1315
+ * fingerprint versions *our* wire compatibility, this versions the **artifact
1316
+ * contract for third-party runtimes**. Gate on this one; the fingerprint is
1317
+ * about whether your client can talk to the host at all.
1318
+ */
1319
+ export declare const APP_SERVER_EXPERT_PACK_FORMAT = 1;
1320
+ export type ExpertPackKind = "agent" | "team";
1321
+ /** The expert's persona — the only body of text this face carries. */
1322
+ export interface ExpertPersona {
1323
+ /**
1324
+ * The Agent Markdown body, verbatim. The catalog face deliberately has no
1325
+ * field that could carry it (`AgentDetail`), so this is the only place it
1326
+ * appears — see doc 32 §2.
1327
+ */
1328
+ instructions: string;
1329
+ memory?: string | null;
1330
+ background?: string | null;
1331
+ }
1332
+ export interface ExpertModelRef {
1333
+ /** Host-local row id on the host that produced the pack; not portable. */
1334
+ provider_id?: string | null;
1335
+ model: string;
1336
+ }
1337
+ /**
1338
+ * Declared and resolved model hints. Neither is binding: `declared` is the
1339
+ * source frontmatter string and `resolved` is what the producing host resolved
1340
+ * it to. A consumer resolves its own model (doc 32 §5 R6).
1341
+ */
1342
+ export interface ExpertModel {
1343
+ declared?: string | null;
1344
+ resolved?: ExpertModelRef | null;
1345
+ effort?: string | null;
1346
+ max_turns?: number | null;
1347
+ }
1348
+ /**
1349
+ * One Skill the expert declares, **by reference** — fetch the bytes with
1350
+ * `skills.files()` / `skills.readFile()`. `name` and `id` are the same string:
1351
+ * `skill/list` publishes the Skill name as its id.
1352
+ */
1353
+ export interface ExpertSkillRef {
1354
+ name: string;
1355
+ id: string;
1356
+ }
1357
+ /**
1358
+ * One Connector a **team's own snapshot** installed and left enabled. Identity
1359
+ * and switch only — never transport, env, headers or token (doc 24 §2/§5.3);
1360
+ * tool schemas stay on `connector/get`.
1361
+ *
1362
+ * An **agent** pack's list is always empty, faithfully: this format has no
1363
+ * agent-level connector dependency (doc 02 §5.1).
1364
+ */
1365
+ export interface ExpertConnectorRef {
1366
+ id: string;
1367
+ name: string;
1368
+ enabled: boolean;
1369
+ }
1370
+ /** A declaration, never a permission boundary (doc 32 §5 R9). */
1371
+ export interface ExpertToolPolicy {
1372
+ tools: string[];
1373
+ disallowed_tools: string[];
1374
+ }
1375
+ export interface ExpertProvenance {
1376
+ source: string;
1377
+ snapshot_id: string;
1378
+ content_digest: string;
1379
+ preset_id?: string | null;
1380
+ preset_revision?: number | null;
1381
+ }
1382
+ /**
1383
+ * Which engine the definition was bound to on the producing host.
1384
+ *
1385
+ * `portable: false` is the normal case, not an error: an installed expert is a
1386
+ * Preset pinned to that host's runtime agent, which no other runtime has.
1387
+ */
1388
+ export interface ExpertRuntimeBinding {
1389
+ runtime: string;
1390
+ portable: boolean;
1391
+ }
1392
+ /** Team roster and policy. The roster is a hard boundary; the rest is intent. */
1393
+ export interface ExpertTeamPack {
1394
+ lead_agent_id: string;
1395
+ member_agent_ids: string[];
1396
+ planner_policy: string;
1397
+ routing_constraints: string[];
1398
+ workflow_limits: Record<string, unknown>;
1399
+ team_runtime_capabilities: string[];
1400
+ /** Fully expanded member packs, **leader first**. */
1401
+ members: ExpertPack[];
1402
+ }
1403
+ /**
1404
+ * A portable expert definition (`agent/export` / `team/export`, doc 32).
1405
+ *
1406
+ * A **definition, not execution semantics**: how a team plans and schedules its
1407
+ * steps, how tool and credential policy is applied, and the shape of its events
1408
+ * are all enforced by the runtime and are absent here. Doc 32 §5 (R1–R11) lists
1409
+ * what a consumer has to implement itself — answer that list rather than only
1410
+ * reading this shape.
1411
+ *
1412
+ * There is deliberately no export timestamp, so two exports of one snapshot are
1413
+ * byte-identical: `provenance.content_digest` is usable as a cache key, and two
1414
+ * exports can be diffed to answer "what changed upstream".
1415
+ */
1416
+ export interface ExpertPack {
1417
+ pack_format: number;
1418
+ kind: ExpertPackKind;
1419
+ id: string;
1420
+ version: string;
1421
+ name: string;
1422
+ display_name?: LocalizedText | null;
1423
+ description?: string | null;
1424
+ persona: ExpertPersona;
1425
+ model: ExpertModel;
1426
+ skills: ExpertSkillRef[];
1427
+ connectors: ExpertConnectorRef[];
1428
+ tool_policy: ExpertToolPolicy;
1429
+ /** Present exactly when `kind === "team"`. */
1430
+ team?: ExpertTeamPack | null;
1431
+ provenance: ExpertProvenance;
1432
+ runtime_binding: ExpertRuntimeBinding;
1433
+ }
1294
1434
  //#endregion
1295
1435
  //#region src/errors.d.ts
1296
1436
  export type ErrorCode = string;
package/dist/index.mjs CHANGED
@@ -56,8 +56,23 @@
56
56
  * `source_kind: "zip"`, one archive whose root *is* the market root. The
57
57
  * official bundles move to it because the old `url` form made a first fetch
58
58
  * mirror 14,714 files (611 MiB) for `experts` alone (doc `30`).
59
+ * **`fp-8` adds expert definition export**: `agent/export` and `team/export`
60
+ * return an {@link ExpertPack} — the persona, model hints, skill references and
61
+ * (for a team) the roster with every member expanded. Nothing existing changes
62
+ * shape, but the response carries the Agent Markdown body, which the catalog
63
+ * faces deliberately never do; both methods are WebSocket-only, so the
64
+ * documented route split becomes `48 / 73` (doc `32`).
59
65
  */
60
- const APP_SERVER_PROTOCOL_VERSION = "fp-7";
66
+ const APP_SERVER_PROTOCOL_VERSION = "fp-8";
67
+ /**
68
+ * Format version of {@link ExpertPack}.
69
+ *
70
+ * **Independent of {@link APP_SERVER_PROTOCOL_VERSION}** on purpose: the
71
+ * fingerprint versions *our* wire compatibility, this versions the **artifact
72
+ * contract for third-party runtimes**. Gate on this one; the fingerprint is
73
+ * about whether your client can talk to the host at all.
74
+ */
75
+ const APP_SERVER_EXPERT_PACK_FORMAT = 1;
61
76
  //#endregion
62
77
  //#region src/errors.ts
63
78
  var AppServerError = class extends Error {
@@ -449,4 +464,4 @@ function decodeConversationEvent(event) {
449
464
  }
450
465
  }
451
466
  //#endregion
452
- export { APP_SERVER_PROTOCOL_VERSION, AppServerError, ProtocolError, RequestTimeoutError, TransportError, booleanValue, contentToText, decodeConversationEvent, formatError, isAppServerError, isRecord, isRetryableError, isRetryableTransportError, numberValue, otherLocalizedLang, parseContextUsage, parseTurnUsage, pickEntryTags, pickEntryText, pickLocalized, pickLocalizedList, pickVariantList, pickVariantText, planData, stringValue, thinkingData, tipsData, toLocalizedLang, toolCallData };
467
+ export { APP_SERVER_EXPERT_PACK_FORMAT, APP_SERVER_PROTOCOL_VERSION, AppServerError, ProtocolError, RequestTimeoutError, TransportError, booleanValue, contentToText, decodeConversationEvent, formatError, isAppServerError, isRecord, isRetryableError, isRetryableTransportError, numberValue, otherLocalizedLang, parseContextUsage, parseTurnUsage, pickEntryTags, pickEntryText, pickLocalized, pickLocalizedList, pickVariantList, pickVariantText, planData, stringValue, thinkingData, tipsData, toLocalizedLang, toolCallData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowy-agent-store/protocol",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.7",
4
4
  "description": "Versioned App Server Protocol types and wire errors (no runtime, no DOM/Node deps)",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",