@tianshu-ai/tianshu 0.4.0 → 0.4.1

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.
Files changed (117) hide show
  1. package/node_modules/@tianshu-ai/plugin-sdk/dist/capabilities.d.ts +4 -0
  2. package/node_modules/@tianshu-ai/plugin-sdk/dist/capabilities.d.ts.map +1 -1
  3. package/node_modules/@tianshu-ai/plugin-sdk/dist/capabilities.js +4 -0
  4. package/node_modules/@tianshu-ai/plugin-sdk/dist/capabilities.js.map +1 -1
  5. package/node_modules/@tianshu-ai/plugin-sdk/dist/index.d.ts +1 -0
  6. package/node_modules/@tianshu-ai/plugin-sdk/dist/index.d.ts.map +1 -1
  7. package/node_modules/@tianshu-ai/plugin-sdk/dist/index.js +1 -0
  8. package/node_modules/@tianshu-ai/plugin-sdk/dist/index.js.map +1 -1
  9. package/node_modules/@tianshu-ai/plugin-sdk/dist/workforce-snapshot.d.ts +116 -0
  10. package/node_modules/@tianshu-ai/plugin-sdk/dist/workforce-snapshot.d.ts.map +1 -0
  11. package/node_modules/@tianshu-ai/plugin-sdk/dist/workforce-snapshot.js +18 -0
  12. package/node_modules/@tianshu-ai/plugin-sdk/dist/workforce-snapshot.js.map +1 -0
  13. package/node_modules/@tianshu-ai/plugin-sdk/src/capabilities.ts +5 -0
  14. package/node_modules/@tianshu-ai/plugin-sdk/src/index.ts +1 -0
  15. package/node_modules/@tianshu-ai/plugin-sdk/src/workforce-snapshot.ts +137 -0
  16. package/package.json +1 -1
  17. package/packages/plugin-sdk/dist/capabilities.d.ts +4 -0
  18. package/packages/plugin-sdk/dist/capabilities.d.ts.map +1 -1
  19. package/packages/plugin-sdk/dist/capabilities.js +4 -0
  20. package/packages/plugin-sdk/dist/capabilities.js.map +1 -1
  21. package/packages/plugin-sdk/dist/index.d.ts +1 -0
  22. package/packages/plugin-sdk/dist/index.d.ts.map +1 -1
  23. package/packages/plugin-sdk/dist/index.js +1 -0
  24. package/packages/plugin-sdk/dist/index.js.map +1 -1
  25. package/packages/plugin-sdk/dist/workforce-snapshot.d.ts +116 -0
  26. package/packages/plugin-sdk/dist/workforce-snapshot.d.ts.map +1 -0
  27. package/packages/plugin-sdk/dist/workforce-snapshot.js +18 -0
  28. package/packages/plugin-sdk/dist/workforce-snapshot.js.map +1 -0
  29. package/packages/server/builtinConfig/plugins/workforce-studio/manifest.json +27 -0
  30. package/packages/server/dist/index.js +16 -0
  31. package/packages/server/dist/index.js.map +1 -1
  32. package/packages/server/dist/plugins-routes.d.ts +3 -3
  33. package/packages/server/dist/setup/update.d.ts.map +1 -1
  34. package/packages/server/dist/setup/update.js +52 -0
  35. package/packages/server/dist/setup/update.js.map +1 -1
  36. package/packages/server/dist/workforce/snapshot.d.ts +31 -0
  37. package/packages/server/dist/workforce/snapshot.d.ts.map +1 -0
  38. package/packages/server/dist/workforce/snapshot.js +147 -0
  39. package/packages/server/dist/workforce/snapshot.js.map +1 -0
  40. package/packages/web/dist/assets/angular-html-BVBpGdXr.js +1 -0
  41. package/packages/web/dist/assets/{angular-ts-DI1dI61I.js → angular-ts-BfdufMKP.js} +1 -1
  42. package/packages/web/dist/assets/{astro-Ce5mz0W9.js → astro-JKRPP03v.js} +1 -1
  43. package/packages/web/dist/assets/{blade-CLyXRJDZ.js → blade-DA8yMPsw.js} +1 -1
  44. package/packages/web/dist/assets/bundle-web-CN6iyzXK.js +13 -0
  45. package/packages/web/dist/assets/c-Wt1voDr2.js +1 -0
  46. package/packages/web/dist/assets/{coffee-gy4cTilr.js → coffee-CThvmt4R.js} +1 -1
  47. package/packages/web/dist/assets/{cpp-BlCe0wXi.js → cpp-C5WNSHb9.js} +1 -1
  48. package/packages/web/dist/assets/css-DJp_X0uY.js +1 -0
  49. package/packages/web/dist/assets/glsl-Dv5r7kPw.js +1 -0
  50. package/packages/web/dist/assets/{graphql-AORc6ksH.js → graphql-CcFwQwm0.js} +1 -1
  51. package/packages/web/dist/assets/{haml-DdfUb-ne.js → haml-Bg4I2hiD.js} +1 -1
  52. package/packages/web/dist/assets/{handlebars-DSq_FD-9.js → handlebars-DnwbnL5R.js} +1 -1
  53. package/packages/web/dist/assets/html-C8UlPnhE.js +1 -0
  54. package/packages/web/dist/assets/{html-derivative-evOR5SA8.js → html-derivative-CY6NRz-J.js} +1 -1
  55. package/packages/web/dist/assets/{http-We-luHhY.js → http-CoW620Fi.js} +1 -1
  56. package/packages/web/dist/assets/{hurl-N4vSJmne.js → hurl-CSSETujw.js} +1 -1
  57. package/packages/web/dist/assets/index-Cwi5Z-00.js +71 -0
  58. package/packages/web/dist/assets/index-DanHqw0s.css +2 -0
  59. package/packages/web/dist/assets/java-CGc3VwQr.js +1 -0
  60. package/packages/web/dist/assets/javascript-CUt1pgmJ.js +1 -0
  61. package/packages/web/dist/assets/{jinja-DUwAWKUy.js → jinja-CD-Z-FLd.js} +1 -1
  62. package/packages/web/dist/assets/{jison-BeIkQZJr.js → jison-imPNup1l.js} +1 -1
  63. package/packages/web/dist/assets/jsx-CY6oMTks.js +1 -0
  64. package/packages/web/dist/assets/{julia-7AZvIVK4.js → julia-CjffhBEM.js} +1 -1
  65. package/packages/web/dist/assets/{marko-B3ZYqTDP.js → marko-DvhNOisQ.js} +1 -1
  66. package/packages/web/dist/assets/{mdc-B6iWGH1P.js → mdc-CazklSAj.js} +1 -1
  67. package/packages/web/dist/assets/papaparse.min-BQRX_pWo.js +10 -0
  68. package/packages/web/dist/assets/{php-CnSNWAsA.js → php-CBqsN0ai.js} +1 -1
  69. package/packages/web/dist/assets/{pug-CFzaFOLA.js → pug-C5hz5LQ7.js} +1 -1
  70. package/packages/web/dist/assets/regexp-Omp9DhTb.js +1 -0
  71. package/packages/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  72. package/packages/web/dist/assets/scss-DdSxiZKl.js +1 -0
  73. package/packages/web/dist/assets/sql-DNssxck8.js +1 -0
  74. package/packages/web/dist/assets/{svelte-cmIwjtUa.js → svelte-DOdLCIlh.js} +1 -1
  75. package/packages/web/dist/assets/{ts-tags-D4TcqQGA.js → ts-tags-Ca73dJJY.js} +1 -1
  76. package/packages/web/dist/assets/tsx-5Eka4NBX.js +1 -0
  77. package/packages/web/dist/assets/typescript-DOu2WMV5.js +1 -0
  78. package/packages/web/dist/assets/{vue-Do7CHdUR.js → vue-Bfx0ffIq.js} +1 -1
  79. package/packages/web/dist/assets/{vue-html-D5kxJZMa.js → vue-html-BeluIYX0.js} +1 -1
  80. package/packages/web/dist/assets/{vue-vine-CjyCoysS.js → vue-vine-DGUAbOCX.js} +1 -1
  81. package/packages/web/dist/assets/xml-DIqSwXR3.js +1 -0
  82. package/packages/web/dist/index.html +3 -2
  83. package/packages/web/package.json +4 -4
  84. package/plugins/workforce-studio/dist/client.d.ts +5 -0
  85. package/plugins/workforce-studio/dist/client.d.ts.map +1 -0
  86. package/plugins/workforce-studio/dist/client.js +101 -0
  87. package/plugins/workforce-studio/dist/client.js.map +1 -0
  88. package/plugins/workforce-studio/dist/server.d.ts +5 -0
  89. package/plugins/workforce-studio/dist/server.d.ts.map +1 -0
  90. package/plugins/workforce-studio/dist/server.js +89 -0
  91. package/plugins/workforce-studio/dist/server.js.map +1 -0
  92. package/plugins/workforce-studio/dist/zip-builder.d.ts +19 -0
  93. package/plugins/workforce-studio/dist/zip-builder.d.ts.map +1 -0
  94. package/plugins/workforce-studio/dist/zip-builder.js +282 -0
  95. package/plugins/workforce-studio/dist/zip-builder.js.map +1 -0
  96. package/plugins/workforce-studio/manifest.json +27 -0
  97. package/plugins/workforce-studio/node_modules/typescript/README.md +50 -0
  98. package/plugins/workforce-studio/node_modules/typescript/package.json +120 -0
  99. package/plugins/workforce-studio/package.json +36 -0
  100. package/packages/web/dist/assets/angular-html-Cvub90Dz.js +0 -1
  101. package/packages/web/dist/assets/bundle-web-CxQb8-l5.js +0 -13
  102. package/packages/web/dist/assets/c-As86Lww3.js +0 -1
  103. package/packages/web/dist/assets/css-CXve-siW.js +0 -1
  104. package/packages/web/dist/assets/glsl-CXl6tvOm.js +0 -1
  105. package/packages/web/dist/assets/html-C7SJ_cNO.js +0 -1
  106. package/packages/web/dist/assets/index-CM0wb7K0.js +0 -70
  107. package/packages/web/dist/assets/index-YR1aGlWo.css +0 -2
  108. package/packages/web/dist/assets/java-BjFwMRAB.js +0 -1
  109. package/packages/web/dist/assets/javascript-Mc8Zyzj4.js +0 -1
  110. package/packages/web/dist/assets/jsx-Du6JQ-EF.js +0 -1
  111. package/packages/web/dist/assets/papaparse.min-BP6q-ooU.js +0 -10
  112. package/packages/web/dist/assets/regexp-DXOuShFp.js +0 -1
  113. package/packages/web/dist/assets/scss-CDgA5HpI.js +0 -1
  114. package/packages/web/dist/assets/sql-Cd1aIPsP.js +0 -1
  115. package/packages/web/dist/assets/tsx-DkLE1Tnp.js +0 -1
  116. package/packages/web/dist/assets/typescript-tBsNrWwg.js +0 -1
  117. 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDoB,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"}
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;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"}
@@ -0,0 +1,116 @@
1
+ /** Tool the agent has access to, with enough detail to render a
2
+ * studio detail panel + write a `tools.md` entry in the zip. */
3
+ export interface WorkforceToolEntry {
4
+ /** Schema name the model calls. */
5
+ name: string;
6
+ /** One-line description from the tool's schema. */
7
+ description: string;
8
+ /** JSON schema for the tool's parameters, exactly as the model
9
+ * sees it. Studio renders this for documentation. */
10
+ parameters: unknown;
11
+ /** Plugin that contributes the tool, or "core" for host-owned
12
+ * tools like worker_analytics. */
13
+ pluginId: string;
14
+ /** Manifest `since` version (string semver). null when the
15
+ * plugin didn't declare it. */
16
+ since: string | null;
17
+ }
18
+ /** Skill the agent has access to. Includes the markdown body so
19
+ * the zip export can reproduce the file the agent reads when it
20
+ * decides to load the skill. */
21
+ export interface WorkforceSkillEntry {
22
+ /** Frontmatter `name`. Unique across enabled skills. */
23
+ name: string;
24
+ /** Frontmatter `description`. */
25
+ description: string;
26
+ /** Plugin id that owns the contribution, or "host" for
27
+ * built-in skills shipped under packages/server/host-skills. */
28
+ pluginId: string;
29
+ /** "main" / "worker" / undefined (visible to both). */
30
+ scope?: "main" | "worker";
31
+ /** Path of the skill file as seen by the agent. Studio mirrors
32
+ * this into the zip under `skills/<path>` so the export is a
33
+ * faithful reproduction of what the model reads. */
34
+ relativePath: string;
35
+ /** Full markdown body, frontmatter included. */
36
+ body: string;
37
+ }
38
+ export interface WorkforceMainAgent {
39
+ /** Brand name from tenant config. */
40
+ brandName: string;
41
+ /** Default model id (provider-prefixed). May be null when the
42
+ * tenant has no models configured. */
43
+ defaultModelId: string | null;
44
+ /** Composed system prompt the agent would receive on the next
45
+ * turn if it ran right now. Includes plugin fragments + the
46
+ * current skill catalog block; static enough to diff across
47
+ * upgrades. */
48
+ systemPrompt: string;
49
+ /** Every tool currently visible to the main agent. Already
50
+ * filtered for `available()` and skill-aware gating. */
51
+ tools: WorkforceToolEntry[];
52
+ /** Every skill visible to the main agent after
53
+ * scope/when filtering. */
54
+ skills: WorkforceSkillEntry[];
55
+ }
56
+ export interface WorkforceWorkerAgent {
57
+ /** Slug (directory name under
58
+ * `_tenant/config/workers/<slug>/`). Used as the agent id
59
+ * everywhere else in the system. */
60
+ slug: string;
61
+ /** Display name from the worker's agent.json. */
62
+ name: string;
63
+ /** One-line description from agent.json. */
64
+ description: string | null;
65
+ /** Functional category (default-llm / code / research / ...). */
66
+ kind: string;
67
+ /** "builtin" or "user" — user-authored workers can be edited;
68
+ * builtins are the ones the host ships and the studio surfaces
69
+ * read-only. */
70
+ source: "builtin" | "user";
71
+ /** Whether the workboard pool actually dispatches to this
72
+ * worker. Disabled workers still appear in the studio so admins
73
+ * can inspect why they aren't running. */
74
+ enabled: boolean;
75
+ /** Bound model id, or null when the worker uses whatever the
76
+ * pool/agent loop picks. */
77
+ modelId: string | null;
78
+ /** Composed system prompt the worker actually runs with.
79
+ * Comparable to WorkforceMainAgent.systemPrompt but built
80
+ * via the workboard's worker prompt logic. */
81
+ systemPrompt: string;
82
+ /** Tools the worker is allowed to call after WORKER_DENY_TOOLS
83
+ * + agent.json toolsAllow filtering. */
84
+ tools: WorkforceToolEntry[];
85
+ /** Skills the worker can load (agent.json `skills:` allow-list
86
+ * intersected with the host catalog, scope-filtered for
87
+ * worker visibility). */
88
+ skills: WorkforceSkillEntry[];
89
+ }
90
+ export interface WorkforceSnapshot {
91
+ /** Tenant id this snapshot represents. */
92
+ tenantId: string;
93
+ /** User id this snapshot represents. Per-user surfaces (chat
94
+ * user prompt, etc.) are pinned to this id. */
95
+ userId: string;
96
+ /** ms epoch when the host built the snapshot. */
97
+ generatedAt: number;
98
+ /** Tianshu version that produced the snapshot. Surfaced in the
99
+ * zip's README so future re-imports know what era the export
100
+ * belongs to. */
101
+ tianshuVersion: string;
102
+ main: WorkforceMainAgent;
103
+ workers: WorkforceWorkerAgent[];
104
+ }
105
+ export interface WorkforceSnapshotCapability {
106
+ /** Build a complete snapshot of the tenant's agent configuration
107
+ * for the given user. Synchronous — every dependency is
108
+ * already in memory or backed by quick fs reads.
109
+ *
110
+ * The userId pins per-user context (user home AGENTS/SOUL/USER
111
+ * blocks the agent would actually see), so callers must pass it
112
+ * through from the authenticated request rather than letting
113
+ * the capability default. */
114
+ build(userId: string): WorkforceSnapshot;
115
+ }
116
+ //# 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;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;CACtB;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;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB;2CACuC;IACvC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;oBAGgB;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB;6DACyD;IACzD,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B;gCAC4B;IAC5B,MAAM,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC;;yCAEqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb;;qBAEiB;IACjB,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B;;+CAE2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB;iCAC6B;IAC7B,OAAO,EAAE,MAAM,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,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;
@@ -17,6 +17,7 @@ export * from "./session-inbox.js";
17
17
  export * from "./catalog.js";
