comisai 1.0.24 → 1.0.26

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 (192) hide show
  1. package/node_modules/@comis/agent/dist/bootstrap/sections/tool-descriptions.js +130 -10
  2. package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.d.ts +1 -1
  3. package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.js +9 -2
  4. package/node_modules/@comis/agent/dist/bridge/bridge-metrics.d.ts +8 -0
  5. package/node_modules/@comis/agent/dist/bridge/bridge-metrics.js +2 -0
  6. package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.d.ts +29 -0
  7. package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.js +242 -2
  8. package/node_modules/@comis/agent/dist/bridge/thinking-block-hash-invariant.d.ts +210 -0
  9. package/node_modules/@comis/agent/dist/bridge/thinking-block-hash-invariant.js +566 -0
  10. package/node_modules/@comis/agent/dist/context-engine/context-engine.js +8 -6
  11. package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.d.ts +51 -30
  12. package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.js +109 -36
  13. package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.js +5 -1
  14. package/node_modules/@comis/agent/dist/executor/executor-post-execution.js +22 -20
  15. package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.d.ts +2 -0
  16. package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.js +111 -15
  17. package/node_modules/@comis/agent/dist/executor/executor-response-filter.d.ts +20 -17
  18. package/node_modules/@comis/agent/dist/executor/executor-response-filter.js +132 -52
  19. package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.js +16 -3
  20. package/node_modules/@comis/agent/dist/executor/model-retry.d.ts +14 -0
  21. package/node_modules/@comis/agent/dist/executor/model-retry.js +72 -1
  22. package/node_modules/@comis/agent/dist/executor/pi-executor.d.ts +3 -0
  23. package/node_modules/@comis/agent/dist/executor/pi-executor.js +68 -9
  24. package/node_modules/@comis/agent/dist/executor/post-batch-continuation.d.ts +82 -0
  25. package/node_modules/@comis/agent/dist/executor/post-batch-continuation.js +200 -0
  26. package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.js +1 -9
  27. package/node_modules/@comis/agent/dist/executor/tool-deferral.d.ts +37 -2
  28. package/node_modules/@comis/agent/dist/executor/tool-deferral.js +45 -3
  29. package/node_modules/@comis/agent/dist/executor/tool-parallelism.js +0 -1
  30. package/node_modules/@comis/agent/dist/executor/types.d.ts +11 -2
  31. package/node_modules/@comis/agent/dist/index.d.ts +3 -1
  32. package/node_modules/@comis/agent/dist/index.js +2 -0
  33. package/node_modules/@comis/agent/dist/model/last-known-model.d.ts +36 -0
  34. package/node_modules/@comis/agent/dist/model/last-known-model.js +49 -0
  35. package/node_modules/@comis/agent/dist/model/model-registry-adapter.d.ts +16 -4
  36. package/node_modules/@comis/agent/dist/model/model-registry-adapter.js +65 -21
  37. package/node_modules/@comis/agent/dist/planner/types.d.ts +0 -2
  38. package/node_modules/@comis/agent/dist/session/comis-session-manager.d.ts +10 -0
  39. package/node_modules/@comis/agent/dist/session/comis-session-manager.js +5 -0
  40. package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.js +7 -0
  41. package/node_modules/@comis/agent/package.json +1 -1
  42. package/node_modules/@comis/channels/package.json +1 -1
  43. package/node_modules/@comis/cli/dist/client/rpc-client.js +6 -1
  44. package/node_modules/@comis/cli/dist/commands/doctor.js +5 -3
  45. package/node_modules/@comis/cli/dist/commands/health.js +5 -2
  46. package/node_modules/@comis/cli/dist/wizard/json-output.js +7 -3
  47. package/node_modules/@comis/cli/dist/wizard/steps/11-daemon-start.js +130 -0
  48. package/node_modules/@comis/cli/package.json +1 -1
  49. package/node_modules/@comis/core/dist/bootstrap.js +5 -0
  50. package/node_modules/@comis/core/dist/config/env-layer.d.ts +31 -0
  51. package/node_modules/@comis/core/dist/config/env-layer.js +41 -0
  52. package/node_modules/@comis/core/dist/config/immutable-keys.d.ts +2 -2
  53. package/node_modules/@comis/core/dist/config/immutable-keys.js +8 -3
  54. package/node_modules/@comis/core/dist/config/layered.d.ts +9 -0
  55. package/node_modules/@comis/core/dist/config/layered.js +11 -0
  56. package/node_modules/@comis/core/dist/config/managed-sections.d.ts +43 -4
  57. package/node_modules/@comis/core/dist/config/managed-sections.js +100 -6
  58. package/node_modules/@comis/core/dist/config/schema-agent.d.ts +39 -0
  59. package/node_modules/@comis/core/dist/config/schema-agent.js +14 -0
  60. package/node_modules/@comis/core/dist/config/schema.d.ts +4 -0
  61. package/node_modules/@comis/core/dist/config/schema.js +14 -0
  62. package/node_modules/@comis/core/dist/domain/execution-graph.d.ts +1 -1
  63. package/node_modules/@comis/core/dist/event-bus/events-agent.d.ts +17 -2
  64. package/node_modules/@comis/core/dist/exports/config.d.ts +2 -2
  65. package/node_modules/@comis/core/dist/exports/config.js +1 -1
  66. package/node_modules/@comis/core/package.json +1 -1
  67. package/node_modules/@comis/daemon/dist/daemon.d.ts +22 -0
  68. package/node_modules/@comis/daemon/dist/daemon.js +45 -0
  69. package/node_modules/@comis/daemon/dist/rpc/agent-handlers.d.ts +5 -2
  70. package/node_modules/@comis/daemon/dist/rpc/agent-handlers.js +80 -1
  71. package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.d.ts +67 -0
  72. package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.js +139 -0
  73. package/node_modules/@comis/daemon/dist/rpc/model-handlers.d.ts +3 -0
  74. package/node_modules/@comis/daemon/dist/rpc/model-handlers.js +29 -5
  75. package/node_modules/@comis/daemon/dist/rpc/probe-provider-auth.d.ts +30 -0
  76. package/node_modules/@comis/daemon/dist/rpc/probe-provider-auth.js +59 -0
  77. package/node_modules/@comis/daemon/dist/rpc/provider-handlers.d.ts +37 -0
  78. package/node_modules/@comis/daemon/dist/rpc/provider-handlers.js +330 -0
  79. package/node_modules/@comis/daemon/dist/rpc/rpc-dispatch.js +18 -1
  80. package/node_modules/@comis/daemon/dist/setup-docker-restart-warn.d.ts +4 -0
  81. package/node_modules/@comis/daemon/dist/setup-docker-restart-warn.js +30 -0
  82. package/node_modules/@comis/daemon/dist/wiring/setup-agents.d.ts +3 -1
  83. package/node_modules/@comis/daemon/dist/wiring/setup-agents.js +28 -2
  84. package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.js +1 -0
  85. package/node_modules/@comis/daemon/dist/wiring/setup-tools.js +7 -4
  86. package/node_modules/@comis/daemon/package.json +1 -1
  87. package/node_modules/@comis/gateway/package.json +1 -1
  88. package/node_modules/@comis/infra/dist/index.d.ts +1 -0
  89. package/node_modules/@comis/infra/dist/index.js +2 -0
  90. package/node_modules/@comis/infra/dist/runtime/is-docker.d.ts +1 -0
  91. package/node_modules/@comis/infra/dist/runtime/is-docker.js +25 -0
  92. package/node_modules/@comis/infra/package.json +1 -1
  93. package/node_modules/@comis/memory/package.json +1 -1
  94. package/node_modules/@comis/scheduler/package.json +1 -1
  95. package/node_modules/@comis/shared/package.json +1 -1
  96. package/node_modules/@comis/skills/dist/bridge/tool-metadata-registry.js +1 -3
  97. package/node_modules/@comis/skills/dist/builtin/platform/admin-manage-factory.js +24 -1
  98. package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.d.ts +53 -7
  99. package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.js +218 -24
  100. package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.d.ts +4 -1
  101. package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.js +16 -1
  102. package/node_modules/@comis/skills/dist/builtin/platform/index.d.ts +1 -1
  103. package/node_modules/@comis/skills/dist/builtin/platform/index.js +1 -1
  104. package/node_modules/@comis/skills/dist/builtin/platform/providers-manage-tool.d.ts +56 -0
  105. package/node_modules/@comis/skills/dist/builtin/platform/providers-manage-tool.js +203 -0
  106. package/node_modules/@comis/skills/dist/index.d.ts +1 -1
  107. package/node_modules/@comis/skills/dist/index.js +2 -2
  108. package/node_modules/@comis/skills/dist/policy/tool-policy.js +0 -1
  109. package/node_modules/@comis/skills/package.json +1 -1
  110. package/node_modules/@comis/web/dist/assets/{agent-detail-BG9MGWWj.js → agent-detail-DqL6Artv.js} +270 -270
  111. package/node_modules/@comis/web/dist/assets/agent-editor-CNM_h94Y.js +2173 -0
  112. package/node_modules/@comis/web/dist/assets/{agent-list-LHCJ4rw2.js → agent-list-Dbh-xD_F.js} +170 -170
  113. package/node_modules/@comis/web/dist/assets/{approvals-q9VH_IKr.js → approvals-C-K6hN2U.js} +13 -13
  114. package/node_modules/@comis/web/dist/assets/billing-view-C1DmtyzK.js +375 -0
  115. package/node_modules/@comis/web/dist/assets/{channel-detail-CaInesJM.js → channel-detail-CtCH22N1.js} +265 -265
  116. package/node_modules/@comis/web/dist/assets/channel-list-C7xXn-60.js +323 -0
  117. package/node_modules/@comis/web/dist/assets/{chat-console-CNmzl0JW.js → chat-console-C51pjFwk.js} +243 -246
  118. package/node_modules/@comis/web/dist/assets/{config-editor-DX4ITw6y.js → config-editor-BLArYRB7.js} +477 -477
  119. package/node_modules/@comis/web/dist/assets/{context-dag-browser-BwiaF5tf.js → context-dag-browser-fuyMinNI.js} +105 -105
  120. package/node_modules/@comis/web/dist/assets/{context-engine-BZ5Am6hA.js → context-engine-Bngf2bH0.js} +136 -136
  121. package/node_modules/@comis/web/dist/assets/decorate-BvWYovGE.js +38 -0
  122. package/node_modules/@comis/web/dist/assets/{delivery-view-OfBZof-m.js → delivery-view-C80hucxX.js} +134 -134
  123. package/node_modules/@comis/web/dist/assets/{diagnostics-view-YFwCxgr2.js → diagnostics-view-Cl4VbHZ6.js} +82 -82
  124. package/node_modules/@comis/web/dist/assets/directive-BOYXJ-K-.js +1 -0
  125. package/node_modules/@comis/web/dist/assets/{extract-variables-BM5qyK-s.js → extract-variables-B7-Doo7l.js} +39 -39
  126. package/node_modules/@comis/web/dist/assets/{ic-array-editor-B7m6x7-S.js → ic-array-editor-BLoEyeLS.js} +29 -29
  127. package/node_modules/@comis/web/dist/assets/{ic-breadcrumb-CUMpp3BL.js → ic-breadcrumb-DqN6G3gc.js} +16 -16
  128. package/node_modules/@comis/web/dist/assets/{ic-budget-segment-bar-BtJ6x5mN.js → ic-budget-segment-bar-zLsMzjDO.js} +20 -20
  129. package/node_modules/@comis/web/dist/assets/ic-chat-message-ByFUoMm6.js +352 -0
  130. package/node_modules/@comis/web/dist/assets/{ic-confirm-dialog-CCDbB04e.js → ic-confirm-dialog-DGlPbV1T.js} +26 -26
  131. package/node_modules/@comis/web/dist/assets/{ic-connection-dot-CnT1b8xr.js → ic-connection-dot-C4nDHgY2.js} +13 -13
  132. package/node_modules/@comis/web/dist/assets/ic-data-table-CKIvr-ag.js +277 -0
  133. package/node_modules/@comis/web/dist/assets/ic-delivery-row-B3YwjjuM.js +67 -0
  134. package/node_modules/@comis/web/dist/assets/{ic-detail-panel-BF83r-if.js → ic-detail-panel-DiCe4hLr.js} +27 -27
  135. package/node_modules/@comis/web/dist/assets/{ic-empty-state-60l2ePhd.js → ic-empty-state-CM3Wbj2f.js} +19 -19
  136. package/node_modules/@comis/web/dist/assets/ic-graph-canvas-ByRjij68.js +359 -0
  137. package/node_modules/@comis/web/dist/assets/ic-icon-BGNCCPpZ.js +33 -0
  138. package/node_modules/@comis/web/dist/assets/{ic-layer-waterfall-COvEYMg5.js → ic-layer-waterfall-WkaFyu-l.js} +18 -18
  139. package/node_modules/@comis/web/dist/assets/ic-relative-time-B3UAnTqg.js +12 -0
  140. package/node_modules/@comis/web/dist/assets/{ic-search-input-CSOxY9g7.js → ic-search-input-B02AGw1i.js} +22 -22
  141. package/node_modules/@comis/web/dist/assets/{ic-select-Ce-Raudx.js → ic-select-BqfZISjw.js} +29 -29
  142. package/node_modules/@comis/web/dist/assets/ic-tabs-yBjkWKJH.js +95 -0
  143. package/node_modules/@comis/web/dist/assets/ic-tag-CvMVQFRR.js +33 -0
  144. package/node_modules/@comis/web/dist/assets/{ic-time-range-picker-CypCT68y.js → ic-time-range-picker-DXbYeBmY.js} +31 -31
  145. package/node_modules/@comis/web/dist/assets/{ic-tool-call-7MaXSsCW.js → ic-tool-call-Bh5kq-yY.js} +51 -51
  146. package/node_modules/@comis/web/dist/assets/index-BBkuC-EU.js +2792 -0
  147. package/node_modules/@comis/web/dist/assets/index-CVEaS9aY.css +2 -0
  148. package/node_modules/@comis/web/dist/assets/{mcp-management-BNZPnpDn.js → mcp-management-DB-phOo7.js} +209 -209
  149. package/node_modules/@comis/web/dist/assets/{media-config-BBvTYxOX.js → media-config-CRqZ1ZUH.js} +154 -154
  150. package/node_modules/@comis/web/dist/assets/{media-test-BkK3RCRK.js → media-test-C9vE20Oy.js} +259 -259
  151. package/node_modules/@comis/web/dist/assets/{memory-inspector-1hDGCGat.js → memory-inspector-CeqfnxMZ.js} +450 -450
  152. package/node_modules/@comis/web/dist/assets/{message-center-CXefwsUu.js → message-center-Daup7Mof.js} +290 -290
  153. package/node_modules/@comis/web/dist/assets/{models-C1qcU_j3.js → models-DLYnEU8E.js} +371 -371
  154. package/node_modules/@comis/web/dist/assets/observability-types-D0tkwElU.js +1 -0
  155. package/node_modules/@comis/web/dist/assets/{observe-view-C0VBhX4C.js → observe-view-BTSt_PO5.js} +399 -399
  156. package/node_modules/@comis/web/dist/assets/pipeline-builder-DknfzyLt.js +1495 -0
  157. package/node_modules/@comis/web/dist/assets/{pipeline-history-DkfOQ6SW.js → pipeline-history-JnHZdeU_.js} +124 -124
  158. package/node_modules/@comis/web/dist/assets/{pipeline-history-detail-hyHgD0ai.js → pipeline-history-detail-Dg4knsEb.js} +65 -65
  159. package/node_modules/@comis/web/dist/assets/{pipeline-list-BPW8hV-q.js → pipeline-list-AEnibjsp.js} +227 -227
  160. package/node_modules/@comis/web/dist/assets/{pipeline-monitor-Bip16T7e.js → pipeline-monitor-DG7RbIOO.js} +298 -298
  161. package/node_modules/@comis/web/dist/assets/{scheduler-BGgwKd06.js → scheduler-uL1fYKAT.js} +486 -486
  162. package/node_modules/@comis/web/dist/assets/{security-D15st4xx.js → security-C3DywRLH.js} +389 -389
  163. package/node_modules/@comis/web/dist/assets/{session-detail-SGEYNJ0M.js → session-detail-BtqCNWXV.js} +294 -294
  164. package/node_modules/@comis/web/dist/assets/session-key-parser-Dkqcj2Ss.js +1 -0
  165. package/node_modules/@comis/web/dist/assets/session-list-CJXWa2XT.js +231 -0
  166. package/node_modules/@comis/web/dist/assets/{setup-wizard-nT0tz9QP.js → setup-wizard-ywn7oJvu.js} +486 -494
  167. package/node_modules/@comis/web/dist/assets/{skills-D8yVfSUy.js → skills-DX0KYnWD.js} +329 -329
  168. package/node_modules/@comis/web/dist/assets/{subagents-HHXMeHYo.js → subagents-B8p5YJEB.js} +74 -74
  169. package/node_modules/@comis/web/dist/assets/{workspace-manager-BQlr10iH.js → workspace-manager-CgzNIrw1.js} +236 -236
  170. package/node_modules/@comis/web/dist/index.html +3 -2
  171. package/node_modules/@comis/web/package.json +1 -1
  172. package/package.json +15 -15
  173. package/node_modules/@comis/skills/dist/builtin/platform/agents-list-tool.d.ts +0 -19
  174. package/node_modules/@comis/skills/dist/builtin/platform/agents-list-tool.js +0 -39
  175. package/node_modules/@comis/web/dist/assets/agent-editor-C26Q_xCs.js +0 -2173
  176. package/node_modules/@comis/web/dist/assets/billing-view-CtYvBqTE.js +0 -375
  177. package/node_modules/@comis/web/dist/assets/channel-list-B8dj3O9a.js +0 -323
  178. package/node_modules/@comis/web/dist/assets/directive-DoeGSK_T.js +0 -1
  179. package/node_modules/@comis/web/dist/assets/ic-chat-message-CFyDJd0z.js +0 -352
  180. package/node_modules/@comis/web/dist/assets/ic-data-table-CKUNTxHw.js +0 -277
  181. package/node_modules/@comis/web/dist/assets/ic-delivery-row-GP5Fkygs.js +0 -67
  182. package/node_modules/@comis/web/dist/assets/ic-graph-canvas-C8FuSMe1.js +0 -359
  183. package/node_modules/@comis/web/dist/assets/ic-icon-xeGTVhVG.js +0 -33
  184. package/node_modules/@comis/web/dist/assets/ic-relative-time-3FqpjeAI.js +0 -12
  185. package/node_modules/@comis/web/dist/assets/ic-tabs-B7QtM_v8.js +0 -95
  186. package/node_modules/@comis/web/dist/assets/ic-tag-CPPUnDLF.js +0 -33
  187. package/node_modules/@comis/web/dist/assets/index-CEcM1R_C.js +0 -2830
  188. package/node_modules/@comis/web/dist/assets/index-CIJFuItj.css +0 -1
  189. package/node_modules/@comis/web/dist/assets/observability-types-D7jUtSde.js +0 -1
  190. package/node_modules/@comis/web/dist/assets/pipeline-builder-DcUUIrm0.js +0 -1496
  191. package/node_modules/@comis/web/dist/assets/session-key-parser-DPORMVyU.js +0 -1
  192. package/node_modules/@comis/web/dist/assets/session-list-6ybUTxbY.js +0 -231
