codexmate 0.1.31 → 0.1.32

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 (43) hide show
  1. package/README.md +3 -3
  2. package/README.vi.md +3 -3
  3. package/README.zh.md +3 -3
  4. package/cli/agents-files.js +18 -4
  5. package/cli/plugin-config.js +64 -0
  6. package/cli/prompt-history.js +17 -4
  7. package/cli/system-prompt-files.js +7 -2
  8. package/cli.js +36 -2
  9. package/lib/cli-config-engine.js +9 -3
  10. package/lib/session-context-health.js +82 -0
  11. package/lib/session-context-records.js +153 -0
  12. package/lib/web-startup-auth.js +5 -1
  13. package/package.json +1 -1
  14. package/plugins/prompt-templates/computed.mjs +3 -3
  15. package/plugins/prompt-templates/invocation.mjs +73 -0
  16. package/plugins/prompt-templates/methods.mjs +48 -3
  17. package/plugins/prompt-templates/overview.mjs +2 -0
  18. package/web-ui/app.js +25 -0
  19. package/web-ui/index.html +1 -0
  20. package/web-ui/logic.context-health.mjs +144 -0
  21. package/web-ui/modules/app.computed.prompts.mjs +11 -0
  22. package/web-ui/modules/app.methods.agents.mjs +20 -3
  23. package/web-ui/modules/app.methods.index.mjs +4 -0
  24. package/web-ui/modules/app.methods.system-prompt.mjs +17 -2
  25. package/web-ui/modules/context-health.methods.mjs +70 -0
  26. package/web-ui/modules/i18n/locales/en.mjs +33 -0
  27. package/web-ui/modules/i18n/locales/ja.mjs +33 -0
  28. package/web-ui/modules/i18n/locales/vi.mjs +33 -0
  29. package/web-ui/modules/i18n/locales/zh-tw.mjs +33 -0
  30. package/web-ui/modules/i18n/locales/zh.mjs +33 -0
  31. package/web-ui/modules/plugins.methods.mjs +2 -0
  32. package/web-ui/modules/prompt-ecosystem.methods.mjs +136 -0
  33. package/web-ui/partials/index/context-health.html +45 -0
  34. package/web-ui/partials/index/modal-prompt-invocation.html +17 -0
  35. package/web-ui/partials/index/panel-plugins.html +37 -9
  36. package/web-ui/partials/index/panel-prompts.html +18 -2
  37. package/web-ui/partials/index/panel-sessions.html +14 -11
  38. package/web-ui/res/web-ui-render.precompiled.js +682 -32
  39. package/web-ui/styles/context-health.css +107 -0
  40. package/web-ui/styles/prompts-editor.css +23 -0
  41. package/web-ui/styles/sessions-preview.css +21 -0
  42. package/web-ui/styles/sub-tabs.css +181 -0
  43. package/web-ui/styles.css +2 -0