18
18
  export * from "./lsp.js";
19
19
  export * from "./channel-bindings.js";
20
+ export * from "./workforce-snapshot.js";
20
21
  export {
21
22
  McpToolset,
22
23
  textOfMcpContent,
@@ -0,0 +1,137 @@
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
+ /** Tool the agent has access to, with enough detail to render a
19
+ * studio detail panel + write a `tools.md` entry in the zip. */
20
+ export interface WorkforceToolEntry {
21
+ /** Schema name the model calls. */
22
+ name: string;
23
+ /** One-line description from the tool's schema. */
24
+ description: string;
25
+ /** JSON schema for the tool's parameters, exactly as the model
26
+ * sees it. Studio renders this for documentation. */
27
+ parameters: unknown;
28
+ /** Plugin that contributes the tool, or "core" for host-owned
29
+ * tools like worker_analytics. */
30
+ pluginId: string;
31
+ /** Manifest `since` version (string semver). null when the
32
+ * plugin didn't declare it. */
33
+ since: string | null;
34
+ }
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
+ }
56
+
57
+ export interface WorkforceMainAgent {
58
+ /** Brand name from tenant config. */
59
+ brandName: string;
60
+ /** Default model id (provider-prefixed). May be null when the
61
+ * tenant has no models configured. */
62
+ defaultModelId: string | null;
63
+ /** Composed system prompt the agent would receive on the next
64
+ * turn if it ran right now. Includes plugin fragments + the
65
+ * current skill catalog block; static enough to diff across
66
+ * upgrades. */
67
+ systemPrompt: string;
68
+ /** Every tool currently visible to the main agent. Already
69
+ * filtered for `available()` and skill-aware gating. */
70
+ tools: WorkforceToolEntry[];
71
+ /** Every skill visible to the main agent after
72
+ * scope/when filtering. */
73
+ skills: WorkforceSkillEntry[];
74
+ }
75
+
76
+ export interface WorkforceWorkerAgent {
77
+ /** Slug (directory name under
78
+ * `_tenant/config/workers/<slug>/`). Used as the agent id
79
+ * everywhere else in the system. */
80
+ slug: string;
81
+ /** Display name from the worker's agent.json. */
82
+ name: string;
83
+ /** One-line description from agent.json. */
84
+ description: string | null;
85
+ /** Functional category (default-llm / code / research / ...). */
86
+ kind: string;
87
+ /** "builtin" or "user" — user-authored workers can be edited;
88
+ * builtins are the ones the host ships and the studio surfaces
89
+ * read-only. */
90
+ source: "builtin" | "user";
91
+ /** Whether the workboard pool actually dispatches to this
92
+ * worker. Disabled workers still appear in the studio so admins
93
+ * can inspect why they aren't running. */
94
+ enabled: boolean;
95
+ /** Bound model id, or null when the worker uses whatever the
96
+ * pool/agent loop picks. */
97
+ modelId: string | null;
98
+ /** Composed system prompt the worker actually runs with.
99
+ * Comparable to WorkforceMainAgent.systemPrompt but built
100
+ * via the workboard's worker prompt logic. */
101
+ systemPrompt: string;
102
+ /** Tools the worker is allowed to call after WORKER_DENY_TOOLS
103
+ * + agent.json toolsAllow filtering. */
104
+ tools: WorkforceToolEntry[];
105
+ /** Skills the worker can load (agent.json `skills:` allow-list
106
+ * intersected with the host catalog, scope-filtered for
107
+ * worker visibility). */
108
+ skills: WorkforceSkillEntry[];
109
+ }
110
+
111
+ export interface WorkforceSnapshot {
112
+ /** Tenant id this snapshot represents. */
113
+ tenantId: string;
114
+ /** User id this snapshot represents. Per-user surfaces (chat
115
+ * user prompt, etc.) are pinned to this id. */
116
+ userId: string;
117
+ /** ms epoch when the host built the snapshot. */
118
+ generatedAt: number;
119
+ /** Tianshu version that produced the snapshot. Surfaced in the
120
+ * zip's README so future re-imports know what era the export
121
+ * belongs to. */
122
+ tianshuVersion: string;
123
+ main: WorkforceMainAgent;
124
+ workers: WorkforceWorkerAgent[];
125
+ }
126
+
127
+ export interface WorkforceSnapshotCapability {
128
+ /** Build a complete snapshot of the tenant's agent configuration
129
+ * for the given user. Synchronous — every dependency is
130
+ * already in memory or backed by quick fs reads.
131
+ *
132
+ * The userId pins per-user context (user home AGENTS/SOUL/USER
133
+ * blocks the agent would actually see), so callers must pass it
134
+ * through from the authenticated request rather than letting
135
+ * the capability default. */
136
+ build(userId: string): WorkforceSnapshot;
137
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tianshu-ai/tianshu",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "An open AI agent platform with a sidecar browser. Built in public.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/tianshu-ai/tianshu",
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDoB,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"}
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;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"}
@@ -0,0 +1,116 @@
1
+ /** Tool the agent has access to, with enough detail to render a
2
+ * studio detail panel + write a `tools.md` entry in the zip. */
3
+ export interface WorkforceToolEntry {
4
+ /** Schema name the model calls. */
5
+ name: string;
6
+ /** One-line description from the tool's schema. */
7
+ description: string;
8
+ /** JSON schema for the tool's parameters, exactly as the model
9
+ * sees it. Studio renders this for documentation. */
10
+ parameters: unknown;
11
+ /** Plugin that contributes the tool, or "core" for host-owned
12
+ * tools like worker_analytics. */
13
+ pluginId: string;
14
+ /** Manifest `since` version (string semver). null when the
15
+ * plugin didn't declare it. */
16
+ since: string | null;
17
+ }
18
+ /** Skill the agent has access to. Includes the markdown body so
19
+ * the zip export can reproduce the file the agent reads when it
20
+ * decides to load the skill. */
21
+ export interface WorkforceSkillEntry {
22
+ /** Frontmatter `name`. Unique across enabled skills. */
23
+ name: string;
24
+ /** Frontmatter `description`. */
25
+ description: string;
26
+ /** Plugin id that owns the contribution, or "host" for
27
+ * built-in skills shipped under packages/server/host-skills. */
28
+ pluginId: string;
29
+ /** "main" / "worker" / undefined (visible to both). */
30
+ scope?: "main" | "worker";
31
+ /** Path of the skill file as seen by the agent. Studio mirrors
32
+ * this into the zip under `skills/<path>` so the export is a
33
+ * faithful reproduction of what the model reads. */
34
+ relativePath: string;
35
+ /** Full markdown body, frontmatter included. */
36
+ body: string;
37
+ }
38
+ export interface WorkforceMainAgent {
39
+ /** Brand name from tenant config. */
40
+ brandName: string;
41
+ /** Default model id (provider-prefixed). May be null when the
42
+ * tenant has no models configured. */
43
+ defaultModelId: string | null;
44
+ /** Composed system prompt the agent would receive on the next
45
+ * turn if it ran right now. Includes plugin fragments + the
46
+ * current skill catalog block; static enough to diff across
47
+ * upgrades. */
48
+ systemPrompt: string;
49
+ /** Every tool currently visible to the main agent. Already
50
+ * filtered for `available()` and skill-aware gating. */
51
+ tools: WorkforceToolEntry[];
52
+ /** Every skill visible to the main agent after
53
+ * scope/when filtering. */
54
+ skills: WorkforceSkillEntry[];
55
+ }
56
+ export interface WorkforceWorkerAgent {
57
+ /** Slug (directory name under
58
+ * `_tenant/config/workers/<slug>/`). Used as the agent id
59
+ * everywhere else in the system. */
60
+ slug: string;
61
+ /** Display name from the worker's agent.json. */
62
+ name: string;
63
+ /** One-line description from agent.json. */
64
+ description: string | null;
65
+ /** Functional category (default-llm / code / research / ...). */
66
+ kind: string;
67
+ /** "builtin" or "user" — user-authored workers can be edited;
68
+ * builtins are the ones the host ships and the studio surfaces
69
+ * read-only. */
70
+ source: "builtin" | "user";
71
+ /** Whether the workboard pool actually dispatches to this
72
+ * worker. Disabled workers still appear in the studio so admins
73
+ * can inspect why they aren't running. */
74
+ enabled: boolean;
75
+ /** Bound model id, or null when the worker uses whatever the
76
+ * pool/agent loop picks. */
77
+ modelId: string | null;
78
+ /** Composed system prompt the worker actually runs with.
79
+ * Comparable to WorkforceMainAgent.systemPrompt but built
80
+ * via the workboard's worker prompt logic. */
81
+ systemPrompt: string;
82
+ /** Tools the worker is allowed to call after WORKER_DENY_TOOLS
83
+ * + agent.json toolsAllow filtering. */
84
+ tools: WorkforceToolEntry[];
85
+ /** Skills the worker can load (agent.json `skills:` allow-list
86
+ * intersected with the host catalog, scope-filtered for
87
+ * worker visibility). */
88
+ skills: WorkforceSkillEntry[];
89
+ }
90
+ export interface WorkforceSnapshot {
91
+ /** Tenant id this snapshot represents. */
92
+ tenantId: string;
93
+ /** User id this snapshot represents. Per-user surfaces (chat
94
+ * user prompt, etc.) are pinned to this id. */
95
+ userId: string;
96
+ /** ms epoch when the host built the snapshot. */
97
+ generatedAt: number;
98
+ /** Tianshu version that produced the snapshot. Surfaced in the
99
+ * zip's README so future re-imports know what era the export
100
+ * belongs to. */
101
+ tianshuVersion: string;
102
+ main: WorkforceMainAgent;
103
+ workers: WorkforceWorkerAgent[];
104
+ }
105
+ export interface WorkforceSnapshotCapability {
106
+ /** Build a complete snapshot of the tenant's agent configuration
107
+ * for the given user. Synchronous — every dependency is
108
+ * already in memory or backed by quick fs reads.
109
+ *
110
+ * The userId pins per-user context (user home AGENTS/SOUL/USER
111
+ * blocks the agent would actually see), so callers must pass it
112
+ * through from the authenticated request rather than letting
113
+ * the capability default. */
114
+ build(userId: string): WorkforceSnapshot;
115
+ }
116
+ //# 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;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;CACtB;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;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB;2CACuC;IACvC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;oBAGgB;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB;6DACyD;IACzD,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B;gCAC4B;IAC5B,MAAM,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC;;yCAEqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb;;qBAEiB;IACjB,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B;;+CAE2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB;iCAC6B;IAC7B,OAAO,EAAE,MAAM,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,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"}
@@ -0,0 +1,27 @@
1
+ {
2
+ "id": "workforce-studio",
3
+ "version": "0.1.0",
4
+ "displayName": "Workforce Studio",
5
+ "description": "Inspect + export the tenant's main agent and every worker agent — system prompts, available tools, skills — into a single downloadable bundle. Phase 1 is read-only: editing + import land in later phases.",
6
+ "author": "tianshu-ai",
7
+ "license": "MIT",
8
+ "permissions": [],
9
+ "server": { "entry": "@tianshu-builtin/plugin-workforce-studio/server" },
10
+ "client": { "entry": "@tianshu-builtin/plugin-workforce-studio/client" },
11
+ "contributes": {
12
+ "adminPages": [
13
+ {
14
+ "id": "main",
15
+ "displayName": "Workforce Studio",
16
+ "icon": "Layers",
17
+ "component": "WorkforceStudioPage",
18
+ "group": "Tools",
19
+ "order": 50
20
+ }
21
+ ],
22
+ "apiRoutes": [
23
+ { "method": "GET", "path": "/snapshot", "handler": "getSnapshot" },
24
+ { "method": "GET", "path": "/snapshot/zip", "handler": "downloadZip" }
25
+ ]
26
+ }
27
+ }