@@ -1,238 +1,4 @@
1
- import{a as g,I as o,b as t,A as d,s as u,f as v,i as b,n as h,r as s,t as _}from"./index-CEcM1R_C.js";import"./ic-breadcrumb-CUMpp3BL.js";import"./ic-tag-CPPUnDLF.js";import"./ic-confirm-dialog-CCDbB04e.js";import"./ic-empty-state-60l2ePhd.js";import"./ic-relative-time-3FqpjeAI.js";import"./ic-icon-xeGTVhVG.js";var x=Object.defineProperty,y=Object.getOwnPropertyDescriptor,a=(e,i,l,c)=>{for(var n=c>1?void 0:c?y(i,l):i,m=e.length-1,f;m>=0;m--)(f=e[m])&&(n=(c?f(i,l,n):f(n))||n);return c&&n&&x(i,l,n),n};const w=["projects","scripts","documents","media","data","output"];function p(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}let r=class extends g{constructor(){super(...arguments),this.rpcClient=null,this.agentId="",this._status=null,this._loadState="loading",this._error="",this._activeTab="files",this._selectedFile=null,this._selectedSubdir=null,this._fileContent="",this._editedContent="",this._dirEntries=[],this._saving=!1,this._dirty=!1,this._confirmAction=null,this._actionPending=!1,this._gitStatus=null,this._gitLog=[],this._gitDiff="",this._gitDiffFile=null,this._commitMessage="",this._committing=!1,this._restoreTarget=null}updated(e){(e.has("agentId")||e.has("rpcClient"))&&this.agentId&&this.rpcClient&&this._loadStatus()}async _loadStatus(){if(!(!this.rpcClient||!this.agentId)){this._loadState="loading",this._error="";try{this._status=await this.rpcClient.call("workspace.status",{agentId:this.agentId}),this._loadState="loaded"}catch(e){this._error=e instanceof Error?e.message:"Failed to load workspace status",this._loadState="error"}}}async _selectFile(e){if(this.rpcClient&&!(this._dirty&&!window.confirm("Discard unsaved changes?")))try{const i=await this.rpcClient.call("workspace.readFile",{agentId:this.agentId,filePath:e});this._selectedFile=e,this._fileContent=i.content,this._editedContent=i.content,this._dirty=!1,this._selectedSubdir=null,this._dirEntries=[]}catch(i){o.show(`Failed to read file: ${i instanceof Error?i.message:"Unknown error"}`,"error")}}async _selectSubdir(e){if(this.rpcClient&&!(this._dirty&&!window.confirm("Discard unsaved changes?")))try{const i=await this.rpcClient.call("workspace.listDir",{agentId:this.agentId,subdir:e});this._selectedSubdir=e,this._dirEntries=i.entries,this._selectedFile=null,this._fileContent="",this._editedContent="",this._dirty=!1}catch(i){o.show(`Failed to list directory: ${i instanceof Error?i.message:"Unknown error"}`,"error")}}_onEditorInput(e){const i=e.target;this._editedContent=i.value,this._dirty=this._editedContent!==this._fileContent}async _loadGitData(){if(!(!this.rpcClient||!this.agentId))try{const[e,i]=await Promise.all([this.rpcClient.call("workspace.git.status",{agentId:this.agentId}),this.rpcClient.call("workspace.git.log",{agentId:this.agentId,limit:20})]);this._gitStatus=e,this._gitLog=i.commits,this._gitDiff="",this._gitDiffFile=null}catch(e){o.show(`Failed to load git data: ${e instanceof Error?e.message:"Unknown error"}`,"error")}}async _loadFileDiff(e){if(!(!this.rpcClient||!this.agentId))try{const i=await this.rpcClient.call("workspace.git.diff",{agentId:this.agentId,filePath:e});this._gitDiff=i.diff,this._gitDiffFile=e}catch(i){o.show(`Failed to load diff: ${i instanceof Error?i.message:"Unknown error"}`,"error")}}async _handleSave(){if(!(!this.rpcClient||this._saving||!this._selectedFile)){this._saving=!0;try{await this.rpcClient.call("workspace.writeFile",{agentId:this.agentId,filePath:this._selectedFile,content:this._editedContent}),o.show("File saved","success"),this._fileContent=this._editedContent,this._dirty=!1}catch(e){o.show(`Failed to save: ${e instanceof Error?e.message:"Unknown error"}`,"error")}finally{this._saving=!1}}}async _handleReset(){if(!(!this.rpcClient||!this._selectedFile)){this._confirmAction=null,this._actionPending=!0;try{await this.rpcClient.call("workspace.resetFile",{agentId:this.agentId,fileName:this._selectedFile}),o.show("File reset to default","success"),await this._selectFile(this._selectedFile)}catch(e){o.show(`Failed to reset file: ${e instanceof Error?e.message:"Unknown error"}`,"error")}finally{this._actionPending=!1}}}async _handleDelete(){if(!(!this.rpcClient||!this._selectedFile)){this._confirmAction=null,this._actionPending=!0;try{await this.rpcClient.call("workspace.deleteFile",{agentId:this.agentId,filePath:this._selectedFile}),o.show("File deleted","success"),this._selectedFile=null,this._fileContent="",this._editedContent="",this._dirty=!1,await this._loadStatus()}catch(e){o.show(`Failed to delete file: ${e instanceof Error?e.message:"Unknown error"}`,"error")}finally{this._actionPending=!1}}}async _handleInit(){if(this.rpcClient){this._actionPending=!0;try{await this.rpcClient.call("workspace.init",{agentId:this.agentId}),o.show("Workspace initialized","success"),await this._loadStatus()}catch(e){o.show(`Failed to initialize workspace: ${e instanceof Error?e.message:"Unknown error"}`,"error")}finally{this._actionPending=!1}}}_switchToGitTab(){this._activeTab="git",this._confirmAction=null,this._restoreTarget=null,this._loadGitData()}_requestRestore(e){this._restoreTarget=e,this._confirmAction="restore"}async _handleRestore(){if(!(!this.rpcClient||!this._restoreTarget)){this._confirmAction=null,this._actionPending=!0;try{await this.rpcClient.call("workspace.git.restore",{agentId:this.agentId,filePath:this._restoreTarget}),o.show("File restored to HEAD","success"),this._restoreTarget=null,await this._loadGitData()}catch(e){o.show(`Failed to restore: ${e instanceof Error?e.message:"Unknown error"}`,"error")}finally{this._actionPending=!1}}}async _handleCommit(){if(!(!this.rpcClient||!this.agentId||this._committing)){this._committing=!0;try{await this.rpcClient.call("workspace.git.commit",{agentId:this.agentId,message:this._commitMessage||void 0}),o.show("Changes committed","success"),this._commitMessage="",await this._loadGitData()}catch(e){o.show(`Commit failed: ${e instanceof Error?e.message:"Unknown error"}`,"error")}finally{this._committing=!1}}}_statusBadge(e){switch(e){case"modified":return"M";case"added":return"A";case"deleted":return"D";case"untracked":return"??";case"renamed":return"R";case"copied":return"C";default:return"?"}}_diffLineClass(e){return e.startsWith("@@")?"diff-hunk":e.startsWith("+")?"diff-add":e.startsWith("-")?"diff-del":"diff-ctx"}get _commitDisabled(){return this._committing||this._gitStatus?.clean===!0}_navigate(e){this.dispatchEvent(new CustomEvent("navigate",{detail:e,bubbles:!0,composed:!0}))}render(){switch(this._loadState){case"loading":return t`<ic-skeleton-view variant="editor"></ic-skeleton-view>`;case"error":return t`
2
- <div class="error-container">
3
- <div class="error-message">${this._error}</div>
4
- <button class="retry-btn" @click=${()=>this._loadStatus()}>Retry</button>
5
- </div>
6
- `;case"loaded":return this._status&&!this._status.exists?this._renderNotInitialized():this._renderWorkspace()}}_renderNotInitialized(){return t`
7
- ${this._renderBreadcrumb()}
8
- <ic-empty-state
9
- message="Workspace not initialized"
10
- icon="folder"
11
- description="Initialize the workspace to manage agent files and configuration."
12
- >
13
- <button
14
- class="btn btn--primary"
15
- ?disabled=${this._actionPending}
16
- @click=${()=>this._handleInit()}
17
- >Init Workspace</button>
18
- </ic-empty-state>
19
- `}_renderWorkspace(){return t`
20
- ${this._renderBreadcrumb()}
21
- ${this._renderStatusBar()}
22
- ${this._renderTabBar()}
23
- ${this._activeTab==="files"?t`
24
- <div class="workspace-layout">
25
- <div class="file-tree">
26
- ${this._renderFileTree()}
27
- </div>
28
- <div class="editor-panel">
29
- ${this._renderEditorPanel()}
30
- </div>
31
- </div>
32
- `:this._renderGitTab()}
33
- `}_renderBreadcrumb(){return t`
34
- <ic-breadcrumb
35
- .items=${[{label:"Agents",route:"agents"},{label:this.agentId,route:`agents/${this.agentId}`},{label:"Workspace"}]}
36
- @navigate=${e=>this._navigate(e.detail)}
37
- ></ic-breadcrumb>
38
- `}_renderStatusBar(){return this._status?t`
39
- <div class="status-bar">
40
- <code>${this._status.dir}</code>
41
- <ic-tag variant=${this._status.hasGitRepo?"success":"default"}>
42
- ${this._status.hasGitRepo?"git repo":"no git"}
43
- </ic-tag>
44
- <ic-tag variant=${this._status.isBootstrapped?"success":"warning"}>
45
- ${this._status.isBootstrapped?"bootstrapped":"onboarding"}
46
- </ic-tag>
47
- </div>
48
- `:d}_renderTabBar(){return t`
49
- <div class="tab-bar">
50
- <button
51
- class="tab-btn ${this._activeTab==="files"?"tab-btn--active":""}"
52
- @click=${()=>{this._activeTab="files",this._confirmAction=null,this._restoreTarget=null}}
53
- >Files</button>
54
- <button
55
- class="tab-btn ${this._activeTab==="git"?"tab-btn--active":""}"
56
- @click=${()=>this._switchToGitTab()}
57
- >Git</button>
58
- </div>
59
- `}_renderFileTree(){return this._status?t`
60
- <div class="tree-section-label">Template Files</div>
61
- ${this._status.files.map(e=>t`
62
- <button
63
- class="tree-item ${this._selectedFile===e.name?"tree-item--active":""}"
64
- @click=${()=>this._selectFile(e.name)}
65
- >
66
- <span class="presence-dot ${e.present?"presence-dot--present":"presence-dot--absent"}"></span>
67
- <span class="file-name">${e.name}</span>
68
- ${e.present&&e.sizeBytes!==void 0?t`<span class="file-size">${p(e.sizeBytes)}</span>`:d}
69
- </button>
70
- `)}
71
- <hr class="tree-separator" />
72
- <div class="tree-section-label">Directories</div>
73
- ${w.map(e=>t`
74
- <button
75
- class="tree-item ${this._selectedSubdir===e?"tree-item--active":""}"
76
- @click=${()=>this._selectSubdir(e)}
77
- >
78
- <span class="folder-icon">\uD83D\uDCC1</span>
79
- <span class="file-name">${e}</span>
80
- </button>
81
- `)}
82
- `:d}_renderEditorPanel(){return this._selectedFile?this._renderFileEditor():this._selectedSubdir?this._renderDirListing():t`
83
- <div class="placeholder-panel">Select a file or directory from the sidebar</div>
84
- `}_renderFileEditor(){return t`
85
- <div class="editor-header">
86
- <span class="editor-filename">${this._selectedFile}</span>
87
- ${this._dirty?t`<span class="dirty-indicator">unsaved</span>`:d}
88
- </div>
89
- <textarea
90
- class="editor-textarea"
91
- .value=${this._editedContent}
92
- @input=${this._onEditorInput}
93
- spellcheck="false"
94
- ></textarea>
95
- <div class="action-bar">
96
- <button
97
- class="btn btn--primary"
98
- ?disabled=${!this._dirty||this._saving}
99
- @click=${()=>this._handleSave()}
100
- >${this._saving?"Saving...":"Save"}</button>
101
- <button
102
- class="btn btn--secondary"
103
- ?disabled=${this._actionPending}
104
- @click=${()=>{this._confirmAction="reset"}}
105
- >Reset to Default</button>
106
- <button
107
- class="btn btn--danger"
108
- ?disabled=${this._actionPending}
109
- @click=${()=>{this._confirmAction="delete"}}
110
- >Delete</button>
111
- </div>
112
-
113
- <ic-confirm-dialog
114
- ?open=${this._confirmAction==="reset"}
115
- title="Reset to Default"
116
- message=${`Reset "${this._selectedFile}" to its default content? Current content will be overwritten.`}
117
- variant="default"
118
- confirmLabel="Reset"
119
- @confirm=${()=>this._handleReset()}
120
- @cancel=${()=>{this._confirmAction=null}}
121
- ></ic-confirm-dialog>
122
-
123
- <ic-confirm-dialog
124
- ?open=${this._confirmAction==="delete"}
125
- title="Delete File"
126
- message=${`Delete "${this._selectedFile}"? This action cannot be undone.`}
127
- variant="danger"
128
- confirmLabel="Delete"
129
- @confirm=${()=>this._handleDelete()}
130
- @cancel=${()=>{this._confirmAction=null}}
131
- ></ic-confirm-dialog>
132
- `}_renderDirListing(){return this._dirEntries.length===0?t`<div class="dir-empty">Empty directory</div>`:t`
133
- <table class="dir-table">
134
- <thead>
135
- <tr>
136
- <th>Name</th>
137
- <th>Type</th>
138
- <th>Size</th>
139
- <th>Modified</th>
140
- </tr>
141
- </thead>
142
- <tbody>
143
- ${this._dirEntries.map(e=>t`
144
- <tr>
145
- <td>${e.name}</td>
146
- <td>${e.type}</td>
147
- <td>${e.sizeBytes!==void 0?p(e.sizeBytes):"-"}</td>
148
- <td>
149
- ${e.modifiedAt?t`<ic-relative-time .timestamp=${e.modifiedAt}></ic-relative-time>`:"-"}
150
- </td>
151
- </tr>
152
- `)}
153
- </tbody>
154
- </table>
155
- `}_renderGitTab(){return this._status?.hasGitRepo?t`
156
- <div class="git-panel">
157
- ${this._renderGitStatus()}
158
- ${this._renderDiffViewer()}
159
- ${this._renderCommitForm()}
160
- ${this._renderCommitLog()}
161
- <ic-confirm-dialog
162
- ?open=${this._confirmAction==="restore"}
163
- title="Restore File"
164
- message=${`Restore "${this._restoreTarget}" to HEAD? Uncommitted changes will be lost.`}
165
- variant="danger"
166
- confirmLabel="Restore"
167
- @confirm=${()=>this._handleRestore()}
168
- @cancel=${()=>{this._confirmAction=null,this._restoreTarget=null}}
169
- ></ic-confirm-dialog>
170
- </div>
171
- `:t`
172
- <ic-empty-state
173
- message="No git repository"
174
- description="Initialize a git repository to track workspace changes."
175
- icon="folder"
176
- ></ic-empty-state>
177
- `}_renderGitStatus(){return this._gitStatus?t`
178
- <div class="git-section">
179
- <div class="git-section-header">
180
- <span>Status</span>
181
- <span class="git-branch">${this._gitStatus.branch}</span>
182
- <span class="git-change-count">${this._gitStatus.entries.length} changes</span>
183
- </div>
184
- ${this._gitStatus.clean?t`<div class="clean-message">Working tree clean</div>`:this._gitStatus.entries.map(e=>{const i=this._statusBadge(e.status),l=i==="??"?"U":i;return t`
185
- <div
186
- class="changed-file ${this._gitDiffFile===e.path?"changed-file--active":""}"
187
- @click=${()=>this._loadFileDiff(e.path)}
188
- >
189
- <span class="status-badge status-badge--${l}">${i}</span>
190
- <span class="changed-file-path">${e.path}</span>
191
- ${e.status!=="untracked"&&e.status!=="added"?t`<button
192
- class="restore-btn"
193
- @click=${c=>{c.stopPropagation(),this._requestRestore(e.path)}}
194
- >Restore</button>`:d}
195
- </div>
196
- `})}
197
- </div>
198
- `:d}_renderDiffViewer(){if(!this._gitDiff)return t`<div class="diff-empty">Select a changed file to view its diff</div>`;const e=this._gitDiff.split(`
199
- `);return t`
200
- <div class="diff-viewer">
201
- <div class="diff-header">${this._gitDiffFile}</div>
202
- <pre class="diff-content">${e.map(i=>t`<span class="${this._diffLineClass(i)}">${i}\n</span>`)}</pre>
203
- </div>
204
- `}_renderCommitForm(){return t`
205
- <div class="git-section">
206
- <div class="git-section-header">Commit</div>
207
- <div class="commit-form">
208
- <input
209
- class="commit-input"
210
- type="text"
211
- placeholder="Commit message (optional)"
212
- .value=${this._commitMessage}
213
- @input=${e=>{this._commitMessage=e.target.value}}
214
- />
215
- <button
216
- class="btn btn--primary"
217
- ?disabled=${this._commitDisabled}
218
- @click=${()=>this._handleCommit()}
219
- >${this._committing?"Committing...":"Commit"}</button>
220
- </div>
221
- </div>
222
- `}_renderCommitLog(){return t`
223
- <div class="git-section">
224
- <div class="git-section-header">Recent Commits</div>
225
- ${this._gitLog.length===0?t`<div class="clean-message">No commits yet</div>`:this._gitLog.map(e=>t`
226
- <div class="commit-entry">
227
- <span class="commit-sha">${e.sha.slice(0,7)}</span>
228
- <span class="commit-message">${e.message}</span>
229
- <span class="commit-time">
230
- <ic-relative-time .timestamp=${new Date(e.date).getTime()}></ic-relative-time>
231
- </span>
232
- </div>
233
- `)}
234
- </div>
235
- `}};r.styles=[u,v,b`
1
+ import{c as e,f as t,h as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./decorate-BvWYovGE.js";import{a as u}from"./index-BBkuC-EU.js";import"./ic-breadcrumb-DqN6G3gc.js";import"./ic-tag-CvMVQFRR.js";import"./ic-confirm-dialog-DGlPbV1T.js";import"./ic-relative-time-B3UAnTqg.js";import"./ic-empty-state-CM3Wbj2f.js";var d=[`projects`,`scripts`,`documents`,`media`,`data`,`output`];function f(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var p=class extends r{constructor(...e){super(...e),this.rpcClient=null,this.agentId=``,this._status=null,this._loadState=`loading`,this._error=``,this._activeTab=`files`,this._selectedFile=null,this._selectedSubdir=null,this._fileContent=``,this._editedContent=``,this._dirEntries=[],this._saving=!1,this._dirty=!1,this._confirmAction=null,this._actionPending=!1,this._gitStatus=null,this._gitLog=[],this._gitDiff=``,this._gitDiffFile=null,this._commitMessage=``,this._committing=!1,this._restoreTarget=null}static{this.styles=[o,i,n`
236
2
  :host {
237
3
  display: block;
238
4
  }
@@ -782,4 +548,238 @@ import{a as g,I as o,b as t,A as d,s as u,f as v,i as b,n as h,r as s,t as _}fro
782
548
  max-height: 250px;
783
549
  }