@@ -1,5 +1,5 @@
1
1
  window.__CODEXMATE_WEB_UI_RENDER__ = (() => {
2
- const { toDisplayString: _toDisplayString, openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode, createTextVNode: _createTextVNode, createElementVNode: _createElementVNode, normalizeClass: _normalizeClass, withModifiers: _withModifiers, withKeys: _withKeys, renderList: _renderList, Fragment: _Fragment, vModelSelect: _vModelSelect, withDirectives: _withDirectives, vModelText: _vModelText, vModelCheckbox: _vModelCheckbox, vShow: _vShow, Teleport: _Teleport, createBlock: _createBlock, vModelDynamic: _vModelDynamic, isMemoSame: _isMemoSame, withMemo: _withMemo, normalizeStyle: _normalizeStyle } = Vue
2
+ const { toDisplayString: _toDisplayString, openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode, createTextVNode: _createTextVNode, createElementVNode: _createElementVNode, normalizeClass: _normalizeClass, withModifiers: _withModifiers, withKeys: _withKeys, renderList: _renderList, Fragment: _Fragment, vModelSelect: _vModelSelect, withDirectives: _withDirectives, vModelText: _vModelText, vModelCheckbox: _vModelCheckbox, vShow: _vShow, Teleport: _Teleport, createBlock: _createBlock, vModelDynamic: _vModelDynamic, normalizeStyle: _normalizeStyle, isMemoSame: _isMemoSame, withMemo: _withMemo } = Vue
3
3
 
4
4
  return function render(_ctx, _cache) {
5
5
  return (_openBlock(), _createElementBlock(_Fragment, null, [
@@ -4170,6 +4170,208 @@ return function render(_ctx, _cache) {
4170
4170
  ? (_openBlock(), _createElementBlock("span", { key: 0 }, " · " + _toDisplayString(_ctx.sessionStandaloneSourceLabel), 1 /* TEXT */))
4171
4171
  : _createCommentVNode("v-if", true)
4172
4172
  ]),
4173
+ (_ctx.activeSession)
4174
+ ? (_openBlock(), _createElementBlock("section", {
4175
+ key: 0,
4176
+ class: "context-health",
4177
+ "aria-labelledby": "context-health-heading",
4178
+ "aria-busy": _ctx.sessionContextHealthLoading,
4179
+ onVnodeMounted: $event => (_ctx.loadSessionContextHealth()),
4180
+ onVnodeUpdated: $event => (_ctx.loadSessionContextHealth())
4181
+ }, [
4182
+ _createElementVNode("div", { class: "context-health-header" }, [
4183
+ _createElementVNode("div", { class: "context-health-heading" }, [
4184
+ _createElementVNode("h3", {
4185
+ id: "context-health-heading",
4186
+ class: "context-health-title"
4187
+ }, _toDisplayString(_ctx.t('contextHealth.title')), 1 /* TEXT */),
4188
+ (_ctx.sessionContextHealth)
4189
+ ? (_openBlock(), _createElementBlock("span", {
4190
+ key: 0,
4191
+ class: _normalizeClass(['context-health-rating', _ctx.sessionContextHealth.health]),
4192
+ role: "img",
4193
+ "aria-label": _ctx.t('contextHealth.level.' + _ctx.sessionContextHealth.health)
4194
+ }, null, 10 /* CLASS, PROPS */, ["aria-label"]))
4195
+ : _createCommentVNode("v-if", true),
4196
+ (_ctx.sessionContextHealth)
4197
+ ? (_openBlock(), _createElementBlock("p", {
4198
+ key: 1,
4199
+ class: "context-health-meta"
4200
+ }, _toDisplayString(_ctx.sessionContextHealth.messageCount.toLocaleString()) + " " + _toDisplayString(_ctx.t('contextHealth.nodes')), 1 /* TEXT */))
4201
+ : (_ctx.sessionContextHealthLoading)
4202
+ ? (_openBlock(), _createElementBlock("p", {
4203
+ key: 2,
4204
+ class: "context-health-meta",
4205
+ role: "status"
4206
+ }, _toDisplayString(_ctx.t('contextHealth.loading')), 1 /* TEXT */))
4207
+ : _createCommentVNode("v-if", true)
4208
+ ]),
4209
+ (_ctx.sessionContextHealth)
4210
+ ? (_openBlock(), _createElementBlock("div", {
4211
+ key: 0,
4212
+ class: "context-health-summary"
4213
+ }, [
4214
+ _createElementVNode("span", { class: "context-health-total mono" }, [
4215
+ _createTextVNode("≈ " + _toDisplayString(_ctx.sessionContextHealth.totalEstimatedTokens.toLocaleString()) + " ", 1 /* TEXT */),
4216
+ _createElementVNode("small", null, "Token")
4217
+ ])
4218
+ ]))
4219
+ : (_ctx.sessionContextHealthLoading)
4220
+ ? (_openBlock(), _createElementBlock("div", {
4221
+ key: 1,
4222
+ class: "context-health-summary context-health-summary-skeleton",
4223
+ "aria-hidden": "true"
4224
+ }, [
4225
+ _createElementVNode("span")
4226
+ ]))
4227
+ : _createCommentVNode("v-if", true),
4228
+ _createElementVNode("button", {
4229
+ type: "button",
4230
+ class: "btn-mini context-health-refresh",
4231
+ onClick: $event => (_ctx.loadSessionContextHealth(true)),
4232
+ disabled: _ctx.sessionContextHealthLoading,
4233
+ "aria-label": _ctx.t('common.refresh'),
4234
+ title: _ctx.t('common.refresh')
4235
+ }, [
4236
+ (_openBlock(), _createElementBlock("svg", {
4237
+ width: "16",
4238
+ height: "16",
4239
+ viewBox: "0 0 24 24",
4240
+ fill: "none",
4241
+ stroke: "currentColor",
4242
+ "stroke-width": "1.75",
4243
+ "stroke-linecap": "round",
4244
+ "stroke-linejoin": "round",
4245
+ "aria-hidden": "true"
4246
+ }, [
4247
+ _createElementVNode("path", { d: "M20 7v5h-5M4 17v-5h5" }),
4248
+ _createElementVNode("path", { d: "M6.1 7a7 7 0 0 1 11.5-1.3L20 8M4 16l2.4 2.3A7 7 0 0 0 17.9 17" })
4249
+ ]))
4250
+ ], 8 /* PROPS */, ["onClick", "disabled", "aria-label", "title"])
4251
+ ]),
4252
+ _createElementVNode("div", {
4253
+ class: "context-health-bar",
4254
+ role: "img",
4255
+ "aria-label": _ctx.t('contextHealth.composition')
4256
+ }, [
4257
+ (_ctx.sessionContextHealth)
4258
+ ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(_ctx.sessionContextHealth.categories, (part) => {
4259
+ return _withDirectives((_openBlock(), _createElementBlock("span", {
4260
+ key: part.id,
4261
+ class: _normalizeClass(['context-health-segment', part.id]),
4262
+ style: _normalizeStyle({ flexGrow: part.estimatedTokens }),
4263
+ title: _ctx.t('contextHealth.category.' + part.id) + ': ≈ ' + part.estimatedTokens + ' Token (' + part.percentage.toFixed(2) + '%)',
4264
+ "aria-label": _ctx.t('contextHealth.category.' + part.id) + ': ' + part.percentage.toFixed(2) + '%'
4265
+ }, null, 14 /* CLASS, STYLE, PROPS */, ["title", "aria-label"])), [
4266
+ [_vShow, part.estimatedTokens > 0]
4267
+ ])
4268
+ }), 128 /* KEYED_FRAGMENT */))
4269
+ : _createCommentVNode("v-if", true)
4270
+ ], 8 /* PROPS */, ["aria-label"]),
4271
+ (_ctx.sessionContextHealthError)
4272
+ ? (_openBlock(), _createElementBlock("p", {
4273
+ key: 0,
4274
+ class: "form-error context-health-error",
4275
+ role: "alert"
4276
+ }, _toDisplayString(_ctx.sessionContextHealthError), 1 /* TEXT */))
4277
+ : _createCommentVNode("v-if", true),
4278
+ (_ctx.sessionContextHealth)
4279
+ ? (_openBlock(), _createElementBlock("div", {
4280
+ key: 1,
4281
+ id: "context-health-details",
4282
+ class: "context-health-details"
4283
+ }, [
4284
+ _createElementVNode("dl", { class: "context-health-legend" }, [
4285
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.sessionContextHealth.categories, (part) => {
4286
+ return (_openBlock(), _createElementBlock("div", {
4287
+ key: part.id
4288
+ }, [
4289
+ _createElementVNode("dt", null, [
4290
+ _createElementVNode("span", {
4291
+ class: _normalizeClass(['context-health-dot', part.id]),
4292
+ "aria-hidden": "true"
4293
+ }, null, 2 /* CLASS */),
4294
+ _createTextVNode(_toDisplayString(_ctx.t('contextHealth.category.' + part.id)), 1 /* TEXT */)
4295
+ ]),
4296
+ _createElementVNode("dd", null, [
4297
+ _createElementVNode("span", { class: "context-health-category-tokens mono" }, "≈ " + _toDisplayString(part.estimatedTokens.toLocaleString()), 1 /* TEXT */),
4298
+ _createElementVNode("span", { class: "context-health-category-share mono" }, _toDisplayString(part.percentage.toFixed(2)) + "%", 1 /* TEXT */)
4299
+ ])
4300
+ ]))
4301
+ }), 128 /* KEYED_FRAGMENT */))
4302
+ ]),
4303
+ (!_ctx.sessionContextHealth.messageCount)
4304
+ ? (_openBlock(), _createElementBlock("p", {
4305
+ key: 0,
4306
+ class: "context-health-note"
4307
+ }, _toDisplayString(_ctx.t('contextHealth.empty')), 1 /* TEXT */))
4308
+ : _createCommentVNode("v-if", true)
4309
+ ]))
4310
+ : (_ctx.sessionContextHealthLoading)
4311
+ ? (_openBlock(), _createElementBlock("dl", {
4312
+ key: 2,
4313
+ class: "context-health-legend context-health-loading",
4314
+ "aria-hidden": "true"
4315
+ }, [
4316
+ (_openBlock(), _createElementBlock(_Fragment, null, _renderList(['system', 'user', 'assistant', 'tools', 'code'], (part) => {
4317
+ return _createElementVNode("div", {
4318
+ key: part,
4319
+ class: "context-health-loading-row"
4320
+ }, [
4321
+ _createElementVNode("dt", null, [
4322
+ _createElementVNode("span", {
4323
+ class: _normalizeClass(['context-health-dot', part]),
4324
+ "aria-hidden": "true"
4325
+ }, null, 2 /* CLASS */),
4326
+ _createTextVNode(_toDisplayString(_ctx.t('contextHealth.category.' + part)), 1 /* TEXT */)
4327
+ ]),
4328
+ _createElementVNode("dd", null, [
4329
+ _createElementVNode("span", { class: "context-health-value-skeleton" }),
4330
+ _createElementVNode("span", { class: "context-health-share-skeleton" })
4331
+ ])
4332
+ ])
4333
+ }), 64 /* STABLE_FRAGMENT */))
4334
+ ]))
4335
+ : _createCommentVNode("v-if", true)
4336
+ ], 8 /* PROPS */, ["aria-busy", "onVnodeMounted", "onVnodeUpdated"]))
4337
+ : _createCommentVNode("v-if", true),
4338
+ (_ctx.sessionContextHealthFocusedNode)
4339
+ ? (_openBlock(), _createElementBlock("article", {
4340
+ key: 1,
4341
+ ref: "contextHealthFocusedMessage",
4342
+ class: "context-health-focused-message",
4343
+ tabindex: "-1",
4344
+ "data-context-node-id": _ctx.sessionContextHealthFocusedNode.id,
4345
+ "aria-label": _ctx.t('contextHealth.message')
4346
+ }, [
4347
+ _createElementVNode("header", null, [
4348
+ _createElementVNode("div", null, [
4349
+ _createElementVNode("strong", null, _toDisplayString(_ctx.t('contextHealth.message')), 1 /* TEXT */),
4350
+ _createElementVNode("span", { class: "context-health-meta mono" }, _toDisplayString(_ctx.sessionContextHealthFocusedNode.id), 1 /* TEXT */)
4351
+ ]),
4352
+ _createElementVNode("button", {
4353
+ type: "button",
4354
+ class: "btn-mini context-health-refresh",
4355
+ onClick: $event => (_ctx.sessionContextHealthFocusedNode = null),
4356
+ "aria-label": _ctx.t('common.close')
4357
+ }, [
4358
+ (_openBlock(), _createElementBlock("svg", {
4359
+ width: "16",
4360
+ height: "16",
4361
+ viewBox: "0 0 24 24",
4362
+ fill: "none",
4363
+ stroke: "currentColor",
4364
+ "stroke-width": "1.75",
4365
+ "stroke-linecap": "round",
4366
+ "aria-hidden": "true"
4367
+ }, [
4368
+ _createElementVNode("path", { d: "m6 6 12 12M18 6 6 18" })
4369
+ ]))
4370
+ ], 8 /* PROPS */, ["onClick", "aria-label"])
4371
+ ]),
4372
+ _createElementVNode("pre", null, _toDisplayString(_ctx.sessionContextHealthFocusedNode.text), 1 /* TEXT */)
4373
+ ], 8 /* PROPS */, ["data-context-node-id", "aria-label"]))
4374
+ : _createCommentVNode("v-if", true),
4173
4375
  _createElementVNode("pre", { class: "session-standalone-text" }, _toDisplayString(_ctx.sessionStandaloneText), 1 /* TEXT */)
