@tianshu-ai/tianshu 0.4.0 → 0.4.2
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/node_modules/@tianshu-ai/plugin-sdk/dist/capabilities.d.ts +4 -0
- package/node_modules/@tianshu-ai/plugin-sdk/dist/capabilities.d.ts.map +1 -1
- package/node_modules/@tianshu-ai/plugin-sdk/dist/capabilities.js +4 -0
- package/node_modules/@tianshu-ai/plugin-sdk/dist/capabilities.js.map +1 -1
- package/node_modules/@tianshu-ai/plugin-sdk/dist/index.d.ts +1 -0
- package/node_modules/@tianshu-ai/plugin-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@tianshu-ai/plugin-sdk/dist/index.js +1 -0
- package/node_modules/@tianshu-ai/plugin-sdk/dist/index.js.map +1 -1
- package/node_modules/@tianshu-ai/plugin-sdk/dist/workforce-snapshot.d.ts +166 -0
- package/node_modules/@tianshu-ai/plugin-sdk/dist/workforce-snapshot.d.ts.map +1 -0
- package/node_modules/@tianshu-ai/plugin-sdk/dist/workforce-snapshot.js +18 -0
- package/node_modules/@tianshu-ai/plugin-sdk/dist/workforce-snapshot.js.map +1 -0
- package/node_modules/@tianshu-ai/plugin-sdk/src/capabilities.ts +5 -0
- package/node_modules/@tianshu-ai/plugin-sdk/src/index.ts +1 -0
- package/node_modules/@tianshu-ai/plugin-sdk/src/workforce-snapshot.ts +189 -0
- package/package.json +1 -1
- package/packages/plugin-sdk/dist/capabilities.d.ts +4 -0
- package/packages/plugin-sdk/dist/capabilities.d.ts.map +1 -1
- package/packages/plugin-sdk/dist/capabilities.js +4 -0
- package/packages/plugin-sdk/dist/capabilities.js.map +1 -1
- package/packages/plugin-sdk/dist/index.d.ts +1 -0
- package/packages/plugin-sdk/dist/index.d.ts.map +1 -1
- package/packages/plugin-sdk/dist/index.js +1 -0
- package/packages/plugin-sdk/dist/index.js.map +1 -1
- package/packages/plugin-sdk/dist/workforce-snapshot.d.ts +166 -0
- package/packages/plugin-sdk/dist/workforce-snapshot.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/workforce-snapshot.js +18 -0
- package/packages/plugin-sdk/dist/workforce-snapshot.js.map +1 -0
- package/packages/server/builtinConfig/plugins/workforce-studio/manifest.json +27 -0
- package/packages/server/dist/index.js +16 -0
- package/packages/server/dist/index.js.map +1 -1
- package/packages/server/dist/plugins-routes.d.ts +3 -3
- package/packages/server/dist/setup/update.d.ts.map +1 -1
- package/packages/server/dist/setup/update.js +52 -0
- package/packages/server/dist/setup/update.js.map +1 -1
- package/packages/server/dist/workforce/snapshot.d.ts +31 -0
- package/packages/server/dist/workforce/snapshot.d.ts.map +1 -0
- package/packages/server/dist/workforce/snapshot.js +199 -0
- package/packages/server/dist/workforce/snapshot.js.map +1 -0
- package/packages/web/dist/assets/angular-html-BVBpGdXr.js +1 -0
- package/packages/web/dist/assets/{angular-ts-DI1dI61I.js → angular-ts-BfdufMKP.js} +1 -1
- package/packages/web/dist/assets/{astro-Ce5mz0W9.js → astro-JKRPP03v.js} +1 -1
- package/packages/web/dist/assets/{blade-CLyXRJDZ.js → blade-DA8yMPsw.js} +1 -1
- package/packages/web/dist/assets/bundle-web-4cjT-3Gc.js +13 -0
- package/packages/web/dist/assets/c-Wt1voDr2.js +1 -0
- package/packages/web/dist/assets/{coffee-gy4cTilr.js → coffee-CThvmt4R.js} +1 -1
- package/packages/web/dist/assets/{cpp-BlCe0wXi.js → cpp-C5WNSHb9.js} +1 -1
- package/packages/web/dist/assets/css-DJp_X0uY.js +1 -0
- package/packages/web/dist/assets/glsl-Dv5r7kPw.js +1 -0
- package/packages/web/dist/assets/{graphql-AORc6ksH.js → graphql-CcFwQwm0.js} +1 -1
- package/packages/web/dist/assets/{haml-DdfUb-ne.js → haml-Bg4I2hiD.js} +1 -1
- package/packages/web/dist/assets/{handlebars-DSq_FD-9.js → handlebars-DnwbnL5R.js} +1 -1
- package/packages/web/dist/assets/html-C8UlPnhE.js +1 -0
- package/packages/web/dist/assets/{html-derivative-evOR5SA8.js → html-derivative-CY6NRz-J.js} +1 -1
- package/packages/web/dist/assets/{http-We-luHhY.js → http-CoW620Fi.js} +1 -1
- package/packages/web/dist/assets/{hurl-N4vSJmne.js → hurl-CSSETujw.js} +1 -1
- package/packages/web/dist/assets/index-5Pcda8Ig.js +71 -0
- package/packages/web/dist/assets/index-fnzabO1H.css +2 -0
- package/packages/web/dist/assets/java-CGc3VwQr.js +1 -0
- package/packages/web/dist/assets/javascript-CUt1pgmJ.js +1 -0
- package/packages/web/dist/assets/{jinja-DUwAWKUy.js → jinja-CD-Z-FLd.js} +1 -1
- package/packages/web/dist/assets/{jison-BeIkQZJr.js → jison-imPNup1l.js} +1 -1
- package/packages/web/dist/assets/jsx-CY6oMTks.js +1 -0
- package/packages/web/dist/assets/{julia-7AZvIVK4.js → julia-CjffhBEM.js} +1 -1
- package/packages/web/dist/assets/{marko-B3ZYqTDP.js → marko-DvhNOisQ.js} +1 -1
- package/packages/web/dist/assets/{mdc-B6iWGH1P.js → mdc-CazklSAj.js} +1 -1
- package/packages/web/dist/assets/papaparse.min-BQRX_pWo.js +10 -0
- package/packages/web/dist/assets/{php-CnSNWAsA.js → php-CBqsN0ai.js} +1 -1
- package/packages/web/dist/assets/{pug-CFzaFOLA.js → pug-C5hz5LQ7.js} +1 -1
- package/packages/web/dist/assets/regexp-Omp9DhTb.js +1 -0
- package/packages/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/packages/web/dist/assets/scss-DdSxiZKl.js +1 -0
- package/packages/web/dist/assets/sql-DNssxck8.js +1 -0
- package/packages/web/dist/assets/{svelte-cmIwjtUa.js → svelte-DOdLCIlh.js} +1 -1
- package/packages/web/dist/assets/{ts-tags-D4TcqQGA.js → ts-tags-Ca73dJJY.js} +1 -1
- package/packages/web/dist/assets/tsx-5Eka4NBX.js +1 -0
- package/packages/web/dist/assets/typescript-DOu2WMV5.js +1 -0
- package/packages/web/dist/assets/{vue-Do7CHdUR.js → vue-Bfx0ffIq.js} +1 -1
- package/packages/web/dist/assets/{vue-html-D5kxJZMa.js → vue-html-BeluIYX0.js} +1 -1
- package/packages/web/dist/assets/{vue-vine-CjyCoysS.js → vue-vine-DGUAbOCX.js} +1 -1
- package/packages/web/dist/assets/xml-DIqSwXR3.js +1 -0
- package/packages/web/dist/index.html +3 -2
- package/packages/web/package.json +4 -4
- package/plugins/workforce-studio/dist/client.d.ts +5 -0
- package/plugins/workforce-studio/dist/client.d.ts.map +1 -0
- package/plugins/workforce-studio/dist/client.js +147 -0
- package/plugins/workforce-studio/dist/client.js.map +1 -0
- package/plugins/workforce-studio/dist/server.d.ts +5 -0
- package/plugins/workforce-studio/dist/server.d.ts.map +1 -0
- package/plugins/workforce-studio/dist/server.js +89 -0
- package/plugins/workforce-studio/dist/server.js.map +1 -0
- package/plugins/workforce-studio/dist/zip-builder.d.ts +19 -0
- package/plugins/workforce-studio/dist/zip-builder.d.ts.map +1 -0
- package/plugins/workforce-studio/dist/zip-builder.js +325 -0
- package/plugins/workforce-studio/dist/zip-builder.js.map +1 -0
- package/plugins/workforce-studio/manifest.json +27 -0
- package/plugins/workforce-studio/node_modules/typescript/README.md +50 -0
- package/plugins/workforce-studio/node_modules/typescript/package.json +120 -0
- package/plugins/workforce-studio/package.json +36 -0
- package/packages/web/dist/assets/angular-html-Cvub90Dz.js +0 -1
- package/packages/web/dist/assets/bundle-web-CxQb8-l5.js +0 -13
- package/packages/web/dist/assets/c-As86Lww3.js +0 -1
- package/packages/web/dist/assets/css-CXve-siW.js +0 -1
- package/packages/web/dist/assets/glsl-CXl6tvOm.js +0 -1
- package/packages/web/dist/assets/html-C7SJ_cNO.js +0 -1
- package/packages/web/dist/assets/index-CM0wb7K0.js +0 -70
- package/packages/web/dist/assets/index-YR1aGlWo.css +0 -2
- package/packages/web/dist/assets/java-BjFwMRAB.js +0 -1
- package/packages/web/dist/assets/javascript-Mc8Zyzj4.js +0 -1
- package/packages/web/dist/assets/jsx-Du6JQ-EF.js +0 -1
- package/packages/web/dist/assets/papaparse.min-BP6q-ooU.js +0 -10
- package/packages/web/dist/assets/regexp-DXOuShFp.js +0 -1
- package/packages/web/dist/assets/scss-CDgA5HpI.js +0 -1
- package/packages/web/dist/assets/sql-Cd1aIPsP.js +0 -1
- package/packages/web/dist/assets/tsx-DkLE1Tnp.js +0 -1
- package/packages/web/dist/assets/typescript-tBsNrWwg.js +0 -1
- package/packages/web/dist/assets/xml-B_L7cZbi.js +0 -1
|
@@ -43,6 +43,10 @@ export declare const KNOWN_CAPABILITIES: {
|
|
|
43
43
|
readonly exclusive: true;
|
|
44
44
|
readonly description: "Manage channel adapter bindings (chat-platform integrations). Plugins contributing a channel (Feishu / Telegram / WeChat / ...) call create/start/stop/delete here so the host's adapter manager actually wires the inbound stream to the agent. The DB row + adapter lifecycle live together behind this capability.";
|
|
45
45
|
};
|
|
46
|
+
readonly "host.workforceSnapshot": {
|
|
47
|
+
readonly exclusive: true;
|
|
48
|
+
readonly description: "Build a read-only snapshot of the tenant's agent configuration (main agent prompt + tools + skills, every worker agent's prompt + allowed tools + allowed skills). Used by the Workforce Studio plugin to render an inspect-and-export UI; the snapshot includes full skill markdown bodies so the studio can ship a faithful bundle.";
|
|
49
|
+
};
|
|
46
50
|
};
|
|
47
51
|
export type CapabilityName = keyof typeof KNOWN_CAPABILITIES;
|
|
48
52
|
/** True iff the given string is a registered capability name. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDoB,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAE7D,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,cAAc,CAE/D;AAED,2DAA2D;AAC3D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEvE"}
|
|
@@ -53,6 +53,10 @@ export const KNOWN_CAPABILITIES = {
|
|
|
53
53
|
exclusive: true,
|
|
54
54
|
description: "Manage channel adapter bindings (chat-platform integrations). Plugins contributing a channel (Feishu / Telegram / WeChat / ...) call create/start/stop/delete here so the host's adapter manager actually wires the inbound stream to the agent. The DB row + adapter lifecycle live together behind this capability.",
|
|
55
55
|
},
|
|
56
|
+
"host.workforceSnapshot": {
|
|
57
|
+
exclusive: true,
|
|
58
|
+
description: "Build a read-only snapshot of the tenant's agent configuration (main agent prompt + tools + skills, every worker agent's prompt + allowed tools + allowed skills). Used by the Workforce Studio plugin to render an inspect-and-export UI; the snapshot includes full skill markdown bodies so the studio can ship a faithful bundle.",
|
|
59
|
+
},
|
|
56
60
|
};
|
|
57
61
|
/** True iff the given string is a registered capability name. */
|
|
58
62
|
export function isCapabilityName(s) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,iEAAiE;AACjE,iEAAiE;AACjE,sEAAsE;AACtE,oEAAoE;AACpE,0DAA0D;AAC1D,EAAE;AACF,mBAAmB;AACnB,kEAAkE;AAClE,+DAA+D;AAC/D,mCAAmC;AACnC,kEAAkE;AAClE,2DAA2D;AAO3D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,eAAe,EAAE;QACf,SAAS,EAAE,IAAI;QACf,WAAW,EACT,8EAA8E;KACjF;IACD,kBAAkB,EAAE;QAClB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,0SAA0S;KAC7S;IACD,aAAa,EAAE;QACb,SAAS,EAAE,IAAI;QACf,WAAW,EACT,0HAA0H;KAC7H;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,uTAAuT;KAC1T;IACD,mBAAmB,EAAE;QACnB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,sWAAsW;KACzW;IACD,kBAAkB,EAAE;QAClB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,qTAAqT;KACxT;IACD,mBAAmB,EAAE;QACnB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,oNAAoN;KACvN;IACD,mBAAmB,EAAE;QACnB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,sRAAsR;KACzR;IACD,UAAU,EAAE;QACV,SAAS,EAAE,IAAI;QACf,WAAW,EACT,iXAAiX;KACpX;IACD,sBAAsB,EAAE;QACtB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,uTAAuT;KAC1T;CACgD,CAAC;AAIpD,iEAAiE;AACjE,MAAM,UAAU,gBAAgB,CAAC,CAAS;IACxC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC"}
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,iEAAiE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AO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC"}
|
|
@@ -6,5 +6,6 @@ export * from "./session-inbox.js";
|
|
|
6
6
|
export * from "./catalog.js";
|
|
7
7
|
export * from "./lsp.js";
|
|
8
8
|
export * from "./channel-bindings.js";
|
|
9
|
+
export * from "./workforce-snapshot.js";
|
|
9
10
|
export { McpToolset, textOfMcpContent, type McpEndpointResolver, type McpToolDescriptor, type McpToolFilter, type McpToolsetEntry, type McpToolsetOptions, type McpToolsetSnapshot, type ToolsetProvider, } from "./mcp-toolset.js";
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC"}
|
|
@@ -16,5 +16,6 @@ export * from "./session-inbox.js";
|
|
|
16
16
|
export * from "./catalog.js";
|
|
17
17
|
export * from "./lsp.js";
|
|
18
18
|
export * from "./channel-bindings.js";
|
|
19
|
+
export * from "./workforce-snapshot.js";
|
|
19
20
|
export { McpToolset, textOfMcpContent, } from "./mcp-toolset.js";
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,mEAAmE;AACnE,oEAAoE;AACpE,qEAAqE;AACrE,iCAAiC;AACjC,EAAE;AACF,wEAAwE;AACxE,iEAAiE;AACjE,0BAA0B;AAE1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,UAAU,EACV,gBAAgB,GAQjB,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,mEAAmE;AACnE,oEAAoE;AACpE,qEAAqE;AACrE,iCAAiC;AACjC,EAAE;AACF,wEAAwE;AACxE,iEAAiE;AACjE,0BAA0B;AAE1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,UAAU,EACV,gBAAgB,GAQjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/** Where a tool / skill comes from. Studio renders this as a
|
|
2
|
+
* coloured badge so the operator can tell at a glance whether
|
|
3
|
+
* a capability is part of the core install, a built-in plugin,
|
|
4
|
+
* or something a tenant administrator added later.
|
|
5
|
+
*
|
|
6
|
+
* - "core" Host-owned tools registered directly by
|
|
7
|
+
* the server (e.g. worker_analytics).
|
|
8
|
+
* - "builtin-plugin" A plugin shipped under `plugins/<id>/`
|
|
9
|
+
* inside this Tianshu install. Always
|
|
10
|
+
* available without operator action.
|
|
11
|
+
* - "tenant-plugin" A plugin discovered under the tenant's
|
|
12
|
+
* `<home>/_tenant/config/plugins/<id>/`
|
|
13
|
+
* — installed/edited per-tenant.
|
|
14
|
+
*/
|
|
15
|
+
export type WorkforceOrigin = "core" | "builtin-plugin" | "tenant-plugin";
|
|
16
|
+
/** Tool the agent has access to, with enough detail to render a
|
|
17
|
+
* studio detail panel + write a `tools.md` entry in the zip. */
|
|
18
|
+
export interface WorkforceToolEntry {
|
|
19
|
+
/** Schema name the model calls. */
|
|
20
|
+
name: string;
|
|
21
|
+
/** One-line description from the tool's schema. */
|
|
22
|
+
description: string;
|
|
23
|
+
/** JSON schema for the tool's parameters, exactly as the model
|
|
24
|
+
* sees it. Studio renders this for documentation. */
|
|
25
|
+
parameters: unknown;
|
|
26
|
+
/** Plugin that contributes the tool, or "core" for host-owned
|
|
27
|
+
* tools like worker_analytics. */
|
|
28
|
+
pluginId: string;
|
|
29
|
+
/** Manifest `since` version (string semver). null when the
|
|
30
|
+
* plugin didn't declare it. */
|
|
31
|
+
since: string | null;
|
|
32
|
+
/** Provenance bucket. Computed from `pluginId` against the
|
|
33
|
+
* plugin inventory so the studio can group/colour by origin. */
|
|
34
|
+
origin: WorkforceOrigin;
|
|
35
|
+
}
|
|
36
|
+
/** Skill the agent has access to. Includes the markdown body so
|
|
37
|
+
* the zip export can reproduce the file the agent reads when it
|
|
38
|
+
* decides to load the skill. */
|
|
39
|
+
export interface WorkforceSkillEntry {
|
|
40
|
+
/** Frontmatter `name`. Unique across enabled skills. */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Frontmatter `description`. */
|
|
43
|
+
description: string;
|
|
44
|
+
/** Plugin id that owns the contribution, or "host" for
|
|
45
|
+
* built-in skills shipped under packages/server/host-skills. */
|
|
46
|
+
pluginId: string;
|
|
47
|
+
/** "main" / "worker" / undefined (visible to both). */
|
|
48
|
+
scope?: "main" | "worker";
|
|
49
|
+
/** Path of the skill file as seen by the agent. Studio mirrors
|
|
50
|
+
* this into the zip under `skills/<path>` so the export is a
|
|
51
|
+
* faithful reproduction of what the model reads. */
|
|
52
|
+
relativePath: string;
|
|
53
|
+
/** Full markdown body, frontmatter included. */
|
|
54
|
+
body: string;
|
|
55
|
+
/** Same provenance bucket as tools; computed from `pluginId`. */
|
|
56
|
+
origin: WorkforceOrigin;
|
|
57
|
+
}
|
|
58
|
+
/** One row in the plugin inventory the studio displays at the top
|
|
59
|
+
* of the snapshot. The host derives this from the active plugin
|
|
60
|
+
* registry; non-active (failed / disabled) plugins are still
|
|
61
|
+
* surfaced so admins can see why a missing tool/skill is missing. */
|
|
62
|
+
export interface WorkforcePluginInfo {
|
|
63
|
+
id: string;
|
|
64
|
+
displayName: string;
|
|
65
|
+
version: string;
|
|
66
|
+
description: string;
|
|
67
|
+
/** Where the plugin manifest was found. Maps directly to
|
|
68
|
+
* WorkforceOrigin so the studio can colour-match plugin rows
|
|
69
|
+
* against tool/skill badges. */
|
|
70
|
+
origin: "builtin-plugin" | "tenant-plugin";
|
|
71
|
+
/** Lifecycle state: "active" means the registry activated it;
|
|
72
|
+
* "failed" / "disabled" / etc. mean the plugin is known but
|
|
73
|
+
* not currently contributing anything. Studio displays the
|
|
74
|
+
* reason for non-active states. */
|
|
75
|
+
state: "active" | "failed" | "disabled" | "loading";
|
|
76
|
+
/** Populated for non-active states; null when state===active. */
|
|
77
|
+
failureReason: string | null;
|
|
78
|
+
/** Number of tools this plugin currently contributes to the
|
|
79
|
+
* main agent. Useful for a quick "weight" view. */
|
|
80
|
+
toolCount: number;
|
|
81
|
+
/** Number of skills this plugin currently contributes. */
|
|
82
|
+
skillCount: number;
|
|
83
|
+
}
|
|
84
|
+
export interface WorkforceMainAgent {
|
|
85
|
+
/** Brand name from tenant config. */
|
|
86
|
+
brandName: string;
|
|
87
|
+
/** Default model id (provider-prefixed). May be null when the
|
|
88
|
+
* tenant has no models configured. */
|
|
89
|
+
defaultModelId: string | null;
|
|
90
|
+
/** Composed system prompt the agent would receive on the next
|
|
91
|
+
* turn if it ran right now. Includes plugin fragments + the
|
|
92
|
+
* current skill catalog block; static enough to diff across
|
|
93
|
+
* upgrades. */
|
|
94
|
+
systemPrompt: string;
|
|
95
|
+
/** Every tool currently visible to the main agent. Already
|
|
96
|
+
* filtered for `available()` and skill-aware gating. */
|
|
97
|
+
tools: WorkforceToolEntry[];
|
|
98
|
+
/** Every skill visible to the main agent after
|
|
99
|
+
* scope/when filtering. */
|
|
100
|
+
skills: WorkforceSkillEntry[];
|
|
101
|
+
}
|
|
102
|
+
export interface WorkforceWorkerAgent {
|
|
103
|
+
/** Slug (directory name under
|
|
104
|
+
* `_tenant/config/workers/<slug>/`). Used as the agent id
|
|
105
|
+
* everywhere else in the system. */
|
|
106
|
+
slug: string;
|
|
107
|
+
/** Display name from the worker's agent.json. */
|
|
108
|
+
name: string;
|
|
109
|
+
/** One-line description from agent.json. */
|
|
110
|
+
description: string | null;
|
|
111
|
+
/** Functional category (default-llm / code / research / ...). */
|
|
112
|
+
kind: string;
|
|
113
|
+
/** "builtin" or "user" — user-authored workers can be edited;
|
|
114
|
+
* builtins are the ones the host ships and the studio surfaces
|
|
115
|
+
* read-only. */
|
|
116
|
+
source: "builtin" | "user";
|
|
117
|
+
/** Whether the workboard pool actually dispatches to this
|
|
118
|
+
* worker. Disabled workers still appear in the studio so admins
|
|
119
|
+
* can inspect why they aren't running. */
|
|
120
|
+
enabled: boolean;
|
|
121
|
+
/** Bound model id, or null when the worker uses whatever the
|
|
122
|
+
* pool/agent loop picks. */
|
|
123
|
+
modelId: string | null;
|
|
124
|
+
/** Composed system prompt the worker actually runs with.
|
|
125
|
+
* Comparable to WorkforceMainAgent.systemPrompt but built
|
|
126
|
+
* via the workboard's worker prompt logic. */
|
|
127
|
+
systemPrompt: string;
|
|
128
|
+
/** Tools the worker is allowed to call after WORKER_DENY_TOOLS
|
|
129
|
+
* + agent.json toolsAllow filtering. */
|
|
130
|
+
tools: WorkforceToolEntry[];
|
|
131
|
+
/** Skills the worker can load (agent.json `skills:` allow-list
|
|
132
|
+
* intersected with the host catalog, scope-filtered for
|
|
133
|
+
* worker visibility). */
|
|
134
|
+
skills: WorkforceSkillEntry[];
|
|
135
|
+
}
|
|
136
|
+
export interface WorkforceSnapshot {
|
|
137
|
+
/** Tenant id this snapshot represents. */
|
|
138
|
+
tenantId: string;
|
|
139
|
+
/** User id this snapshot represents. Per-user surfaces (chat
|
|
140
|
+
* user prompt, etc.) are pinned to this id. */
|
|
141
|
+
userId: string;
|
|
142
|
+
/** ms epoch when the host built the snapshot. */
|
|
143
|
+
generatedAt: number;
|
|
144
|
+
/** Tianshu version that produced the snapshot. Surfaced in the
|
|
145
|
+
* zip's README so future re-imports know what era the export
|
|
146
|
+
* belongs to. */
|
|
147
|
+
tianshuVersion: string;
|
|
148
|
+
/** Inventory of every plugin currently visible to the tenant.
|
|
149
|
+
* Each tool/skill entry's `origin` field is derived from this
|
|
150
|
+
* list, so a UI can correlate a badge back to a concrete row. */
|
|
151
|
+
plugins: WorkforcePluginInfo[];
|
|
152
|
+
main: WorkforceMainAgent;
|
|
153
|
+
workers: WorkforceWorkerAgent[];
|
|
154
|
+
}
|
|
155
|
+
export interface WorkforceSnapshotCapability {
|
|
156
|
+
/** Build a complete snapshot of the tenant's agent configuration
|
|
157
|
+
* for the given user. Synchronous — every dependency is
|
|
158
|
+
* already in memory or backed by quick fs reads.
|
|
159
|
+
*
|
|
160
|
+
* The userId pins per-user context (user home AGENTS/SOUL/USER
|
|
161
|
+
* blocks the agent would actually see), so callers must pass it
|
|
162
|
+
* through from the authenticated request rather than letting
|
|
163
|
+
* the capability default. */
|
|
164
|
+
build(userId: string): WorkforceSnapshot;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=workforce-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workforce-snapshot.d.ts","sourceRoot":"","sources":["../src/workforce-snapshot.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAE1E;iEACiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB;0DACsD;IACtD,UAAU,EAAE,OAAO,CAAC;IACpB;uCACmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB;oCACgC;IAChC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB;qEACiE;IACjE,MAAM,EAAE,eAAe,CAAC;CACzB;AAED;;iCAEiC;AACjC,MAAM,WAAW,mBAAmB;IAClC,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB;qEACiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B;;yDAEqD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M,GAAG,IAAI,CAAC;IACvB;;mDAE+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB;6CACyC;IACzC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B;;8BAE0B;IAC1B,MAAM,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB;oDACgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB;;sBAEkB;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB;;sEAEkE;IAClE,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;kCAO8B;IAC9B,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAAC;CAC1C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Capability shape for `host.workforceSnapshot` — used by the
|
|
2
|
+
// Workforce Studio plugin to introspect + export the tenant's
|
|
3
|
+
// agent configuration in one call.
|
|
4
|
+
//
|
|
5
|
+
// The host returns a complete read-only snapshot covering:
|
|
6
|
+
// - the main agent's identity (brand, default model) + the
|
|
7
|
+
// skills it actually sees (after scope/when filtering)
|
|
8
|
+
// - every active tool's schema, source plugin, and since
|
|
9
|
+
// version
|
|
10
|
+
// - every worker agent's prompt, allowed tools, allowed skills
|
|
11
|
+
//
|
|
12
|
+
// Unlike the catalog capabilities (host.toolCatalog,
|
|
13
|
+
// host.skillCatalog) this surface includes the FULL skill body
|
|
14
|
+
// so the studio's zip export can ship every skill .md file as
|
|
15
|
+
// part of the bundle. The catalog capabilities stay slim for
|
|
16
|
+
// the cases that only need names + descriptions.
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=workforce-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workforce-snapshot.js","sourceRoot":"","sources":["../src/workforce-snapshot.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,8DAA8D;AAC9D,mCAAmC;AACnC,EAAE;AACF,2DAA2D;AAC3D,6DAA6D;AAC7D,2DAA2D;AAC3D,2DAA2D;AAC3D,cAAc;AACd,iEAAiE;AACjE,EAAE;AACF,qDAAqD;AACrD,+DAA+D;AAC/D,8DAA8D;AAC9D,6DAA6D;AAC7D,iDAAiD"}
|
|
@@ -69,6 +69,11 @@ export const KNOWN_CAPABILITIES = {
|
|
|
69
69
|
description:
|
|
70
70
|
"Manage channel adapter bindings (chat-platform integrations). Plugins contributing a channel (Feishu / Telegram / WeChat / ...) call create/start/stop/delete here so the host's adapter manager actually wires the inbound stream to the agent. The DB row + adapter lifecycle live together behind this capability.",
|
|
71
71
|
},
|
|
72
|
+
"host.workforceSnapshot": {
|
|
73
|
+
exclusive: true,
|
|
74
|
+
description:
|
|
75
|
+
"Build a read-only snapshot of the tenant's agent configuration (main agent prompt + tools + skills, every worker agent's prompt + allowed tools + allowed skills). Used by the Workforce Studio plugin to render an inspect-and-export UI; the snapshot includes full skill markdown bodies so the studio can ship a faithful bundle.",
|
|
76
|
+
},
|
|
72
77
|
} as const satisfies Record<string, CapabilitySpec>;
|
|
73
78
|
|
|
74
79
|
export type CapabilityName = keyof typeof KNOWN_CAPABILITIES;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// Capability shape for `host.workforceSnapshot` — used by the
|
|
2
|
+
// Workforce Studio plugin to introspect + export the tenant's
|
|
3
|
+
// agent configuration in one call.
|
|
4
|
+
//
|
|
5
|
+
// The host returns a complete read-only snapshot covering:
|
|
6
|
+
// - the main agent's identity (brand, default model) + the
|
|
7
|
+
// skills it actually sees (after scope/when filtering)
|
|
8
|
+
// - every active tool's schema, source plugin, and since
|
|
9
|
+
// version
|
|
10
|
+
// - every worker agent's prompt, allowed tools, allowed skills
|
|
11
|
+
//
|
|
12
|
+
// Unlike the catalog capabilities (host.toolCatalog,
|
|
13
|
+
// host.skillCatalog) this surface includes the FULL skill body
|
|
14
|
+
// so the studio's zip export can ship every skill .md file as
|
|
15
|
+
// part of the bundle. The catalog capabilities stay slim for
|
|
16
|
+
// the cases that only need names + descriptions.
|
|
17
|
+
|
|
18
|
+
/** Where a tool / skill comes from. Studio renders this as a
|
|
19
|
+
* coloured badge so the operator can tell at a glance whether
|
|
20
|
+
* a capability is part of the core install, a built-in plugin,
|
|
21
|
+
* or something a tenant administrator added later.
|
|
22
|
+
*
|
|
23
|
+
* - "core" Host-owned tools registered directly by
|
|
24
|
+
* the server (e.g. worker_analytics).
|
|
25
|
+
* - "builtin-plugin" A plugin shipped under `plugins/<id>/`
|
|
26
|
+
* inside this Tianshu install. Always
|
|
27
|
+
* available without operator action.
|
|
28
|
+
* - "tenant-plugin" A plugin discovered under the tenant's
|
|
29
|
+
* `<home>/_tenant/config/plugins/<id>/`
|
|
30
|
+
* — installed/edited per-tenant.
|
|
31
|
+
*/
|
|
32
|
+
export type WorkforceOrigin = "core" | "builtin-plugin" | "tenant-plugin";
|
|
33
|
+
|
|
34
|
+
/** Tool the agent has access to, with enough detail to render a
|
|
35
|
+
* studio detail panel + write a `tools.md` entry in the zip. */
|
|
36
|
+
export interface WorkforceToolEntry {
|
|
37
|
+
/** Schema name the model calls. */
|
|
38
|
+
name: string;
|
|
39
|
+
/** One-line description from the tool's schema. */
|
|
40
|
+
description: string;
|
|
41
|
+
/** JSON schema for the tool's parameters, exactly as the model
|
|
42
|
+
* sees it. Studio renders this for documentation. */
|
|
43
|
+
parameters: unknown;
|
|
44
|
+
/** Plugin that contributes the tool, or "core" for host-owned
|
|
45
|
+
* tools like worker_analytics. */
|
|
46
|
+
pluginId: string;
|
|
47
|
+
/** Manifest `since` version (string semver). null when the
|
|
48
|
+
* plugin didn't declare it. */
|
|
49
|
+
since: string | null;
|
|
50
|
+
/** Provenance bucket. Computed from `pluginId` against the
|
|
51
|
+
* plugin inventory so the studio can group/colour by origin. */
|
|
52
|
+
origin: WorkforceOrigin;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Skill the agent has access to. Includes the markdown body so
|
|
56
|
+
* the zip export can reproduce the file the agent reads when it
|
|
57
|
+
* decides to load the skill. */
|
|
58
|
+
export interface WorkforceSkillEntry {
|
|
59
|
+
/** Frontmatter `name`. Unique across enabled skills. */
|
|
60
|
+
name: string;
|
|
61
|
+
/** Frontmatter `description`. */
|
|
62
|
+
description: string;
|
|
63
|
+
/** Plugin id that owns the contribution, or "host" for
|
|
64
|
+
* built-in skills shipped under packages/server/host-skills. */
|
|
65
|
+
pluginId: string;
|
|
66
|
+
/** "main" / "worker" / undefined (visible to both). */
|
|
67
|
+
scope?: "main" | "worker";
|
|
68
|
+
/** Path of the skill file as seen by the agent. Studio mirrors
|
|
69
|
+
* this into the zip under `skills/<path>` so the export is a
|
|
70
|
+
* faithful reproduction of what the model reads. */
|
|
71
|
+
relativePath: string;
|
|
72
|
+
/** Full markdown body, frontmatter included. */
|
|
73
|
+
body: string;
|
|
74
|
+
/** Same provenance bucket as tools; computed from `pluginId`. */
|
|
75
|
+
origin: WorkforceOrigin;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** One row in the plugin inventory the studio displays at the top
|
|
79
|
+
* of the snapshot. The host derives this from the active plugin
|
|
80
|
+
* registry; non-active (failed / disabled) plugins are still
|
|
81
|
+
* surfaced so admins can see why a missing tool/skill is missing. */
|
|
82
|
+
export interface WorkforcePluginInfo {
|
|
83
|
+
id: string;
|
|
84
|
+
displayName: string;
|
|
85
|
+
version: string;
|
|
86
|
+
description: string;
|
|
87
|
+
/** Where the plugin manifest was found. Maps directly to
|
|
88
|
+
* WorkforceOrigin so the studio can colour-match plugin rows
|
|
89
|
+
* against tool/skill badges. */
|
|
90
|
+
origin: "builtin-plugin" | "tenant-plugin";
|
|
91
|
+
/** Lifecycle state: "active" means the registry activated it;
|
|
92
|
+
* "failed" / "disabled" / etc. mean the plugin is known but
|
|
93
|
+
* not currently contributing anything. Studio displays the
|
|
94
|
+
* reason for non-active states. */
|
|
95
|
+
state: "active" | "failed" | "disabled" | "loading";
|
|
96
|
+
/** Populated for non-active states; null when state===active. */
|
|
97
|
+
failureReason: string | null;
|
|
98
|
+
/** Number of tools this plugin currently contributes to the
|
|
99
|
+
* main agent. Useful for a quick "weight" view. */
|
|
100
|
+
toolCount: number;
|
|
101
|
+
/** Number of skills this plugin currently contributes. */
|
|
102
|
+
skillCount: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface WorkforceMainAgent {
|
|
106
|
+
/** Brand name from tenant config. */
|
|
107
|
+
brandName: string;
|
|
108
|
+
/** Default model id (provider-prefixed). May be null when the
|
|
109
|
+
* tenant has no models configured. */
|
|
110
|
+
defaultModelId: string | null;
|
|
111
|
+
/** Composed system prompt the agent would receive on the next
|
|
112
|
+
* turn if it ran right now. Includes plugin fragments + the
|
|
113
|
+
* current skill catalog block; static enough to diff across
|
|
114
|
+
* upgrades. */
|
|
115
|
+
systemPrompt: string;
|
|
116
|
+
/** Every tool currently visible to the main agent. Already
|
|
117
|
+
* filtered for `available()` and skill-aware gating. */
|
|
118
|
+
tools: WorkforceToolEntry[];
|
|
119
|
+
/** Every skill visible to the main agent after
|
|
120
|
+
* scope/when filtering. */
|
|
121
|
+
skills: WorkforceSkillEntry[];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface WorkforceWorkerAgent {
|
|
125
|
+
/** Slug (directory name under
|
|
126
|
+
* `_tenant/config/workers/<slug>/`). Used as the agent id
|
|
127
|
+
* everywhere else in the system. */
|
|
128
|
+
slug: string;
|
|
129
|
+
/** Display name from the worker's agent.json. */
|
|
130
|
+
name: string;
|
|
131
|
+
/** One-line description from agent.json. */
|
|
132
|
+
description: string | null;
|
|
133
|
+
/** Functional category (default-llm / code / research / ...). */
|
|
134
|
+
kind: string;
|
|
135
|
+
/** "builtin" or "user" — user-authored workers can be edited;
|
|
136
|
+
* builtins are the ones the host ships and the studio surfaces
|
|
137
|
+
* read-only. */
|
|
138
|
+
source: "builtin" | "user";
|
|
139
|
+
/** Whether the workboard pool actually dispatches to this
|
|
140
|
+
* worker. Disabled workers still appear in the studio so admins
|
|
141
|
+
* can inspect why they aren't running. */
|
|
142
|
+
enabled: boolean;
|
|
143
|
+
/** Bound model id, or null when the worker uses whatever the
|
|
144
|
+
* pool/agent loop picks. */
|
|
145
|
+
modelId: string | null;
|
|
146
|
+
/** Composed system prompt the worker actually runs with.
|
|
147
|
+
* Comparable to WorkforceMainAgent.systemPrompt but built
|
|
148
|
+
* via the workboard's worker prompt logic. */
|
|
149
|
+
systemPrompt: string;
|
|
150
|
+
/** Tools the worker is allowed to call after WORKER_DENY_TOOLS
|
|
151
|
+
* + agent.json toolsAllow filtering. */
|
|
152
|
+
tools: WorkforceToolEntry[];
|
|
153
|
+
/** Skills the worker can load (agent.json `skills:` allow-list
|
|
154
|
+
* intersected with the host catalog, scope-filtered for
|
|
155
|
+
* worker visibility). */
|
|
156
|
+
skills: WorkforceSkillEntry[];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface WorkforceSnapshot {
|
|
160
|
+
/** Tenant id this snapshot represents. */
|
|
161
|
+
tenantId: string;
|
|
162
|
+
/** User id this snapshot represents. Per-user surfaces (chat
|
|
163
|
+
* user prompt, etc.) are pinned to this id. */
|
|
164
|
+
userId: string;
|
|
165
|
+
/** ms epoch when the host built the snapshot. */
|
|
166
|
+
generatedAt: number;
|
|
167
|
+
/** Tianshu version that produced the snapshot. Surfaced in the
|
|
168
|
+
* zip's README so future re-imports know what era the export
|
|
169
|
+
* belongs to. */
|
|
170
|
+
tianshuVersion: string;
|
|
171
|
+
/** Inventory of every plugin currently visible to the tenant.
|
|
172
|
+
* Each tool/skill entry's `origin` field is derived from this
|
|
173
|
+
* list, so a UI can correlate a badge back to a concrete row. */
|
|
174
|
+
plugins: WorkforcePluginInfo[];
|
|
175
|
+
main: WorkforceMainAgent;
|
|
176
|
+
workers: WorkforceWorkerAgent[];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface WorkforceSnapshotCapability {
|
|
180
|
+
/** Build a complete snapshot of the tenant's agent configuration
|
|
181
|
+
* for the given user. Synchronous — every dependency is
|
|
182
|
+
* already in memory or backed by quick fs reads.
|
|
183
|
+
*
|
|
184
|
+
* The userId pins per-user context (user home AGENTS/SOUL/USER
|
|
185
|
+
* blocks the agent would actually see), so callers must pass it
|
|
186
|
+
* through from the authenticated request rather than letting
|
|
187
|
+
* the capability default. */
|
|
188
|
+
build(userId: string): WorkforceSnapshot;
|
|
189
|
+
}
|
package/package.json
CHANGED
|
@@ -43,6 +43,10 @@ export declare const KNOWN_CAPABILITIES: {
|
|
|
43
43
|
readonly exclusive: true;
|
|
44
44
|
readonly description: "Manage channel adapter bindings (chat-platform integrations). Plugins contributing a channel (Feishu / Telegram / WeChat / ...) call create/start/stop/delete here so the host's adapter manager actually wires the inbound stream to the agent. The DB row + adapter lifecycle live together behind this capability.";
|
|
45
45
|
};
|
|
46
|
+
readonly "host.workforceSnapshot": {
|
|
47
|
+
readonly exclusive: true;
|
|
48
|
+
readonly description: "Build a read-only snapshot of the tenant's agent configuration (main agent prompt + tools + skills, every worker agent's prompt + allowed tools + allowed skills). Used by the Workforce Studio plugin to render an inspect-and-export UI; the snapshot includes full skill markdown bodies so the studio can ship a faithful bundle.";
|
|
49
|
+
};
|
|
46
50
|
};
|
|
47
51
|
export type CapabilityName = keyof typeof KNOWN_CAPABILITIES;
|
|
48
52
|
/** True iff the given string is a registered capability name. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDoB,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAE7D,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,cAAc,CAE/D;AAED,2DAA2D;AAC3D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEvE"}
|
|
@@ -53,6 +53,10 @@ export const KNOWN_CAPABILITIES = {
|
|
|
53
53
|
exclusive: true,
|
|
54
54
|
description: "Manage channel adapter bindings (chat-platform integrations). Plugins contributing a channel (Feishu / Telegram / WeChat / ...) call create/start/stop/delete here so the host's adapter manager actually wires the inbound stream to the agent. The DB row + adapter lifecycle live together behind this capability.",
|
|
55
55
|
},
|
|
56
|
+
"host.workforceSnapshot": {
|
|
57
|
+
exclusive: true,
|
|
58
|
+
description: "Build a read-only snapshot of the tenant's agent configuration (main agent prompt + tools + skills, every worker agent's prompt + allowed tools + allowed skills). Used by the Workforce Studio plugin to render an inspect-and-export UI; the snapshot includes full skill markdown bodies so the studio can ship a faithful bundle.",
|
|
59
|
+
},
|
|
56
60
|
};
|
|
57
61
|
/** True iff the given string is a registered capability name. */
|
|
58
62
|
export function isCapabilityName(s) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AAC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AI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC"}
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,iEAAiE;AACjE,iEAAiE;AACjE,sEAAsE;AACtE,oEAAoE;AACpE,0DAA0D;AAC1D,EAAE;AACF,mBAAmB;AACnB,kEAAkE;AAClE,+DAA+D;AAC/D,mCAAmC;AACnC,kEAAkE;AAClE,2DAA2D;AAO3D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,eAAe,EAAE;QACf,SAAS,EAAE,IAAI;QACf,WAAW,EACT,8EAA8E;KACjF;IACD,kBAAkB,EAAE;QAClB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,0SAA0S;KAC7S;IACD,aAAa,EAAE;QACb,SAAS,EAAE,IAAI;QACf,WAAW,EACT,0HAA0H;KAC7H;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,uTAAuT;KAC1T;IACD,mBAAmB,EAAE;QACnB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,sWAAsW;KACzW;IACD,kBAAkB,EAAE;QAClB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,qTAAqT;KACxT;IACD,mBAAmB,EAAE;QACnB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,oNAAoN;KACvN;IACD,mBAAmB,EAAE;QACnB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,sRAAsR;KACzR;IACD,UAAU,EAAE;QACV,SAAS,EAAE,IAAI;QACf,WAAW,EACT,iXAAiX;KACpX;IACD,sBAAsB,EAAE;QACtB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,uTAAuT;KAC1T;IACD,wBAAwB,EAAE;QACxB,SAAS,EAAE,IAAI;QACf,WAAW,EACT,uUAAuU;KAC1U;CACgD,CAAC;AAIpD,iEAAiE;AACjE,MAAM,UAAU,gBAAgB,CAAC,CAAS;IACxC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC"}
|
|
@@ -6,5 +6,6 @@ export * from "./session-inbox.js";
|
|
|
6
6
|
export * from "./catalog.js";
|
|
7
7
|
export * from "./lsp.js";
|
|
8
8
|
export * from "./channel-bindings.js";
|
|
9
|
+
export * from "./workforce-snapshot.js";
|
|
9
10
|
export { McpToolset, textOfMcpContent, type McpEndpointResolver, type McpToolDescriptor, type McpToolFilter, type McpToolsetEntry, type McpToolsetOptions, type McpToolsetSnapshot, type ToolsetProvider, } from "./mcp-toolset.js";
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC"}
|
|
@@ -16,5 +16,6 @@ export * from "./session-inbox.js";
|
|
|
16
16
|
export * from "./catalog.js";
|
|
17
17
|
export * from "./lsp.js";
|
|
18
18
|
export * from "./channel-bindings.js";
|
|
19
|
+
export * from "./workforce-snapshot.js";
|
|
19
20
|
export { McpToolset, textOfMcpContent, } from "./mcp-toolset.js";
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,mEAAmE;AACnE,oEAAoE;AACpE,qEAAqE;AACrE,iCAAiC;AACjC,EAAE;AACF,wEAAwE;AACxE,iEAAiE;AACjE,0BAA0B;AAE1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,UAAU,EACV,gBAAgB,GAQjB,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,mEAAmE;AACnE,oEAAoE;AACpE,qEAAqE;AACrE,iCAAiC;AACjC,EAAE;AACF,wEAAwE;AACxE,iEAAiE;AACjE,0BAA0B;AAE1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,UAAU,EACV,gBAAgB,GAQjB,MAAM,kBAAkB,CAAC"}
|