784
550
  }
785
- `];a([h({attribute:!1})],r.prototype,"rpcClient",2);a([h()],r.prototype,"agentId",2);a([s()],r.prototype,"_status",2);a([s()],r.prototype,"_loadState",2);a([s()],r.prototype,"_error",2);a([s()],r.prototype,"_activeTab",2);a([s()],r.prototype,"_selectedFile",2);a([s()],r.prototype,"_selectedSubdir",2);a([s()],r.prototype,"_fileContent",2);a([s()],r.prototype,"_editedContent",2);a([s()],r.prototype,"_dirEntries",2);a([s()],r.prototype,"_saving",2);a([s()],r.prototype,"_dirty",2);a([s()],r.prototype,"_confirmAction",2);a([s()],r.prototype,"_actionPending",2);a([s()],r.prototype,"_gitStatus",2);a([s()],r.prototype,"_gitLog",2);a([s()],r.prototype,"_gitDiff",2);a([s()],r.prototype,"_gitDiffFile",2);a([s()],r.prototype,"_commitMessage",2);a([s()],r.prototype,"_committing",2);a([s()],r.prototype,"_restoreTarget",2);r=a([_("ic-workspace-manager")],r);export{r as IcWorkspaceManager};
551
+ `]}updated(e){(e.has(`agentId`)||e.has(`rpcClient`))&&this.agentId&&this.rpcClient&&this._loadStatus()}async _loadStatus(){if(!(!this.rpcClient||!this.agentId)){this._loadState=`loading`,this._error=``;try{this._status=await this.rpcClient.call(`workspace.status`,{agentId:this.agentId}),this._loadState=`loaded`}catch(e){this._error=e instanceof Error?e.message:`Failed to load workspace status`,this._loadState=`error`}}}async _selectFile(e){if(this.rpcClient&&!(this._dirty&&!window.confirm(`Discard unsaved changes?`)))try{let t=await this.rpcClient.call(`workspace.readFile`,{agentId:this.agentId,filePath:e});this._selectedFile=e,this._fileContent=t.content,this._editedContent=t.content,this._dirty=!1,this._selectedSubdir=null,this._dirEntries=[]}catch(e){u.show(`Failed to read file: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}}async _selectSubdir(e){if(this.rpcClient&&!(this._dirty&&!window.confirm(`Discard unsaved changes?`)))try{let t=await this.rpcClient.call(`workspace.listDir`,{agentId:this.agentId,subdir:e});this._selectedSubdir=e,this._dirEntries=t.entries,this._selectedFile=null,this._fileContent=``,this._editedContent=``,this._dirty=!1}catch(e){u.show(`Failed to list directory: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}}_onEditorInput(e){let t=e.target;this._editedContent=t.value,this._dirty=this._editedContent!==this._fileContent}async _loadGitData(){if(!(!this.rpcClient||!this.agentId))try{let[e,t]=await Promise.all([this.rpcClient.call(`workspace.git.status`,{agentId:this.agentId}),this.rpcClient.call(`workspace.git.log`,{agentId:this.agentId,limit:20})]);this._gitStatus=e,this._gitLog=t.commits,this._gitDiff=``,this._gitDiffFile=null}catch(e){u.show(`Failed to load git data: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}}async _loadFileDiff(e){if(!(!this.rpcClient||!this.agentId))try{let t=await this.rpcClient.call(`workspace.git.diff`,{agentId:this.agentId,filePath:e});this._gitDiff=t.diff,this._gitDiffFile=e}catch(e){u.show(`Failed to load diff: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}}async _handleSave(){if(!(!this.rpcClient||this._saving||!this._selectedFile)){this._saving=!0;try{await this.rpcClient.call(`workspace.writeFile`,{agentId:this.agentId,filePath:this._selectedFile,content:this._editedContent}),u.show(`File saved`,`success`),this._fileContent=this._editedContent,this._dirty=!1}catch(e){u.show(`Failed to save: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}finally{this._saving=!1}}}async _handleReset(){if(!(!this.rpcClient||!this._selectedFile)){this._confirmAction=null,this._actionPending=!0;try{await this.rpcClient.call(`workspace.resetFile`,{agentId:this.agentId,fileName:this._selectedFile}),u.show(`File reset to default`,`success`),await this._selectFile(this._selectedFile)}catch(e){u.show(`Failed to reset file: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}finally{this._actionPending=!1}}}async _handleDelete(){if(!(!this.rpcClient||!this._selectedFile)){this._confirmAction=null,this._actionPending=!0;try{await this.rpcClient.call(`workspace.deleteFile`,{agentId:this.agentId,filePath:this._selectedFile}),u.show(`File deleted`,`success`),this._selectedFile=null,this._fileContent=``,this._editedContent=``,this._dirty=!1,await this._loadStatus()}catch(e){u.show(`Failed to delete file: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}finally{this._actionPending=!1}}}async _handleInit(){if(this.rpcClient){this._actionPending=!0;try{await this.rpcClient.call(`workspace.init`,{agentId:this.agentId}),u.show(`Workspace initialized`,`success`),await this._loadStatus()}catch(e){u.show(`Failed to initialize workspace: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}finally{this._actionPending=!1}}}_switchToGitTab(){this._activeTab=`git`,this._confirmAction=null,this._restoreTarget=null,this._loadGitData()}_requestRestore(e){this._restoreTarget=e,this._confirmAction=`restore`}async _handleRestore(){if(!(!this.rpcClient||!this._restoreTarget)){this._confirmAction=null,this._actionPending=!0;try{await this.rpcClient.call(`workspace.git.restore`,{agentId:this.agentId,filePath:this._restoreTarget}),u.show(`File restored to HEAD`,`success`),this._restoreTarget=null,await this._loadGitData()}catch(e){u.show(`Failed to restore: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}finally{this._actionPending=!1}}}async _handleCommit(){if(!(!this.rpcClient||!this.agentId||this._committing)){this._committing=!0;try{await this.rpcClient.call(`workspace.git.commit`,{agentId:this.agentId,message:this._commitMessage||void 0}),u.show(`Changes committed`,`success`),this._commitMessage=``,await this._loadGitData()}catch(e){u.show(`Commit failed: ${e instanceof Error?e.message:`Unknown error`}`,`error`)}finally{this._committing=!1}}}_statusBadge(e){switch(e){case`modified`:return`M`;case`added`:return`A`;case`deleted`:return`D`;case`untracked`:return`??`;case`renamed`:return`R`;case`copied`:return`C`;default:return`?`}}_diffLineClass(e){return e.startsWith(`@@`)?`diff-hunk`:e.startsWith(`+`)?`diff-add`:e.startsWith(`-`)?`diff-del`:`diff-ctx`}get _commitDisabled(){return this._committing||this._gitStatus?.clean===!0}_navigate(e){this.dispatchEvent(new CustomEvent(`navigate`,{detail:e,bubbles:!0,composed:!0}))}render(){switch(this._loadState){case`loading`:return t`<ic-skeleton-view variant="editor"></ic-skeleton-view>`;case`error`:return t`
552
+ <div class="error-container">
553
+ <div class="error-message">${this._error}</div>
554
+ <button class="retry-btn" @click=${()=>this._loadStatus()}>Retry</button>
555
+ </div>
556
+ `;case`loaded`:return this._status&&!this._status.exists?this._renderNotInitialized():this._renderWorkspace()}}_renderNotInitialized(){return t`
557
+ ${this._renderBreadcrumb()}
558
+ <ic-empty-state
559
+ message="Workspace not initialized"
560
+ icon="folder"
561
+ description="Initialize the workspace to manage agent files and configuration."
562
+ >
563
+ <button
564
+ class="btn btn--primary"
565
+ ?disabled=${this._actionPending}
566
+ @click=${()=>this._handleInit()}
567
+ >Init Workspace</button>
568
+ </ic-empty-state>
569
+ `}_renderWorkspace(){return t`
570
+ ${this._renderBreadcrumb()}
571
+ ${this._renderStatusBar()}
572
+ ${this._renderTabBar()}
573
+ ${this._activeTab===`files`?t`
574
+ <div class="workspace-layout">
575
+ <div class="file-tree">
576
+ ${this._renderFileTree()}
577
+ </div>
578
+ <div class="editor-panel">
579
+ ${this._renderEditorPanel()}
580
+ </div>
581
+ </div>
582
+ `:this._renderGitTab()}
583
+ `}_renderBreadcrumb(){return t`
584
+ <ic-breadcrumb
585
+ .items=${[{label:`Agents`,route:`agents`},{label:this.agentId,route:`agents/${this.agentId}`},{label:`Workspace`}]}
586
+ @navigate=${e=>this._navigate(e.detail)}
587
+ ></ic-breadcrumb>
588
+ `}_renderStatusBar(){return this._status?t`
589
+ <div class="status-bar">
590
+ <code>${this._status.dir}</code>
591
+ <ic-tag variant=${this._status.hasGitRepo?`success`:`default`}>
592
+ ${this._status.hasGitRepo?`git repo`:`no git`}
593
+ </ic-tag>
594
+ <ic-tag variant=${this._status.isBootstrapped?`success`:`warning`}>
595
+ ${this._status.isBootstrapped?`bootstrapped`:`onboarding`}
596
+ </ic-tag>
597
+ </div>
598
+ `:l}_renderTabBar(){return t`
599
+ <div class="tab-bar">
600
+ <button
601
+ class="tab-btn ${this._activeTab===`files`?`tab-btn--active`:``}"
602
+ @click=${()=>{this._activeTab=`files`,this._confirmAction=null,this._restoreTarget=null}}
603
+ >Files</button>
604
+ <button
605
+ class="tab-btn ${this._activeTab===`git`?`tab-btn--active`:``}"
606
+ @click=${()=>this._switchToGitTab()}
607
+ >Git</button>
608
+ </div>
609
+ `}_renderFileTree(){return this._status?t`
610
+ <div class="tree-section-label">Template Files</div>
611
+ ${this._status.files.map(e=>t`
612
+ <button
613
+ class="tree-item ${this._selectedFile===e.name?`tree-item--active`:``}"
614
+ @click=${()=>this._selectFile(e.name)}
615
+ >
616
+ <span class="presence-dot ${e.present?`presence-dot--present`:`presence-dot--absent`}"></span>
617
+ <span class="file-name">${e.name}</span>
618
+ ${e.present&&e.sizeBytes!==void 0?t`<span class="file-size">${f(e.sizeBytes)}</span>`:l}
619
+ </button>
620
+ `)}
621
+ <hr class="tree-separator" />
622
+ <div class="tree-section-label">Directories</div>
623
+ ${d.map(e=>t`
624
+ <button
625
+ class="tree-item ${this._selectedSubdir===e?`tree-item--active`:``}"
626
+ @click=${()=>this._selectSubdir(e)}
627
+ >
628
+ <span class="folder-icon">\uD83D\uDCC1</span>
629
+ <span class="file-name">${e}</span>
630
+ </button>
631
+ `)}
632
+ `:l}_renderEditorPanel(){return this._selectedFile?this._renderFileEditor():this._selectedSubdir?this._renderDirListing():t`
633
+ <div class="placeholder-panel">Select a file or directory from the sidebar</div>
634
+ `}_renderFileEditor(){return t`
635
+ <div class="editor-header">
636
+ <span class="editor-filename">${this._selectedFile}</span>
637
+ ${this._dirty?t`<span class="dirty-indicator">unsaved</span>`:l}
638
+ </div>
639
+ <textarea
640
+ class="editor-textarea"
641
+ .value=${this._editedContent}
642
+ @input=${this._onEditorInput}
643
+ spellcheck="false"
644
+ ></textarea>
645
+ <div class="action-bar">
646
+ <button
647
+ class="btn btn--primary"
648
+ ?disabled=${!this._dirty||this._saving}
649
+ @click=${()=>this._handleSave()}
650
+ >${this._saving?`Saving...`:`Save`}</button>
651
+ <button
652
+ class="btn btn--secondary"
653
+ ?disabled=${this._actionPending}
654
+ @click=${()=>{this._confirmAction=`reset`}}
655
+ >Reset to Default</button>
656
+ <button
657
+ class="btn btn--danger"
658
+ ?disabled=${this._actionPending}
659
+ @click=${()=>{this._confirmAction=`delete`}}
660
+ >Delete</button>
661
+ </div>
662
+
663
+ <ic-confirm-dialog
664
+ ?open=${this._confirmAction===`reset`}
665
+ title="Reset to Default"
666
+ message=${`Reset "${this._selectedFile}" to its default content? Current content will be overwritten.`}
667
+ variant="default"
668
+ confirmLabel="Reset"
669
+ @confirm=${()=>this._handleReset()}
670
+ @cancel=${()=>{this._confirmAction=null}}
671
+ ></ic-confirm-dialog>
672
+
673
+ <ic-confirm-dialog
674
+ ?open=${this._confirmAction===`delete`}
675
+ title="Delete File"
676
+ message=${`Delete "${this._selectedFile}"? This action cannot be undone.`}
677
+ variant="danger"
678
+ confirmLabel="Delete"
679
+ @confirm=${()=>this._handleDelete()}
680
+ @cancel=${()=>{this._confirmAction=null}}
681
+ ></ic-confirm-dialog>
682
+ `}_renderDirListing(){return this._dirEntries.length===0?t`<div class="dir-empty">Empty directory</div>`:t`
683
+ <table class="dir-table">
684
+ <thead>
685
+ <tr>
686
+ <th>Name</th>
687
+ <th>Type</th>
688
+ <th>Size</th>
689
+ <th>Modified</th>
690
+ </tr>
691
+ </thead>
692
+ <tbody>
693
+ ${this._dirEntries.map(e=>t`
694
+ <tr>
695
+ <td>${e.name}</td>
696
+ <td>${e.type}</td>
697
+ <td>${e.sizeBytes===void 0?`-`:f(e.sizeBytes)}</td>
698
+ <td>
699
+ ${e.modifiedAt?t`<ic-relative-time .timestamp=${e.modifiedAt}></ic-relative-time>`:`-`}
700
+ </td>
701
+ </tr>
702
+ `)}
703
+ </tbody>
704
+ </table>
705
+ `}_renderGitTab(){return this._status?.hasGitRepo?t`
706
+ <div class="git-panel">
707
+ ${this._renderGitStatus()}
708
+ ${this._renderDiffViewer()}
709
+ ${this._renderCommitForm()}
710
+ ${this._renderCommitLog()}
711
+ <ic-confirm-dialog
712
+ ?open=${this._confirmAction===`restore`}
713
+ title="Restore File"
714
+ message=${`Restore "${this._restoreTarget}" to HEAD? Uncommitted changes will be lost.`}
715
+ variant="danger"
716
+ confirmLabel="Restore"
717
+ @confirm=${()=>this._handleRestore()}
718
+ @cancel=${()=>{this._confirmAction=null,this._restoreTarget=null}}
719
+ ></ic-confirm-dialog>
720
+ </div>
721
+ `:t`
722
+ <ic-empty-state
723
+ message="No git repository"
724
+ description="Initialize a git repository to track workspace changes."
725
+ icon="folder"
726
+ ></ic-empty-state>
727
+ `}_renderGitStatus(){return this._gitStatus?t`
728
+ <div class="git-section">
729
+ <div class="git-section-header">
730
+ <span>Status</span>
731
+ <span class="git-branch">${this._gitStatus.branch}</span>
732
+ <span class="git-change-count">${this._gitStatus.entries.length} changes</span>
733
+ </div>
734
+ ${this._gitStatus.clean?t`<div class="clean-message">Working tree clean</div>`:this._gitStatus.entries.map(e=>{let n=this._statusBadge(e.status),r=n===`??`?`U`:n;return t`
735
+ <div
736
+ class="changed-file ${this._gitDiffFile===e.path?`changed-file--active`:``}"
737
+ @click=${()=>this._loadFileDiff(e.path)}
738
+ >
739
+ <span class="status-badge status-badge--${r}">${n}</span>
740
+ <span class="changed-file-path">${e.path}</span>
741
+ ${e.status!==`untracked`&&e.status!==`added`?t`<button
742
+ class="restore-btn"
743
+ @click=${t=>{t.stopPropagation(),this._requestRestore(e.path)}}
744
+ >Restore</button>`:l}
745
+ </div>
746
+ `})}
747
+ </div>
748
+ `:l}_renderDiffViewer(){if(!this._gitDiff)return t`<div class="diff-empty">Select a changed file to view its diff</div>`;let e=this._gitDiff.split(`
749
+ `);return t`
750
+ <div class="diff-viewer">
751
+ <div class="diff-header">${this._gitDiffFile}</div>
752
+ <pre class="diff-content">${e.map(e=>t`<span class="${this._diffLineClass(e)}">${e}\n</span>`)}</pre>
753
+ </div>
754
+ `}_renderCommitForm(){return t`
755
+ <div class="git-section">
756
+ <div class="git-section-header">Commit</div>
757
+ <div class="commit-form">
758
+ <input
759
+ class="commit-input"
760
+ type="text"
761
+ placeholder="Commit message (optional)"
762
+ .value=${this._commitMessage}
763
+ @input=${e=>{this._commitMessage=e.target.value}}
764
+ />
765
+ <button
766
+ class="btn btn--primary"
767
+ ?disabled=${this._commitDisabled}
768
+ @click=${()=>this._handleCommit()}
769
+ >${this._committing?`Committing...`:`Commit`}</button>
770
+ </div>
771
+ </div>
772
+ `}_renderCommitLog(){return t`
773
+ <div class="git-section">
774
+ <div class="git-section-header">Recent Commits</div>
775
+ ${this._gitLog.length===0?t`<div class="clean-message">No commits yet</div>`:this._gitLog.map(e=>t`
776
+ <div class="commit-entry">
777
+ <span class="commit-sha">${e.sha.slice(0,7)}</span>
778
+ <span class="commit-message">${e.message}</span>
779
+ <span class="commit-time">
780
+ <ic-relative-time .timestamp=${new Date(e.date).getTime()}></ic-relative-time>
781
+ </span>
782
+ </div>
783
+ `)}
784
+ </div>
785
+ `}};c([s({attribute:!1})],p.prototype,`rpcClient`,void 0),c([s()],p.prototype,`agentId`,void 0),c([a()],p.prototype,`_status`,void 0),c([a()],p.prototype,`_loadState`,void 0),c([a()],p.prototype,`_error`,void 0),c([a()],p.prototype,`_activeTab`,void 0),c([a()],p.prototype,`_selectedFile`,void 0),c([a()],p.prototype,`_selectedSubdir`,void 0),c([a()],p.prototype,`_fileContent`,void 0),c([a()],p.prototype,`_editedContent`,void 0),c([a()],p.prototype,`_dirEntries`,void 0),c([a()],p.prototype,`_saving`,void 0),c([a()],p.prototype,`_dirty`,void 0),c([a()],p.prototype,`_confirmAction`,void 0),c([a()],p.prototype,`_actionPending`,void 0),c([a()],p.prototype,`_gitStatus`,void 0),c([a()],p.prototype,`_gitLog`,void 0),c([a()],p.prototype,`_gitDiff`,void 0),c([a()],p.prototype,`_gitDiffFile`,void 0),c([a()],p.prototype,`_commitMessage`,void 0),c([a()],p.prototype,`_committing`,void 0),c([a()],p.prototype,`_restoreTarget`,void 0),p=c([e(`ic-workspace-manager`)],p);export{p as IcWorkspaceManager};
@@ -8,8 +8,9 @@
8
8
  <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png" />
9
9
  <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png" />
10
10
  <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png" />
11
- <script type="module" crossorigin src="/app/assets/index-CEcM1R_C.js"></script>
12
- <link rel="stylesheet" crossorigin href="/app/assets/index-CIJFuItj.css">
11
+ <script type="module" crossorigin src="/app/assets/index-BBkuC-EU.js"></script>
12
+ <link rel="modulepreload" crossorigin href="/app/assets/decorate-BvWYovGE.js">
13
+ <link rel="stylesheet" crossorigin href="/app/assets/index-CVEaS9aY.css">
13
14
  </head>
14
15
  <body style="background: var(--ic-bg); color: var(--ic-text);" class="min-h-screen">
15
16
  <ic-app></ic-app>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comis/web",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "Web dashboard SPA for Comis agent management",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comisai",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "author": "Moshe Anconina",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Security-first AI agent platform — connects AI agents to Discord, Telegram, Slack, WhatsApp, and more",
@@ -111,23 +111,23 @@
111
111
  "@comis/web"
112
112
  ],
113
113
  "dependencies": {
114
- "@comis/shared": "1.0.24",
115
- "@comis/core": "1.0.24",
116
- "@comis/infra": "1.0.24",
117
- "@comis/memory": "1.0.24",
118
- "@comis/gateway": "1.0.24",
119
- "@comis/skills": "1.0.24",
120
- "@comis/scheduler": "1.0.24",
121
- "@comis/agent": "1.0.24",
122
- "@comis/channels": "1.0.24",
123
- "@comis/cli": "1.0.24",
124
- "@comis/daemon": "1.0.24",
125
- "@comis/web": "1.0.24",
114
+ "@comis/shared": "1.0.26",
115
+ "@comis/core": "1.0.26",
116
+ "@comis/infra": "1.0.26",
117
+ "@comis/memory": "1.0.26",
118
+ "@comis/gateway": "1.0.26",
119
+ "@comis/skills": "1.0.26",
120
+ "@comis/scheduler": "1.0.26",
121
+ "@comis/agent": "1.0.26",
122
+ "@comis/channels": "1.0.26",
123
+ "@comis/cli": "1.0.26",
124
+ "@comis/daemon": "1.0.26",
125
+ "@comis/web": "1.0.26",
126
126
  "@agentclientprotocol/sdk": "^0.19.0",
127
127
  "@clack/core": "^1.1.0",
128
128
  "@clack/prompts": "^1.1.0",
129
129
  "@elevenlabs/elevenlabs-js": "^2.38.1",
130
- "@fal-ai/client": "1.9.5",
130
+ "@fal-ai/client": "1.9.6",
131
131
  "@google/genai": "1.50.1",
132
132
  "@grammyjs/auto-retry": "^2.0.2",
133
133
  "@grammyjs/files": "^1.2.0",
@@ -193,7 +193,7 @@
193
193
  "sd-notify": "^2.8.0"
194
194
  },
195
195
  "devDependencies": {
196
- "typescript": "^5.9.3"
196
+ "typescript": "5.9.3"
197
197
  },
198
198
  "scripts": {
199
199
  "build": "tsc"
@@ -1,19 +0,0 @@
1
- /**
2
- * Agents List Tool: List all available agent IDs.
3
- *
4
- * Delegates to the daemon-side agents.list RPC method to retrieve
5
- * the configured agent identifiers in the system.
6
- *
7
- * @module
8
- */
9
- import type { AgentTool } from "@mariozechner/pi-agent-core";
10
- import type { RpcCall } from "./memory-search-tool.js";
11
- declare const AgentsListParams: import("@sinclair/typebox").TObject<{}>;
12
- /**
13
- * Create an agents list tool that lists all available agent IDs.
14
- *
15
- * @param rpcCall - RPC function for daemon communication
16
- * @returns AgentTool implementing agents_list
17
- */
18
- export declare function createAgentsListTool(rpcCall: RpcCall): AgentTool<typeof AgentsListParams>;
19
- export {};
@@ -1,39 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- /**
3
- * Agents List Tool: List all available agent IDs.
4
- *
5
- * Delegates to the daemon-side agents.list RPC method to retrieve
6
- * the configured agent identifiers in the system.
7
- *
8
- * @module
9
- */
10
- import { Type } from "@sinclair/typebox";
11
- import { jsonResult } from "./tool-helpers.js";
12
- // ── Parameter Schema ────────────────────────────────────────────────
13
- const AgentsListParams = Type.Object({});
14
- // ── Factory ─────────────────────────────────────────────────────────
15
- /**
16
- * Create an agents list tool that lists all available agent IDs.
17
- *
18
- * @param rpcCall - RPC function for daemon communication
19
- * @returns AgentTool implementing agents_list
20
- */
21
- export function createAgentsListTool(rpcCall) {
22
- return {
23
- name: "agents_list",
24
- label: "Agents List",
25
- description: "List all available agent IDs configured in the system.",
26
- parameters: AgentsListParams,
27
- async execute(_toolCallId, _params) {
28
- try {
29
- const result = await rpcCall("agents.list", {});
30
- return jsonResult(result);
31
- }
32
- catch (err) {
33
- if (err instanceof Error && err.message.startsWith("["))
34
- throw err;
35
- throw err instanceof Error ? err : new Error(String(err));
36
- }
37
- },
38
- };
39
- }