4174
4376
  ]))
4175
4377
  ]))
@@ -4824,12 +5026,15 @@ return function render(_ctx, _cache) {
4824
5026
  _createElementVNode("div", { class: "session-secondary-actions" }, [
4825
5027
  _createElementVNode("button", {
4826
5028
  class: "btn-session-refresh has-label session-action-optional-label",
5029
+ "data-icon-only": "true",
4827
5030
  onClick: _ctx.loadActiveSessionDetail,
4828
5031
  disabled: _ctx.sessionDetailLoading || !_ctx.activeSession,
4829
5032
  title: _ctx.sessionDetailLoading ? _ctx.t('sessions.preview.loading') : _ctx.t('sessions.preview.refresh'),
4830
5033
  "aria-label": _ctx.sessionDetailLoading ? _ctx.t('sessions.preview.loading') : _ctx.t('sessions.preview.refresh')
4831
5034
  }, [
4832
5035
  (_openBlock(), _createElementBlock("svg", {
5036
+ "aria-hidden": "true",
5037
+ focusable: "false",
4833
5038
  viewBox: "0 0 16 16",
4834
5039
  fill: "none",
4835
5040
  stroke: "currentColor",
@@ -4842,7 +5047,11 @@ return function render(_ctx, _cache) {
4842
5047
  _createElementVNode("polyline", { points: "2.5 2 2.5 5 5.5 5" }),
4843
5048
  _createElementVNode("polyline", { points: "13.5 14 13.5 11 10.5 11" })
4844
5049
  ])),
4845
- _createElementVNode("span", { class: "session-action-label session-action-optional-text" }, _toDisplayString(_ctx.t('sessions.preview.refresh')), 1 /* TEXT */)
5050
+ _createElementVNode("span", {
5051
+ class: "session-action-label session-action-optional-text",
5052
+ hidden: "",
5053
+ "aria-hidden": "true"
5054
+ }, _toDisplayString(_ctx.t('sessions.preview.refresh')), 1 /* TEXT */)
4846
5055
  ], 8 /* PROPS */, ["onClick", "disabled", "title", "aria-label"]),
4847
5056
  _createElementVNode("div", { class: "session-link-group" }, [
4848
5057
  _createElementVNode("button", {
@@ -4888,12 +5097,15 @@ return function render(_ctx, _cache) {
4888
5097
  ]),
4889
5098
  _createElementVNode("button", {
4890
5099
  class: "btn-session-open has-label session-action-optional-label",
5100
+ "data-icon-only": "true",
4891
5101
  onClick: $event => (_ctx.copySessionPath(_ctx.activeSession)),
4892
5102
  disabled: !_ctx.activeSession || !_ctx.getSessionFilePath(_ctx.activeSession),
4893
5103
  title: _ctx.t('sessions.preview.copyPath'),
4894
5104
  "aria-label": _ctx.t('sessions.preview.copyPath')
4895
5105
  }, [
4896
5106
  (_openBlock(), _createElementBlock("svg", {
5107
+ "aria-hidden": "true",
5108
+ focusable: "false",
4897
5109
  viewBox: "0 0 16 16",
4898
5110
  fill: "none",
4899
5111
  stroke: "currentColor",
@@ -4903,18 +5115,25 @@ return function render(_ctx, _cache) {
4903
5115
  }, [
4904
5116
  _createElementVNode("path", { d: "M2 5.5V12.5a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V7.5a1 1 0 0 0-1-1H8L6.5 5H3a1 1 0 0 0-1 1z" })
4905
5117
  ])),
4906
- _createElementVNode("span", { class: "session-action-label session-action-optional-text" }, _toDisplayString(_ctx.t('sessions.preview.copyPath')), 1 /* TEXT */)
5118
+ _createElementVNode("span", {
5119
+ class: "session-action-label session-action-optional-text",
5120
+ hidden: "",
5121
+ "aria-hidden": "true"
5122
+ }, _toDisplayString(_ctx.t('sessions.preview.copyPath')), 1 /* TEXT */)
4907
5123
  ], 8 /* PROPS */, ["onClick", "disabled", "title", "aria-label"])
4908
5124
  ]),
4909
5125
  _createElementVNode("div", { class: "session-primary-actions" }, [
4910
5126
  _createElementVNode("button", {
4911
5127
  class: "btn-session-export has-label",
5128
+ "data-icon-only": "true",
4912
5129
  onClick: $event => (_ctx.exportSession(_ctx.activeSession)),
4913
5130
  disabled: !_ctx.activeSession || _ctx.sessionExporting[_ctx.getSessionExportKey(_ctx.activeSession)],
4914
5131
  title: (_ctx.activeSession && _ctx.sessionExporting[_ctx.getSessionExportKey(_ctx.activeSession)]) ? _ctx.t('sessions.preview.exporting') : _ctx.t('sessions.preview.export'),
4915
5132
  "aria-label": (_ctx.activeSession && _ctx.sessionExporting[_ctx.getSessionExportKey(_ctx.activeSession)]) ? _ctx.t('sessions.preview.exporting') : _ctx.t('sessions.preview.export')
4916
5133
  }, [
4917
5134
  (_openBlock(), _createElementBlock("svg", {
5135
+ "aria-hidden": "true",
5136
+ focusable: "false",
4918
5137
  viewBox: "0 0 16 16",
4919
5138
  fill: "none",
4920
5139
  stroke: "currentColor",
@@ -4926,23 +5145,247 @@ return function render(_ctx, _cache) {
4926
5145
  _createElementVNode("polyline", { points: "4 7 8 10.5 12 7" }),
4927
5146
  _createElementVNode("path", { d: "M2.5 12v1.5a1 1 0 0 0 1 1h9a1 1 0 0 0 1-1V12" })
4928
5147
  ])),
4929
- _createElementVNode("span", { class: "session-action-label" }, _toDisplayString((_ctx.activeSession && _ctx.sessionExporting[_ctx.getSessionExportKey(_ctx.activeSession)]) ? _ctx.t('sessions.preview.exporting') : _ctx.t('sessions.preview.export')), 1 /* TEXT */)
5148
+ _createElementVNode("span", {
5149
+ class: "session-action-label",
5150
+ hidden: "",
5151
+ "aria-hidden": "true"
5152
+ }, _toDisplayString((_ctx.activeSession && _ctx.sessionExporting[_ctx.getSessionExportKey(_ctx.activeSession)]) ? _ctx.t('sessions.preview.exporting') : _ctx.t('sessions.preview.export')), 1 /* TEXT */)
4930
5153
  ], 8 /* PROPS */, ["onClick", "disabled", "title", "aria-label"]),
4931
5154
  (_ctx.isDeleteAvailable(_ctx.activeSession))
4932
5155
  ? (_openBlock(), _createElementBlock("button", {
4933
5156
  key: 0,
4934
5157
  class: "btn-session-delete has-label session-delete-text-button",
5158
+ "data-icon-only": "true",
4935
5159
  onClick: $event => (_ctx.deleteSession(_ctx.activeSession)),
4936
5160
  disabled: !_ctx.activeSession || _ctx.sessionsLoading || _ctx.sessionDeleting[_ctx.getSessionExportKey(_ctx.activeSession)],
4937
5161
  title: (_ctx.activeSession && _ctx.sessionDeleting[_ctx.getSessionExportKey(_ctx.activeSession)]) ? (_ctx.sessionTrashEnabled === false ? _ctx.t('sessions.preview.deleting') : _ctx.t('sessions.preview.moving')) : (_ctx.sessionTrashEnabled === false ? _ctx.t('sessions.preview.deleteHard') : _ctx.t('sessions.preview.moveToTrash')),
4938
5162
  "aria-label": (_ctx.activeSession && _ctx.sessionDeleting[_ctx.getSessionExportKey(_ctx.activeSession)]) ? (_ctx.sessionTrashEnabled === false ? _ctx.t('sessions.preview.deleting') : _ctx.t('sessions.preview.moving')) : (_ctx.sessionTrashEnabled === false ? _ctx.t('sessions.preview.deleteHard') : _ctx.t('sessions.preview.moveToTrash'))
4939
5163
  }, [
4940
- _createElementVNode("span", { class: "session-action-label" }, _toDisplayString((_ctx.activeSession && _ctx.sessionDeleting[_ctx.getSessionExportKey(_ctx.activeSession)]) ? (_ctx.sessionTrashEnabled === false ? _ctx.t('sessions.preview.deleting') : _ctx.t('sessions.preview.moving')) : (_ctx.sessionTrashEnabled === false ? _ctx.t('sessions.preview.deleteHard') : _ctx.t('sessions.preview.moveToTrash'))), 1 /* TEXT */)
5164
+ (_openBlock(), _createElementBlock("svg", {
5165
+ viewBox: "0 0 16 16",
5166
+ fill: "none",
5167
+ stroke: "currentColor",
5168
+ "stroke-width": "1.8",
5169
+ "stroke-linecap": "round",
5170
+ "stroke-linejoin": "round",
5171
+ "aria-hidden": "true",
5172
+ focusable: "false"
5173
+ }, [
5174
+ _createElementVNode("path", { d: "M2.5 4.5h11M6 4.5V2.5h4v2" }),
5175
+ _createElementVNode("path", { d: "m4 4.5 .5 9h7l.5-9M6.5 7v4M9.5 7v4" })
5176
+ ])),
5177
+ _createElementVNode("span", {
5178
+ class: "session-action-label",
5179
+ hidden: "",
5180
+ "aria-hidden": "true"
5181
+ }, _toDisplayString((_ctx.activeSession && _ctx.sessionDeleting[_ctx.getSessionExportKey(_ctx.activeSession)]) ? (_ctx.sessionTrashEnabled === false ? _ctx.t('sessions.preview.deleting') : _ctx.t('sessions.preview.moving')) : (_ctx.sessionTrashEnabled === false ? _ctx.t('sessions.preview.deleteHard') : _ctx.t('sessions.preview.moveToTrash'))), 1 /* TEXT */)
4941
5182
  ], 8 /* PROPS */, ["onClick", "disabled", "title", "aria-label"]))
4942
5183
  : _createCommentVNode("v-if", true)
4943
5184
  ])
4944
5185
  ])
4945
5186
  ], 512 /* NEED_PATCH */),
5187
+ (_ctx.activeSession)
5188
+ ? (_openBlock(), _createElementBlock("section", {
5189
+ key: 1,
5190
+ class: "context-health",
5191
+ "aria-labelledby": "context-health-heading",
5192
+ "aria-busy": _ctx.sessionContextHealthLoading,
5193
+ onVnodeMounted: $event => (_ctx.loadSessionContextHealth()),
5194
+ onVnodeUpdated: $event => (_ctx.loadSessionContextHealth())
5195
+ }, [
5196
+ _createElementVNode("div", { class: "context-health-header" }, [
5197
+ _createElementVNode("div", { class: "context-health-heading" }, [
5198
+ _createElementVNode("h3", {
5199
+ id: "context-health-heading",
5200
+ class: "context-health-title"
5201
+ }, _toDisplayString(_ctx.t('contextHealth.title')), 1 /* TEXT */),
5202
+ (_ctx.sessionContextHealth)
5203
+ ? (_openBlock(), _createElementBlock("span", {
5204
+ key: 0,
5205
+ class: _normalizeClass(['context-health-rating', _ctx.sessionContextHealth.health]),
5206
+ role: "img",
5207
+ "aria-label": _ctx.t('contextHealth.level.' + _ctx.sessionContextHealth.health)
5208
+ }, null, 10 /* CLASS, PROPS */, ["aria-label"]))
5209
+ : _createCommentVNode("v-if", true),
5210
+ (_ctx.sessionContextHealth)
5211
+ ? (_openBlock(), _createElementBlock("p", {
5212
+ key: 1,
5213
+ class: "context-health-meta"
5214
+ }, _toDisplayString(_ctx.sessionContextHealth.messageCount.toLocaleString()) + " " + _toDisplayString(_ctx.t('contextHealth.nodes')), 1 /* TEXT */))
5215
+ : (_ctx.sessionContextHealthLoading)
5216
+ ? (_openBlock(), _createElementBlock("p", {
5217
+ key: 2,
5218
+ class: "context-health-meta",
5219
+ role: "status"
5220
+ }, _toDisplayString(_ctx.t('contextHealth.loading')), 1 /* TEXT */))
5221
+ : _createCommentVNode("v-if", true)
5222
+ ]),
5223
+ (_ctx.sessionContextHealth)
5224
+ ? (_openBlock(), _createElementBlock("div", {
5225
+ key: 0,
5226
+ class: "context-health-summary"
5227
+ }, [
5228
+ _createElementVNode("span", { class: "context-health-total mono" }, [
5229
+ _createTextVNode("≈ " + _toDisplayString(_ctx.sessionContextHealth.totalEstimatedTokens.toLocaleString()) + " ", 1 /* TEXT */),
5230
+ _createElementVNode("small", null, "Token")
5231
+ ])
5232
+ ]))
5233
+ : (_ctx.sessionContextHealthLoading)
5234
+ ? (_openBlock(), _createElementBlock("div", {
5235
+ key: 1,
5236
+ class: "context-health-summary context-health-summary-skeleton",
5237
+ "aria-hidden": "true"
5238
+ }, [
5239
+ _createElementVNode("span")
5240
+ ]))
5241
+ : _createCommentVNode("v-if", true),
5242
+ _createElementVNode("button", {
5243
+ type: "button",
5244
+ class: "btn-mini context-health-refresh",
5245
+ onClick: $event => (_ctx.loadSessionContextHealth(true)),
5246
+ disabled: _ctx.sessionContextHealthLoading,
5247
+ "aria-label": _ctx.t('common.refresh'),
5248
+ title: _ctx.t('common.refresh')
5249
+ }, [
5250
+ (_openBlock(), _createElementBlock("svg", {
5251
+ width: "16",
5252
+ height: "16",
5253
+ viewBox: "0 0 24 24",
5254
+ fill: "none",
5255
+ stroke: "currentColor",
5256
+ "stroke-width": "1.75",
5257
+ "stroke-linecap": "round",
5258
+ "stroke-linejoin": "round",
5259
+ "aria-hidden": "true"
5260
+ }, [
5261
+ _createElementVNode("path", { d: "M20 7v5h-5M4 17v-5h5" }),
5262
+ _createElementVNode("path", { d: "M6.1 7a7 7 0 0 1 11.5-1.3L20 8M4 16l2.4 2.3A7 7 0 0 0 17.9 17" })
5263
+ ]))
5264
+ ], 8 /* PROPS */, ["onClick", "disabled", "aria-label", "title"])
5265
+ ]),
5266
+ _createElementVNode("div", {
5267
+ class: "context-health-bar",
5268
+ role: "img",
5269
+ "aria-label": _ctx.t('contextHealth.composition')
5270
+ }, [
5271
+ (_ctx.sessionContextHealth)
5272
+ ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(_ctx.sessionContextHealth.categories, (part) => {
5273
+ return _withDirectives((_openBlock(), _createElementBlock("span", {
5274
+ key: part.id,
5275
+ class: _normalizeClass(['context-health-segment', part.id]),
5276
+ style: _normalizeStyle({ flexGrow: part.estimatedTokens }),
5277
+ title: _ctx.t('contextHealth.category.' + part.id) + ': ≈ ' + part.estimatedTokens + ' Token (' + part.percentage.toFixed(2) + '%)',
5278
+ "aria-label": _ctx.t('contextHealth.category.' + part.id) + ': ' + part.percentage.toFixed(2) + '%'
5279
+ }, null, 14 /* CLASS, STYLE, PROPS */, ["title", "aria-label"])), [
5280
+ [_vShow, part.estimatedTokens > 0]
5281
+ ])
5282
+ }), 128 /* KEYED_FRAGMENT */))
5283
+ : _createCommentVNode("v-if", true)
5284
+ ], 8 /* PROPS */, ["aria-label"]),
5285
+ (_ctx.sessionContextHealthError)
5286
+ ? (_openBlock(), _createElementBlock("p", {
5287
+ key: 0,
5288
+ class: "form-error context-health-error",
5289
+ role: "alert"
5290
+ }, _toDisplayString(_ctx.sessionContextHealthError), 1 /* TEXT */))
5291
+ : _createCommentVNode("v-if", true),
5292
+ (_ctx.sessionContextHealth)
5293
+ ? (_openBlock(), _createElementBlock("div", {
5294
+ key: 1,
5295
+ id: "context-health-details",
5296
+ class: "context-health-details"
5297
+ }, [
5298
+ _createElementVNode("dl", { class: "context-health-legend" }, [
5299
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.sessionContextHealth.categories, (part) => {
5300
+ return (_openBlock(), _createElementBlock("div", {
5301
+ key: part.id
5302
+ }, [
5303
+ _createElementVNode("dt", null, [
5304
+ _createElementVNode("span", {
5305
+ class: _normalizeClass(['context-health-dot', part.id]),
5306
+ "aria-hidden": "true"
5307
+ }, null, 2 /* CLASS */),
5308
+ _createTextVNode(_toDisplayString(_ctx.t('contextHealth.category.' + part.id)), 1 /* TEXT */)
5309
+ ]),
5310
+ _createElementVNode("dd", null, [
5311
+ _createElementVNode("span", { class: "context-health-category-tokens mono" }, "≈ " + _toDisplayString(part.estimatedTokens.toLocaleString()), 1 /* TEXT */),
5312
+ _createElementVNode("span", { class: "context-health-category-share mono" }, _toDisplayString(part.percentage.toFixed(2)) + "%", 1 /* TEXT */)
5313
+ ])
5314
+ ]))
5315
+ }), 128 /* KEYED_FRAGMENT */))
5316
+ ]),
5317
+ (!_ctx.sessionContextHealth.messageCount)
5318
+ ? (_openBlock(), _createElementBlock("p", {
5319
+ key: 0,
5320
+ class: "context-health-note"
5321
+ }, _toDisplayString(_ctx.t('contextHealth.empty')), 1 /* TEXT */))
5322
+ : _createCommentVNode("v-if", true)
5323
+ ]))
5324
+ : (_ctx.sessionContextHealthLoading)
5325
+ ? (_openBlock(), _createElementBlock("dl", {
5326
+ key: 2,
5327
+ class: "context-health-legend context-health-loading",
5328
+ "aria-hidden": "true"
5329
+ }, [
5330
+ (_openBlock(), _createElementBlock(_Fragment, null, _renderList(['system', 'user', 'assistant', 'tools', 'code'], (part) => {
5331
+ return _createElementVNode("div", {
5332
+ key: part,
5333
+ class: "context-health-loading-row"
5334
+ }, [
5335
+ _createElementVNode("dt", null, [
5336
+ _createElementVNode("span", {
5337
+ class: _normalizeClass(['context-health-dot', part]),
5338
+ "aria-hidden": "true"
5339
+ }, null, 2 /* CLASS */),
5340
+ _createTextVNode(_toDisplayString(_ctx.t('contextHealth.category.' + part)), 1 /* TEXT */)
5341
+ ]),
5342
+ _createElementVNode("dd", null, [
5343
+ _createElementVNode("span", { class: "context-health-value-skeleton" }),
5344
+ _createElementVNode("span", { class: "context-health-share-skeleton" })
5345
+ ])
5346
+ ])
5347
+ }), 64 /* STABLE_FRAGMENT */))
5348
+ ]))
5349
+ : _createCommentVNode("v-if", true)
5350
+ ], 8 /* PROPS */, ["aria-busy", "onVnodeMounted", "onVnodeUpdated"]))
5351
+ : _createCommentVNode("v-if", true),
5352
+ (_ctx.sessionContextHealthFocusedNode)
5353
+ ? (_openBlock(), _createElementBlock("article", {
5354
+ key: 2,
5355
+ ref: "contextHealthFocusedMessage",
5356
+ class: "context-health-focused-message",
5357
+ tabindex: "-1",
5358
+ "data-context-node-id": _ctx.sessionContextHealthFocusedNode.id,
5359
+ "aria-label": _ctx.t('contextHealth.message')
5360
+ }, [
5361
+ _createElementVNode("header", null, [
5362
+ _createElementVNode("div", null, [
5363
+ _createElementVNode("strong", null, _toDisplayString(_ctx.t('contextHealth.message')), 1 /* TEXT */),
5364
+ _createElementVNode("span", { class: "context-health-meta mono" }, _toDisplayString(_ctx.sessionContextHealthFocusedNode.id), 1 /* TEXT */)
5365
+ ]),
5366
+ _createElementVNode("button", {
5367
+ type: "button",
5368
+ class: "btn-mini context-health-refresh",
5369
+ onClick: $event => (_ctx.sessionContextHealthFocusedNode = null),
5370
+ "aria-label": _ctx.t('common.close')
5371
+ }, [
5372
+ (_openBlock(), _createElementBlock("svg", {
5373
+ width: "16",
5374
+ height: "16",
5375
+ viewBox: "0 0 24 24",
5376
+ fill: "none",
5377
+ stroke: "currentColor",
5378
+ "stroke-width": "1.75",
5379
+ "stroke-linecap": "round",
5380
+ "aria-hidden": "true"
5381
+ }, [
5382
+ _createElementVNode("path", { d: "m6 6 12 12M18 6 6 18" })
5383
+ ]))
5384
+ ], 8 /* PROPS */, ["onClick", "aria-label"])
5385
+ ]),
5386
+ _createElementVNode("pre", null, _toDisplayString(_ctx.sessionContextHealthFocusedNode.text), 1 /* TEXT */)
5387
+ ], 8 /* PROPS */, ["data-context-node-id", "aria-label"]))
5388
+ : _createCommentVNode("v-if", true),
4946
5389
  _createElementVNode("div", { class: "session-export-feedback" }, [
4947
5390
  (_ctx.sessionExportNotice && _ctx.sessionExportNotice.key === _ctx.getSessionExportKey(_ctx.activeSession))
4948
5391
  ? (_openBlock(), _createElementBlock("p", {
@@ -4954,22 +5397,22 @@ return function render(_ctx, _cache) {
4954
5397
  ]),
4955
5398
  (_ctx.sessionDetailLoading && !_ctx.sessionPreviewLoadingMore)
4956
5399
  ? (_openBlock(), _createElementBlock("div", {
4957
- key: 1,
5400
+ key: 3,
4958
5401
  class: "session-preview-empty"
4959
5402
  }, _toDisplayString(_ctx.t('sessions.preview.loadingBody')), 1 /* TEXT */))
4960
5403
  : (_ctx.activeSessionDetailError)
4961
5404
  ? (_openBlock(), _createElementBlock("div", {
4962
- key: 2,
5405
+ key: 4,
4963
5406
  class: "session-preview-empty"
4964
5407
  }, _toDisplayString(_ctx.activeSessionDetailError), 1 /* TEXT */))
4965
5408
  : (!_ctx.activeSessionMessages.length)
4966
5409
  ? (_openBlock(), _createElementBlock("div", {
4967
- key: 3,
5410
+ key: 5,
4968
5411
  class: "session-preview-empty"
4969
5412
  }, _toDisplayString(_ctx.t('sessions.preview.emptyMsgs')), 1 /* TEXT */))
4970
5413
  : (_ctx.sessionPreviewRenderEnabled && !_ctx.activeSessionVisibleMessages.length)
4971
5414
  ? (_openBlock(), _createElementBlock("div", {
4972
- key: 4,
5415
+ key: 6,
4973
5416
  class: "session-preview-empty"
4974
5417
  }, [
4975
5418
  _createElementVNode("span", null, _toDisplayString(_ctx.t('sessions.preview.rendering')), 1 /* TEXT */),
@@ -4981,11 +5424,11 @@ return function render(_ctx, _cache) {
4981
5424
  ]))
4982
5425
  : (!_ctx.sessionPreviewRenderEnabled)
4983
5426
  ? (_openBlock(), _createElementBlock("div", {
4984
- key: 5,
5427
+ key: 7,
4985
5428
  class: "session-preview-empty"
4986
5429
  }, _toDisplayString(_ctx.t('sessions.preview.preparing')), 1 /* TEXT */))
4987
5430
  : (_openBlock(), _createElementBlock("div", {
4988
- key: 6,
5431
+ key: 8,
4989
5432
  class: "session-preview-body"
4990
5433
  }, [
4991
5434
  (_ctx.activeSessionWorkspaceSummary.available)
@@ -7151,14 +7594,14 @@ return function render(_ctx, _cache) {
7151
7594
  type: "button",
7152
7595
  class: "btn-mini",
7153
7596
  onClick: _ctx.focusPromptComposerFirstMissingVar,
7154
- disabled: _ctx.pluginsLoading
7597
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving
7155
7598
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.compose.jumpToMissing')), 9 /* TEXT, PROPS */, ["onClick", "disabled"]))
7156
7599
  : _createCommentVNode("v-if", true),
7157
7600
  _createElementVNode("button", {
7158
7601
  type: "button",
7159
7602
  class: "btn-mini",
7160
7603
  onClick: _ctx.resetPromptComposerVarValues,
7161
- disabled: _ctx.pluginsLoading
7604
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving
7162
7605
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.vars.reset')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
7163
7606
  ])
7164
7607
  ]),
@@ -7242,7 +7685,7 @@ return function render(_ctx, _cache) {
7242
7685
  type: "button",
7243
7686
  class: "btn-mini",
7244
7687
  onClick: _ctx.createPromptTemplate,
7245
- disabled: _ctx.pluginsLoading
7688
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving
7246
7689
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.manage.create')), 9 /* TEXT, PROPS */, ["onClick", "disabled"]),
7247
7690
  _createElementVNode("button", {
7248
7691
  type: "button",
@@ -7254,7 +7697,7 @@ return function render(_ctx, _cache) {
7254
7697
  type: "button",
7255
7698
  class: "btn-mini",
7256
7699
  onClick: _ctx.triggerPromptTemplatesImport,
7257
- disabled: _ctx.pluginsLoading
7700
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving
7258
7701
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.manage.import')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
7259
7702
  ]),
7260
7703
  (_ctx.pluginsLoading && !_ctx.promptTemplatesLoadedOnce)
@@ -7296,12 +7739,105 @@ return function render(_ctx, _cache) {
7296
7739
  ]))
7297
7740
  ]),
7298
7741
  _createElementVNode("div", { class: "prompt-templates-pane prompt-templates-pane-editor" }, [
7742
+ _createElementVNode("div", { class: "prompt-editor-actions" }, [
7743
+ _createElementVNode("button", {
7744
+ type: "button",
7745
+ class: "btn-mini",
7746
+ onClick: _ctx.openPluginHistory,
7747
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving || _ctx.pluginHistoryLoading
7748
+ }, _toDisplayString(_ctx.t('common.history')), 9 /* TEXT, PROPS */, ["onClick", "disabled"]),
7749
+ _createElementVNode("button", {
7750
+ type: "button",
7751
+ class: "btn-mini",
7752
+ onClick: _ctx.sharePromptTemplate,
7753
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving || !_ctx.promptTemplateDraft
7754
+ }, _toDisplayString(_ctx.t('ecosystem.share')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
7755
+ ]),
7756
+ (_ctx.pluginHistoryVisible)
7757
+ ? (_openBlock(), _createElementBlock("details", {
7758
+ key: 0,
7759
+ class: "prompt-history-panel",
7760
+ open: ""
7761
+ }, [
7762
+ _createElementVNode("summary", { class: "prompt-history-summary" }, [
7763
+ _createElementVNode("span", null, _toDisplayString(_ctx.t('common.history')), 1 /* TEXT */),
7764
+ _createElementVNode("button", {
7765
+ type: "button",
7766
+ class: "btn-mini",
7767
+ onClick: $event => {_ctx.pluginHistoryVisible = false; _ctx.pluginHistorySelectedId = ''},
7768
+ "aria-label": _ctx.t('common.close')
7769
+ }, "×", 8 /* PROPS */, ["onClick", "aria-label"])
7770
+ ]),
7771
+ _createElementVNode("div", { class: "prompt-history-body" }, [
7772
+ _createElementVNode("div", {
7773
+ class: "prompt-history-list",
7774
+ role: "group",
7775
+ "aria-label": _ctx.t('common.history')
7776
+ }, [
7777
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.pluginHistoryItems, (item) => {
7778
+ return (_openBlock(), _createElementBlock("button", {
7779
+ key: item.id,
7780
+ type: "button",
7781
+ class: _normalizeClass(['btn-mini', { active: _ctx.pluginHistorySelectedId === item.id }]),
7782
+ "aria-pressed": _ctx.pluginHistorySelectedId === item.id,
7783
+ disabled: _ctx.pluginHistoryLoading || _ctx.pluginConfigSaving,
7784
+ onClick: $event => (_ctx.viewPluginHistory(item))
7785
+ }, _toDisplayString(item.id), 11 /* TEXT, CLASS, PROPS */, ["aria-pressed", "disabled", "onClick"]))
7786
+ }), 128 /* KEYED_FRAGMENT */))
7787
+ ], 8 /* PROPS */, ["aria-label"]),
7788
+ (_ctx.pluginHistoryLoading)
7789
+ ? (_openBlock(), _createElementBlock("p", {
7790
+ key: 0,
7791
+ class: "state-message"
7792
+ }, _toDisplayString(_ctx.t('diff.generating')), 1 /* TEXT */))
7793
+ : (_ctx.pluginHistoryError)
7794
+ ? (_openBlock(), _createElementBlock("p", {
7795
+ key: 1,
7796
+ class: "state-message error",
7797
+ role: "alert"
7798
+ }, _toDisplayString(_ctx.pluginHistoryError), 1 /* TEXT */))
7799
+ : (!_ctx.pluginHistoryItems.length)
7800
+ ? (_openBlock(), _createElementBlock("p", {
7801
+ key: 2,
7802
+ class: "state-message"
7803
+ }, _toDisplayString(_ctx.t('toast.history.empty')), 1 /* TEXT */))
7804
+ : _createCommentVNode("v-if", true),
7805
+ (_ctx.pluginHistorySelectedId && !_ctx.pluginHistoryLoading && !_ctx.pluginHistoryError)
7806
+ ? (_openBlock(), _createElementBlock(_Fragment, { key: 3 }, [
7807
+ _createElementVNode("div", { class: "form-hint" }, _toDisplayString(_ctx.t('ecosystem.historyCompare')) + " · +" + _toDisplayString(_ctx.pluginHistoryComparison.stats.added) + " / −" + _toDisplayString(_ctx.pluginHistoryComparison.stats.removed), 1 /* TEXT */),
7808
+ _createElementVNode("div", {
7809
+ class: "agents-diff-view prompt-history-diff",
7810
+ role: "region",
7811
+ "aria-label": _ctx.t('ecosystem.historyCompare'),
7812
+ tabindex: "0"
7813
+ }, [
7814
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.pluginHistoryComparison.lines, (line, index) => {
7815
+ return (_openBlock(), _createElementBlock("div", {
7816
+ key: index,
7817
+ class: _normalizeClass(['agents-diff-line', line.type])
7818
+ }, [
7819
+ _createElementVNode("span", { class: "agents-diff-line-sign" }, _toDisplayString(line.type === 'add' ? '+' : (line.type === 'del' ? '−' : ' ')), 1 /* TEXT */),
7820
+ _createElementVNode("span", { class: "agents-diff-line-text" }, _toDisplayString(line.value), 1 /* TEXT */)
7821
+ ], 2 /* CLASS */))
7822
+ }), 128 /* KEYED_FRAGMENT */))
7823
+ ], 8 /* PROPS */, ["aria-label"]),
7824
+ _createElementVNode("button", {
7825
+ type: "button",
7826
+ class: "btn-mini btn-confirm-mini",
7827
+ onClick: _ctx.rollbackPluginConfig,
7828
+ disabled: _ctx.pluginConfigSaving || _ctx.pluginHistoryLoading
7829
+ }, _toDisplayString(_ctx.t('ecosystem.rollback')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
7830
+ ], 64 /* STABLE_FRAGMENT */))
7831
+ : _createCommentVNode("v-if", true)
7832
+ ])
7833
+ ]))
7834
+ : _createCommentVNode("v-if", true),
7299
7835
  (!_ctx.promptTemplateDraft)
7300
7836
  ? (_openBlock(), _createElementBlock("div", {
7301
- key: 0,
7837
+ key: 1,
7302
7838
  class: "skills-empty-state"
7303
7839
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.editor.selectHint')), 1 /* TEXT */))
7304
- : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
7840
+ : (_openBlock(), _createElementBlock(_Fragment, { key: 2 }, [
7305
7841
  _createElementVNode("div", { class: "prompt-editor-head" }, [
7306
7842
  _createElementVNode("div", { class: "prompt-editor-title-row" }, [
7307
7843
  _withDirectives(_createElementVNode("input", {
@@ -7328,19 +7864,19 @@ return function render(_ctx, _cache) {
7328
7864
  type: "button",
7329
7865
  class: "btn-mini",
7330
7866
  onClick: _ctx.duplicatePromptTemplate,
7331
- disabled: _ctx.pluginsLoading
7867
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving
7332
7868
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.editor.duplicate')), 9 /* TEXT, PROPS */, ["onClick", "disabled"]),
7333
7869
  _createElementVNode("button", {
7334
7870
  type: "button",
7335
7871
  class: "btn-mini delete",
7336
7872
  onClick: _ctx.deletePromptTemplate,
7337
- disabled: _ctx.pluginsLoading
7873
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving
7338
7874
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.editor.delete')), 9 /* TEXT, PROPS */, ["onClick", "disabled"]),
7339
7875
  _createElementVNode("button", {
7340
7876
  type: "button",
7341
7877
  class: "btn-mini",
7342
7878
  onClick: _ctx.savePromptTemplate,
7343
- disabled: _ctx.pluginsLoading
7879
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving
7344
7880
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.editor.save')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
7345
7881
  ]))
7346
7882
  : _createCommentVNode("v-if", true)
@@ -7401,7 +7937,7 @@ return function render(_ctx, _cache) {
7401
7937
  type: "button",
7402
7938
  class: "btn-mini",
7403
7939
  onClick: _ctx.resetPromptVariableValues,
7404
- disabled: _ctx.pluginsLoading
7940
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving
7405
7941
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.vars.reset')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
7406
7942
  ]))
7407
7943
  : _createCommentVNode("v-if", true)
@@ -7443,7 +7979,7 @@ return function render(_ctx, _cache) {
7443
7979
  type: "button",
7444
7980
  class: "btn-mini",
7445
7981
  onClick: _ctx.copyRenderedPrompt,
7446
- disabled: _ctx.pluginsLoading
7982
+ disabled: _ctx.pluginsLoading || _ctx.pluginConfigSaving
7447
7983
  }, _toDisplayString(_ctx.t('plugins.promptTemplates.preview.copy')), 9 /* TEXT, PROPS */, ["onClick", "disabled"])
7448
7984
  ]),
7449
7985
  _createElementVNode("textarea", {
@@ -7870,12 +8406,35 @@ return function render(_ctx, _cache) {
7870
8406
  class: "state-message"
7871
8407
  }, _toDisplayString(_ctx.t('toast.history.empty')), 1 /* TEXT */))
7872
8408
  : _createCommentVNode("v-if", true),
7873
- (_ctx.promptHistoryPreviewContent)
8409
+ (_ctx.promptHistoryPreviewId && !_ctx.promptHistoryLoading && !_ctx.promptHistoryError)
7874
8410
  ? (_openBlock(), _createElementBlock("div", {
7875
8411
  key: 4,
7876
8412
  class: "prompt-history-preview-wrap"
7877
8413
  }, [
7878
8414
  _createElementVNode("pre", { class: "prompt-history-preview" }, _toDisplayString(_ctx.promptHistoryPreviewContent), 1 /* TEXT */),
8415
+ _createElementVNode("div", { class: "form-hint" }, _toDisplayString(_ctx.t('ecosystem.historyCompare')) + " · +" + _toDisplayString(_ctx.promptHistoryComparison.stats.added) + " / −" + _toDisplayString(_ctx.promptHistoryComparison.stats.removed), 1 /* TEXT */),
8416
+ _createElementVNode("div", {
8417
+ class: "agents-diff-view prompt-history-diff",
8418
+ role: "region",
8419
+ "aria-label": _ctx.t('ecosystem.historyCompare'),
8420
+ tabindex: "0"
8421
+ }, [
8422
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.promptHistoryComparison.lines, (line, index) => {
8423
+ return (_openBlock(), _createElementBlock("div", {
8424
+ key: index,
8425
+ class: _normalizeClass(['agents-diff-line', line.type])
8426
+ }, [
8427
+ _createElementVNode("span", { class: "agents-diff-line-sign" }, _toDisplayString(line.type === 'add' ? '+' : (line.type === 'del' ? '−' : ' ')), 1 /* TEXT */),
8428
+ _createElementVNode("span", { class: "agents-diff-line-text" }, _toDisplayString(line.value), 1 /* TEXT */)
8429
+ ], 2 /* CLASS */))
8430
+ }), 128 /* KEYED_FRAGMENT */))
8431
+ ], 8 /* PROPS */, ["aria-label"]),
8432
+ _createElementVNode("button", {
8433
+ type: "button",
8434
+ class: "btn-mini btn-confirm-mini",
8435
+ onClick: $event => (_ctx.rollbackPromptHistory('agents')),
8436
+ disabled: _ctx.agentsSaving || _ctx.promptHistoryLoading || _ctx.agentsDiffVisible
8437
+ }, _toDisplayString(_ctx.t('ecosystem.rollback')), 9 /* TEXT, PROPS */, ["onClick", "disabled"]),
7879
8438
  _createElementVNode("button", {
7880
8439
  type: "button",
7881
8440
  class: "btn-mini btn-confirm-mini",
@@ -8444,12 +9003,35 @@ return function render(_ctx, _cache) {
8444
9003
  class: "state-message"
8445
9004
  }, _toDisplayString(_ctx.t('toast.history.empty')), 1 /* TEXT */))
8446
9005
  : _createCommentVNode("v-if", true),
8447
- (_ctx.sysHistoryPreviewContent)
9006
+ (_ctx.sysHistoryPreviewId && !_ctx.sysHistoryLoading && !_ctx.sysHistoryError)
8448
9007
  ? (_openBlock(), _createElementBlock("div", {
8449
9008
  key: 4,
8450
9009
  class: "prompt-history-preview-wrap"
8451
9010
  }, [
8452
9011
  _createElementVNode("pre", { class: "prompt-history-preview" }, _toDisplayString(_ctx.sysHistoryPreviewContent), 1 /* TEXT */),
9012
+ _createElementVNode("div", { class: "form-hint" }, _toDisplayString(_ctx.t('ecosystem.historyCompare')) + " · +" + _toDisplayString(_ctx.sysHistoryComparison.stats.added) + " / −" + _toDisplayString(_ctx.sysHistoryComparison.stats.removed), 1 /* TEXT */),
9013
+ _createElementVNode("div", {
9014
+ class: "agents-diff-view prompt-history-diff",
9015
+ role: "region",
9016
+ "aria-label": _ctx.t('ecosystem.historyCompare'),
9017
+ tabindex: "0"
9018
+ }, [
9019
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.sysHistoryComparison.lines, (line, index) => {
9020
+ return (_openBlock(), _createElementBlock("div", {
9021
+ key: index,
9022
+ class: _normalizeClass(['agents-diff-line', line.type])
9023
+ }, [
9024
+ _createElementVNode("span", { class: "agents-diff-line-sign" }, _toDisplayString(line.type === 'add' ? '+' : (line.type === 'del' ? '−' : ' ')), 1 /* TEXT */),
9025
+ _createElementVNode("span", { class: "agents-diff-line-text" }, _toDisplayString(line.value), 1 /* TEXT */)
9026
+ ], 2 /* CLASS */))
9027
+ }), 128 /* KEYED_FRAGMENT */))
9028
+ ], 8 /* PROPS */, ["aria-label"]),
9029
+ _createElementVNode("button", {
9030
+ type: "button",
9031
+ class: "btn-mini btn-confirm-mini",
9032
+ onClick: $event => (_ctx.rollbackPromptHistory('sys')),
9033
+ disabled: _ctx.sysPromptSaving || _ctx.sysHistoryLoading || _ctx.sysPromptDiffVisible
9034
+ }, _toDisplayString(_ctx.t('ecosystem.rollback')), 9 /* TEXT, PROPS */, ["onClick", "disabled"]),
8453
9035
  _createElementVNode("button", {
8454
9036
  type: "button",
8455
9037
  class: "btn-mini btn-confirm-mini",
@@ -9837,10 +10419,78 @@ return function render(_ctx, _cache) {
9837
10419
  ])
9838
10420
  ], 8 /* PROPS */, ["onClick"]))
9839
10421
  : _createCommentVNode("v-if", true),
10422
+ (_ctx.promptInvocationVisible)
10423
+ ? (_openBlock(), _createElementBlock("div", {
10424
+ key: 14,
10425
+ class: "modal-overlay",
10426
+ onClick: _withModifiers(_ctx.closePromptTemplateInvocation, ["self"])
10427
+ }, [
10428
+ _createElementVNode("form", {
10429
+ ref: "promptInvocationDialog",
10430
+ class: "modal prompt-invocation-dialog",
10431
+ role: "dialog",
10432
+ "aria-modal": "true",
10433
+ "aria-labelledby": "prompt-invocation-title",
10434
+ "aria-describedby": "prompt-invocation-hint",
10435
+ onSubmit: _withModifiers(_ctx.finishPromptTemplateInvocation, ["prevent"]),
10436
+ onKeydown: _ctx.onPromptInvocationKeydown
10437
+ }, [
10438
+ _createElementVNode("h2", {
10439
+ id: "prompt-invocation-title",
10440
+ class: "modal-title"
10441
+ }, _toDisplayString(_ctx.t('ecosystem.variablesTitle')), 1 /* TEXT */),
10442
+ _createElementVNode("p", {
10443
+ id: "prompt-invocation-hint",
10444
+ class: "form-hint"
10445
+ }, _toDisplayString(_ctx.t('ecosystem.variablesHint')), 1 /* TEXT */),
10446
+ _createElementVNode("div", { class: "prompt-invocation-fields" }, [
10447
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.promptInvocationNames, (name, index) => {
10448
+ return (_openBlock(), _createElementBlock("label", {
10449
+ key: name,
10450
+ class: "form-group",
10451
+ for: 'prompt-invocation-var-' + index
10452
+ }, [
10453
+ _createElementVNode("span", { class: "form-label mono" }, _toDisplayString('{' + '{' + name + '}' + '}'), 1 /* TEXT */),
10454
+ _withDirectives(_createElementVNode("textarea", {
10455
+ id: 'prompt-invocation-var-' + index,
10456
+ "onUpdate:modelValue": $event => ((_ctx.promptInvocationValues[name]) = $event),
10457
+ class: "form-input",
10458
+ rows: name === 'git_diff' ? 6 : 2,
10459
+ autocomplete: "off",
10460
+ spellcheck: "false",
10461
+ "aria-required": "true",
10462
+ "aria-invalid": !!_ctx.promptInvocationError && !_ctx.promptInvocationValues[name].trim()
10463
+ }, null, 8 /* PROPS */, ["id", "onUpdate:modelValue", "rows", "aria-invalid"]), [
10464
+ [_vModelText, _ctx.promptInvocationValues[name]]
10465
+ ])
10466
+ ], 8 /* PROPS */, ["for"]))
10467
+ }), 128 /* KEYED_FRAGMENT */))
10468
+ ]),
10469
+ (_ctx.promptInvocationError)
10470
+ ? (_openBlock(), _createElementBlock("p", {
10471
+ key: 0,
10472
+ class: "form-error",
10473
+ role: "alert"
10474
+ }, _toDisplayString(_ctx.promptInvocationError), 1 /* TEXT */))
10475
+ : _createCommentVNode("v-if", true),
10476
+ _createElementVNode("div", { class: "modal-actions" }, [
10477
+ _createElementVNode("button", {
10478
+ type: "button",
10479
+ class: "btn btn-secondary",
10480
+ onClick: _ctx.closePromptTemplateInvocation
10481
+ }, _toDisplayString(_ctx.t('common.cancel')), 9 /* TEXT, PROPS */, ["onClick"]),
10482
+ _createElementVNode("button", {
10483
+ type: "submit",
10484
+ class: "btn btn-primary"
10485
+ }, _toDisplayString(_ctx.t('ecosystem.useTemplate')), 1 /* TEXT */)
10486
+ ])
10487
+ ], 40 /* PROPS, NEED_HYDRATION */, ["onSubmit", "onKeydown"])
10488
+ ], 8 /* PROPS */, ["onClick"]))
10489
+ : _createCommentVNode("v-if", true),
9840
10490
  _createCommentVNode(" Webhook settings modal "),
9841
10491
  (_ctx.showWebhookModal)
9842
10492
  ? (_openBlock(), _createElementBlock("div", {
9843
- key: 14,
10493
+ key: 15,
9844
10494
  class: "modal-overlay",
9845
10495
  onClick: _withModifiers(_ctx.closeWebhookModal, ["self"])
9846
10496
  }, [
@@ -9913,7 +10563,7 @@ return function render(_ctx, _cache) {
9913
10563
  : _createCommentVNode("v-if", true),
9914
10564
  (_ctx.showOpenclawConfigModal)
9915
10565
  ? (_openBlock(), _createElementBlock("div", {
9916
- key: 15,
10566
+ key: 16,
9917
10567
  class: "modal-overlay",
9918
10568
  onClick: _withModifiers($event => (!(_ctx.openclawSaving || _ctx.openclawApplying) && _ctx.closeOpenclawConfigModal()), ["self"])
9919
10569
  }, [
@@ -10625,7 +11275,7 @@ return function render(_ctx, _cache) {
10625
11275
  : _createCommentVNode("v-if", true),
10626
11276
  (_ctx.showConfigTemplateModal)
10627
11277
  ? (_openBlock(), _createElementBlock("div", {
10628
- key: 16,
11278
+ key: 17,
10629
11279
  class: "modal-overlay",
10630
11280
  onClick: _withModifiers($event => (!_ctx.configTemplateApplying && _ctx.closeConfigTemplateModal()), ["self"])
10631
11281
  }, [
@@ -10770,7 +11420,7 @@ return function render(_ctx, _cache) {
10770
11420
  : _createCommentVNode("v-if", true),
10771
11421
  (_ctx.showAgentsModal)
10772
11422
  ? (_openBlock(), _createElementBlock("div", {
10773
- key: 17,
11423
+ key: 18,
10774
11424
  class: "modal-overlay",
10775
11425
  onClick: _withModifiers(_ctx.closeAgentsModal, ["self"])
10776
11426
  }, [
@@ -10941,7 +11591,7 @@ return function render(_ctx, _cache) {
10941
11591
  : _createCommentVNode("v-if", true),
10942
11592
  (_ctx.showSkillsModal)
10943
11593
  ? (_openBlock(), _createElementBlock("div", {
10944
- key: 18,
11594
+ key: 19,
10945
11595
  class: "modal-overlay",
10946
11596
  onClick: _withModifiers(_ctx.closeSkillsModal, ["self"])
10947
11597
  }, [
@@ -11246,7 +11896,7 @@ return function render(_ctx, _cache) {
11246
11896
  }, null, 40 /* PROPS, NEED_HYDRATION */, ["onChange"]),
11247
11897
  (_ctx.showHealthCheckModal)
11248
11898
  ? (_openBlock(), _createElementBlock("div", {
11249
- key: 19,
11899
+ key: 20,
11250
11900
  class: "modal-overlay",
11251
11901
  onClick: _withModifiers($event => (_ctx.showHealthCheckModal = false), ["self"])
11252
11902
  }, [
@@ -11419,7 +12069,7 @@ return function render(_ctx, _cache) {
11419
12069
  : _createCommentVNode("v-if", true),
11420
12070
  (_ctx.showConfirmDialog)
11421
12071
  ? (_openBlock(), _createElementBlock("div", {
11422
- key: 20,
12072
+ key: 21,
11423
12073
  class: "modal-overlay",
11424
12074
  onClick: _withModifiers(_ctx.closeConfirmDialog, ["self"])
11425
12075
  }, [
@@ -11457,7 +12107,7 @@ return function render(_ctx, _cache) {
11457
12107
  _createCommentVNode(" Toast "),
11458
12108
  (_ctx.message)
11459
12109
  ? (_openBlock(), _createElementBlock("div", {
11460
- key: 21,
12110
+ key: 22,
11461
12111
  class: _normalizeClass(['toast', _ctx.messageType]),
11462
12112
  role: "status",
11463
12113
  "aria-live": "polite",