dsh-ptc-plus 0.5.1 → 0.5.3

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 (85) hide show
  1. package/README.en.md +10 -4
  2. package/README.md +10 -4
  3. package/client.cjs +1623 -104
  4. package/compiler-core.cjs +132 -132
  5. package/compiler-core.cjs.map +3 -3
  6. package/docs/adr/0005-temporary-rejected-cell-edit-transport.md +2 -0
  7. package/docs/adr/0017-track-the-latest-dsh-public-surface.md +4 -2
  8. package/docs/adr/0019-plugin-settings-and-kill-switch.md +2 -2
  9. package/docs/adr/0023-global-user-bindings.md +12 -0
  10. package/docs/adr/0027-run-the-session-kernel-in-a-killable-helper-process.md +11 -1
  11. package/docs/adr/0028-attach-to-the-host-ptc-execution-seam.md +1 -1
  12. package/docs/adr/0030-serve-both-typert-codec-generations-from-one-codec.md +2 -2
  13. package/docs/adr/0032-own-session-log-facts-in-a-host-only-projection.md +31 -1
  14. package/docs/adr/0044-coexist-with-the-official-persistent-repl.md +4 -4
  15. package/docs/adr/0045-customize-model-visible-prompt-text.md +38 -0
  16. package/docs/adr/0046-gate-the-commit-with-the-semantic-evidence-tier.md +35 -0
  17. package/docs/adr/0047-store-journal-argument-digests-in-the-projection.md +88 -0
  18. package/docs/adr/0048-supersede-a-rewritten-cell.md +48 -0
  19. package/docs/adr/0049-prove-a-settlement-against-its-published-record.md +53 -0
  20. package/docs/adr/0050-read-host-surfaces-through-their-published-contract.md +48 -0
  21. package/docs/adr/README.md +7 -1
  22. package/docs/architecture.md +3 -3
  23. package/docs/client-ui.md +5 -2
  24. package/docs/durability-design.md +15 -2
  25. package/docs/installation.md +9 -9
  26. package/docs/releases/v0.5.2.md +91 -0
  27. package/docs/releases/v0.5.3.md +77 -0
  28. package/docs/runtime-reference.md +43 -3
  29. package/docs/unmeasured-cell-recovery-repair-proposal.md +387 -0
  30. package/docs/user-bindings.en.md +15 -0
  31. package/docs/user-bindings.md +15 -0
  32. package/docs/v0.5.3-goals.md +117 -0
  33. package/docs/verification.md +7 -3
  34. package/index.js +100 -31
  35. package/internal/binding-adoption.js +136 -0
  36. package/internal/bounded-literal.js +85 -0
  37. package/internal/capability-command-receipt.js +18 -4
  38. package/internal/capability-delivery-proof.js +70 -0
  39. package/internal/capability-environment.js +200 -11
  40. package/internal/capability-plan.js +11 -8
  41. package/internal/cell-error.js +13 -0
  42. package/internal/config-spec.js +126 -6
  43. package/internal/cordis-tools-owner.js +2 -1
  44. package/internal/direct-surface-owner.js +39 -21
  45. package/internal/edit-transport-owner.js +81 -15
  46. package/internal/execution-provider-owner.js +6 -0
  47. package/internal/execution-seam-compat.js +25 -0
  48. package/internal/host-tool-sdk.js +308 -0
  49. package/internal/isolated-worker.js +134 -17
  50. package/internal/kernel-worker.js +167 -3
  51. package/internal/legacy-cell-analysis.js +14 -2
  52. package/internal/legacy-repl-convenience.js +16 -3
  53. package/internal/official-repl-priority.js +31 -10
  54. package/internal/program-bindings.js +12 -1
  55. package/internal/projection-retention.js +238 -0
  56. package/internal/prompt-text.js +858 -0
  57. package/internal/recovery-tips.js +50 -11
  58. package/internal/rejected-cell-editor.js +3 -2
  59. package/internal/repl-memory-projection.js +21 -2
  60. package/internal/runtime-bridge-owner.js +114 -9
  61. package/internal/runtime-config.js +2 -0
  62. package/internal/runtime-contexts.js +14 -5
  63. package/internal/runtime-messages.js +48 -15
  64. package/internal/session-cell-executor.js +132 -11
  65. package/internal/session-journal-recovery.js +1204 -116
  66. package/internal/session-journal-schema.js +10 -5
  67. package/internal/session-journal.js +214 -14
  68. package/internal/session-log-view.js +133 -26
  69. package/internal/session-runtime.js +746 -38
  70. package/internal/session-state.js +27 -0
  71. package/internal/stateful-root-compiler.js +11 -0
  72. package/internal/stateful-root-runtime.js +17 -0
  73. package/internal/user-binding-console.js +7 -0
  74. package/internal/user-bindings-owner.js +112 -6
  75. package/internal/user-bindings.js +2 -2
  76. package/internal/validated-parse-repair.js +6 -1
  77. package/internal/worker-client.js +27 -4
  78. package/package.json +16 -6
  79. package/src/client-activity.js +24 -4
  80. package/src/client-capabilities-view.js +504 -27
  81. package/src/client-copy.js +187 -2
  82. package/src/client-indicator-view.js +2 -1
  83. package/src/client-repl-view.js +35 -11
  84. package/src/client-styles.js +64 -2
  85. package/src/client.js +3 -1
package/client.cjs CHANGED
@@ -1208,6 +1208,582 @@ function changeCapabilityRule(policy, id2, dimension, choice) {
1208
1208
  return validateCapabilityPolicy(next);
1209
1209
  }
1210
1210
 
1211
+ // internal/repl-rewrite-contract.js
1212
+ var MIXED_REDECLARATION_REWRITE = "split a mixed top-level declaration while preserving native pattern initialization";
1213
+ var FUNCTION_REDECLARATION_REWRITE = "reassigned an existing top-level function declaration for REPL continuity";
1214
+ var CLASS_REDECLARATION_REWRITE = "reassigned an existing top-level class declaration for REPL continuity";
1215
+ var LEGACY_DEFAULT_EXPORT_BINDING = "legacy-variable";
1216
+ var LIVE_DEFAULT_EXPORT_BINDING = "live-readonly";
1217
+ var LEGACY_IMPORT_EXPRESSION_BOUNDARY = "legacy";
1218
+ var LIVE_IMPORT_EXPRESSION_BOUNDARY = "statement-safe";
1219
+ var LIVE_MODULE_SEMANTICS = Object.freeze({
1220
+ defaultExportBinding: LIVE_DEFAULT_EXPORT_BINDING,
1221
+ importExpressionBoundary: LIVE_IMPORT_EXPRESSION_BOUNDARY
1222
+ });
1223
+
1224
+ // internal/prompt-text.js
1225
+ var PROMPT_TEXT_SCHEMA = "ptc-prompt-text/v1";
1226
+ var PROMPT_TEXT_MAX_SLOT_BYTES = 4096;
1227
+ var PROMPT_TEXT_MAX_ANCHOR_BYTES = 16384;
1228
+ var PROMPT_TEXT_MAX_DOCUMENT_BYTES = 65536;
1229
+ var PROMPT_CHANNELS = Object.freeze(["prompt", "install", "plan", "runtime", "result"]);
1230
+ var PROMPT_SLOT_KINDS = Object.freeze(["literal", "aggregate", "projected"]);
1231
+ var PROMPT_REASON_CODES = Object.freeze([
1232
+ "fact-derived",
1233
+ "aggregate-frozen",
1234
+ "protocol-exact-text",
1235
+ "protocol-structural",
1236
+ "shadows-host",
1237
+ "other-owner"
1238
+ ]);
1239
+ var STATE_PREFIX = "PTC Plus recovery status. Replaces earlier PTC recovery status, including PTC state in runtime-context snapshots. Global binding APIs are unchanged.";
1240
+ var PREVIOUS_STATE_PREFIX = "PTC Plus runtime recovery state. This replaces only earlier PTC state snapshots and PTC sections in historical aggregate snapshots; it does not replace the global binding API catalog, tasks, Skill instructions, tool results, or other producers.";
1241
+ var LEGACY_STATE_PREFIX = "PTC Plus current state. This replaces only earlier PTC state snapshots and PTC sections in historical aggregate snapshots; it does not replace tasks, Skill instructions, tool results, or other producers.";
1242
+ var CATALOG_PREFIX = "Global binding API reference for run_code (replaces the previous global binding reference):";
1243
+ var EMPTY_CATALOG = "No entries documented.";
1244
+ var TIP_BODY = "Inspect bounded runtime facts with {platformFacts}, then choose the executable and path in the current execution world. Use direct argv or a shell only when required; do not assume Windows, WSL, POSIX, or one shell. Do not dump process.env.";
1245
+ var TIP_BODY_PLATFORM_DETAILED = "Re-check the active execution world and the actual executable before retrying. First inspect bounded runtime facts with {platformFacts}; use the result to choose the executable and path. Use direct argv for a normal executable; use a shell only when its syntax or resolution is required. Windows, WSL, POSIX, and package shims have different paths and launch rules. Do not dump process.env.";
1246
+ var TIP_BODY_REPEATED_BINDING = "Inspect the visible cell source and results for the local name, scope, initialization, or declaration conflict. Correct that expression before continuing; capability discovery does not list session-local variables.{detail}";
1247
+ var TIP_BODY_REPEATED_BINDING_CAPABILITY = "Inspect the live request with `capabilities.tree()`, `capabilities.find()`, or `capabilities.inspect()`, then call the typed member through `tools.*`.{detail}";
1248
+ var TIP_DETAIL_BINDING = " Earlier statements may have run; use current expression evidence without assuming a failed declaration initialized its binding.";
1249
+ var TIP_DETAIL_CAPABILITY = " Do not invent hidden bindings or repeat the same failing expression.";
1250
+ var TIP_PREFIX_REPEATED_BINDING = "The same binding failure has recurred.";
1251
+ var TIP_PREFIX_PLATFORM_COMMAND = "An executable, shell, or path failed in the current execution world.";
1252
+ var PLAN_NAVIGATION = "Use capabilities.search({query}) to retrieve complete tool, Skill and MCP contracts. Unlisted capabilities remain discoverable. Skill descriptions are summaries; follow each Skill's declared invocation eligibility to load its body before following it.";
1253
+ var PLAN_CATEGORY_LINES = Object.freeze({
1254
+ tool: "Tools: search by task or tools.<name> for parameters and results.",
1255
+ skill: "Skills: search by task or skills.<name> for when to use and how to load instructions.",
1256
+ resource: "MCP resources: search by server or resource purpose.",
1257
+ "resource-template": "MCP templates: search by server or resource purpose.",
1258
+ task: "Tasks: search by the operation you need."
1259
+ });
1260
+ var PLAN_OVERAGE = "Explicit full contracts exceed the configured budget by {overageBytes} UTF-8 bytes.";
1261
+ var RESULT_ENVELOPE = "output exceeded {maxOutputBytes} bytes; this cell was discarded and the worker reset. Only bindings in the verified recovery frontier can be restored. External effects may already have occurred and are not undone. For future cells, bound console output and return a smaller value; do not assume this cell's values remain available.";
1262
+ var GUIDANCE_OPENING = "`run_code` continues one persistent PTC REPL. Use Node.js modules in the cell; use external processes when their environment is needed. Ordinary top-level bindings remain available to later cells, so reuse them instead of resending setup code. Choose the smallest cell that answers the request and return only the value the next step needs.";
1263
+ var GUIDANCE_ERROR_RECOVERY = "After an execution error, earlier statements may have taken effect. Inspect relevant values in a short cell, then continue from them; repeat external operations only when their retry rules and current results establish safety. `edit_run_code` edits and reruns a complete cell.";
1264
+ var GUIDANCE_CELL_CONVENTIONS = "## Cell conventions\nUse `return` for an explicit result and `console` for logs. Return supported values directly, including undefined, NaN, infinities, -0 and BigInt; JSON.stringify loses distinctions or rejects BigInt. Do not mix BigInt with Number arithmetic; use a BigInt literal or convert explicitly. Keep functions, Date, Map and other unsupported values in bindings; return needed data or type observations. Native `tools.*` arguments must satisfy their own JSON schemas; PTC value transport does not widen those contracts. Keep large inspection results in bindings or reduce them to targeted excerpts: `tools.read` is bounded inspection, not a lossless whole-file reader. Relative filesystem, path and default child-process operations use the current working directory at the time they run; a successful in-cell `tools.working_directory({ cd })` applies to the rest of that cell, while cell imports and `import.meta` keep the directory the cell started in, and `process.chdir` is unavailable.";
1265
+ var GUIDANCE_CAPABILITIES = "## Available capabilities\nUse `capabilities.tree()`, `capabilities.find()`, and `capabilities.inspect()` for unfamiliar program APIs; Reserve `code.run` for isolated execution of source held as data.\nProgram API references expire when their cell ends. Reusable helpers must read the current namespace when called, for example `async function readNow(args) { return tools.read(args) }`, instead of retaining an earlier `tools` object or method. Completed-cell callbacks cannot call program APIs.";
1266
+ var GUIDANCE_EXECUTION_WORLD = "Native tool availability depends on the current DSH profile and execution world; inspect executables, shells, and paths instead of assuming Windows, WSL, POSIX, or a particular shell.";
1267
+ var RUN_CODE_TOOL_DESCRIPTION = "Evaluate the next TypeScript cell in this session-bound persistent REPL, reusing earlier top-level bindings. Use `code` for the cell and `description` for its short UI summary. Successful image-bearing subtool results are attached after the cell.";
1268
+ var RUN_CODE_CODE_DESCRIPTION = "Code for the next PTC TypeScript cell, following the selected language conventions.";
1269
+ var RUN_CODE_DESCRIPTION_DESCRIPTION = "Short active-voice summary of what this cell does, 5-10 words (shown in the UI).";
1270
+ var EDIT_RUN_CODE_DESCRIPTION = "Call this from within a run_code cell. It accepts an edit of the most recent eligible cell captured at nested dispatch and returns { accepted, scheduled, target_call_seq } when scheduled. The corrected cell runs after the current run_code cell releases its worker; its result is reported with that cell, and a successful edit becomes the next target. This reruns the entire target cell, including prior effects; use it after pre-execution rejection or when repeating those effects is safe under the called API's retry rules. Otherwise continue in a new run_code cell using retained values. A diagnostic may supply a localized correction; use it when it matches your intent and preserve its expected_target_call_seq. Send exactly one edits or regex_edits array: edits replaces unique literal fragments; regex_edits replaces a counted set of pattern matches. All ranges must be non-overlapping in the original cell. Regex replacements use JavaScript $1/$<name> captures, not \\1.";
1271
+ var USER_BINDINGS_ENTRY_LABEL = "Binding";
1272
+ function editableSlot(id2, kind, omittable, defaultText) {
1273
+ if (!PROMPT_SLOT_KINDS.includes(kind)) throw new TypeError(`ptc-plus: unknown prompt slot kind ${kind} (${id2})`);
1274
+ return Object.freeze({
1275
+ id: id2,
1276
+ kind,
1277
+ owner: "A",
1278
+ level: "prose",
1279
+ reason: null,
1280
+ omittable,
1281
+ defaultText,
1282
+ source: "registry-literal"
1283
+ });
1284
+ }
1285
+ function readOnlySlot(id2, kind, reason, { source, defaultText = null, omittable = false, owner = "B" }) {
1286
+ if (!PROMPT_SLOT_KINDS.includes(kind)) throw new TypeError(`ptc-plus: unknown prompt slot kind ${kind} (${id2})`);
1287
+ if (!PROMPT_REASON_CODES.includes(reason)) throw new TypeError(`ptc-plus: unknown prompt reason code ${reason}`);
1288
+ if (owner !== "B" && owner !== "C") throw new TypeError(`ptc-plus: read-only slot ${id2} must belong to B or C`);
1289
+ return Object.freeze({
1290
+ id: id2,
1291
+ kind,
1292
+ owner,
1293
+ level: "protocol",
1294
+ reason,
1295
+ omittable,
1296
+ defaultText,
1297
+ source
1298
+ });
1299
+ }
1300
+ function aggregateSlot(id2, items) {
1301
+ return Object.freeze({
1302
+ id: id2,
1303
+ kind: "aggregate",
1304
+ owner: "B",
1305
+ level: "protocol",
1306
+ reason: "aggregate-frozen",
1307
+ omittable: false,
1308
+ defaultText: null,
1309
+ source: "registry-set",
1310
+ items: Object.freeze(items)
1311
+ });
1312
+ }
1313
+ var PROMPT_ANCHORS = Object.freeze([
1314
+ Object.freeze({
1315
+ id: "tools:ptc-plus-repl",
1316
+ channel: "prompt",
1317
+ wired: true,
1318
+ presence: "run_code \u5DF2\u6CE8\u518C",
1319
+ slots: Object.freeze([
1320
+ editableSlot("guidance.opening", "literal", false, GUIDANCE_OPENING),
1321
+ editableSlot("guidance.errorRecovery", "literal", true, GUIDANCE_ERROR_RECOVERY),
1322
+ editableSlot("guidance.cellConventions", "literal", true, GUIDANCE_CELL_CONVENTIONS),
1323
+ editableSlot("guidance.capabilities", "literal", true, GUIDANCE_CAPABILITIES),
1324
+ editableSlot("guidance.executionWorld", "literal", true, GUIDANCE_EXECUTION_WORLD),
1325
+ readOnlySlot("guidance.derivedPolicy", "projected", "fact-derived", {
1326
+ source: "internal/binding-update-policy.js guidancePolicies()"
1327
+ })
1328
+ ])
1329
+ }),
1330
+ Object.freeze({
1331
+ id: "tools:ptc-plus-user-binding-defaults",
1332
+ channel: "prompt",
1333
+ wired: true,
1334
+ presence: "\u5168\u5C40\u7ED1\u5B9A\u542F\u7528",
1335
+ slots: Object.freeze([
1336
+ editableSlot("userBindings.entryLabel", "literal", false, USER_BINDINGS_ENTRY_LABEL),
1337
+ readOnlySlot("userBindings.entryInstructions", "literal", "other-owner", {
1338
+ owner: "C",
1339
+ source: "internal/user-bindings.js (entry instructions supplied by the user)"
1340
+ })
1341
+ ])
1342
+ }),
1343
+ Object.freeze({
1344
+ id: "run_code",
1345
+ channel: "prompt",
1346
+ wired: true,
1347
+ presence: "\u6BCF\u6B21\u8BF7\u6C42",
1348
+ slots: Object.freeze([
1349
+ editableSlot("runCode.description", "literal", false, RUN_CODE_TOOL_DESCRIPTION),
1350
+ editableSlot("runCode.codeArg", "literal", false, RUN_CODE_CODE_DESCRIPTION),
1351
+ editableSlot("runCode.descriptionArg", "literal", false, RUN_CODE_DESCRIPTION_DESCRIPTION)
1352
+ ])
1353
+ }),
1354
+ Object.freeze({
1355
+ id: "edit_run_code",
1356
+ channel: "install",
1357
+ wired: true,
1358
+ presence: "\u4E0B\u4E00\u6B21 agent \u5B89\u88C5",
1359
+ slots: Object.freeze([
1360
+ editableSlot("editRunCode.description", "literal", false, EDIT_RUN_CODE_DESCRIPTION)
1361
+ ])
1362
+ }),
1363
+ Object.freeze({
1364
+ id: "binding-catalog",
1365
+ channel: "runtime",
1366
+ wired: true,
1367
+ presence: "\u6709\u7ED1\u5B9A\u6761\u76EE",
1368
+ slots: Object.freeze([
1369
+ readOnlySlot("catalog.prefix", "literal", "protocol-exact-text", { source: "registry-literal", defaultText: CATALOG_PREFIX }),
1370
+ editableSlot("catalog.empty", "literal", false, EMPTY_CATALOG),
1371
+ // The previous-generation empty sentence is historical wording, not delivered
1372
+ // text: no composer emits it, and `HISTORICAL_EMPTY_CATALOGS` keeps it readable
1373
+ // for records written by another version. It is therefore deliberately not a
1374
+ // slot — an editable slot nobody delivers would inflate the accounting.
1375
+ readOnlySlot("catalog.entryInstructions", "literal", "other-owner", {
1376
+ owner: "C",
1377
+ source: "internal/user-bindings.js (entry instructions supplied by the user)"
1378
+ })
1379
+ ])
1380
+ }),
1381
+ Object.freeze({
1382
+ id: "tools:sdk#capability-appendix",
1383
+ channel: "prompt",
1384
+ wired: false,
1385
+ presence: "\u80FD\u529B\u7BA1\u7406\u542F\u7528",
1386
+ slots: Object.freeze([
1387
+ readOnlySlot("capabilities.appendixProse", "literal", "shadows-host", {
1388
+ source: "internal/direct-surface-owner.js capabilitySdk()"
1389
+ }),
1390
+ readOnlySlot("capabilities.declarations", "literal", "protocol-structural", {
1391
+ source: "internal/direct-surface-owner.js capabilitySdk() declare block"
1392
+ })
1393
+ ])
1394
+ }),
1395
+ Object.freeze({
1396
+ id: "plan.navigation",
1397
+ channel: "plan",
1398
+ wired: true,
1399
+ presence: "\u65B0\u4F1A\u8BDD\u6216 /capabilities refresh",
1400
+ slots: Object.freeze([
1401
+ editableSlot("plan.navigationSentence", "literal", false, PLAN_NAVIGATION)
1402
+ ])
1403
+ }),
1404
+ Object.freeze({
1405
+ id: "plan.categories",
1406
+ channel: "plan",
1407
+ wired: true,
1408
+ presence: "\u65B0\u4F1A\u8BDD\u6216 /capabilities refresh",
1409
+ slots: Object.freeze([
1410
+ aggregateSlot("plan.categories.set", Object.keys(PLAN_CATEGORY_LINES).map((category) => `plan.category.${category}`)),
1411
+ ...Object.entries(PLAN_CATEGORY_LINES).map(([category, line]) => editableSlot(`plan.category.${category}`, "literal", false, line))
1412
+ ])
1413
+ }),
1414
+ Object.freeze({
1415
+ id: "plan.overage",
1416
+ channel: "plan",
1417
+ wired: true,
1418
+ presence: "\u9884\u7B97\u8D85\u9650\u65F6",
1419
+ slots: Object.freeze([
1420
+ editableSlot("plan.overageSentence", "projected", false, PLAN_OVERAGE)
1421
+ ])
1422
+ }),
1423
+ Object.freeze({
1424
+ id: "runtime.recovery-snapshot",
1425
+ channel: "runtime",
1426
+ wired: true,
1427
+ presence: "\u6062\u590D\u4EE3\u9645\u89E6\u53D1",
1428
+ slots: Object.freeze([
1429
+ readOnlySlot("recovery.snapshotPrefix", "literal", "protocol-exact-text", { source: "registry-literal", defaultText: STATE_PREFIX }),
1430
+ readOnlySlot("recovery.previousStatePrefix", "literal", "protocol-exact-text", { source: "registry-literal", defaultText: PREVIOUS_STATE_PREFIX }),
1431
+ readOnlySlot("recovery.legacyStatePrefix", "literal", "protocol-exact-text", { source: "registry-literal", defaultText: LEGACY_STATE_PREFIX })
1432
+ ])
1433
+ }),
1434
+ Object.freeze({
1435
+ id: "runtime.tip",
1436
+ channel: "runtime",
1437
+ wired: true,
1438
+ presence: "\u89E6\u53D1\u547D\u4E2D",
1439
+ slots: Object.freeze([
1440
+ editableSlot("tip.body.platform", "projected", false, TIP_BODY),
1441
+ editableSlot("tip.body.platformDetailed", "projected", false, TIP_BODY_PLATFORM_DETAILED),
1442
+ editableSlot("tip.body.repeatedBinding", "projected", false, TIP_BODY_REPEATED_BINDING),
1443
+ editableSlot("tip.body.repeatedBindingCapability", "projected", false, TIP_BODY_REPEATED_BINDING_CAPABILITY),
1444
+ readOnlySlot("tip.prefix.repeatedBinding", "literal", "protocol-structural", {
1445
+ source: "registry-literal",
1446
+ defaultText: TIP_PREFIX_REPEATED_BINDING
1447
+ }),
1448
+ readOnlySlot("tip.prefix.platformCommand", "literal", "protocol-structural", {
1449
+ source: "registry-literal",
1450
+ defaultText: TIP_PREFIX_PLATFORM_COMMAND
1451
+ }),
1452
+ // The detail sentences fill the body's `{detail}` hole when a failure escalates.
1453
+ // Escalation stays a code decision; the sentences are registered so their bytes
1454
+ // are accounted and claimed rather than silently delivered outside the registry.
1455
+ readOnlySlot("tip.detail.binding", "projected", "fact-derived", {
1456
+ source: "registry-literal",
1457
+ defaultText: TIP_DETAIL_BINDING
1458
+ }),
1459
+ readOnlySlot("tip.detail.capability", "projected", "fact-derived", {
1460
+ source: "registry-literal",
1461
+ defaultText: TIP_DETAIL_CAPABILITY
1462
+ })
1463
+ ])
1464
+ }),
1465
+ Object.freeze({
1466
+ id: "result.rewrite-feedback",
1467
+ channel: "result",
1468
+ wired: true,
1469
+ presence: "\u6539\u5199\u53D1\u751F",
1470
+ slots: Object.freeze([
1471
+ editableSlot("rewrite.mixed", "literal", false, MIXED_REDECLARATION_REWRITE),
1472
+ editableSlot("rewrite.function", "literal", false, FUNCTION_REDECLARATION_REWRITE),
1473
+ editableSlot("rewrite.class", "literal", false, CLASS_REDECLARATION_REWRITE)
1474
+ ])
1475
+ }),
1476
+ Object.freeze({
1477
+ id: "result.diagnostics-and-budget",
1478
+ channel: "result",
1479
+ wired: true,
1480
+ presence: "\u5931\u8D25\u6216\u8D85\u9650",
1481
+ slots: Object.freeze([
1482
+ readOnlySlot("result.diagnosticsProse", "literal", "fact-derived", {
1483
+ source: "internal/recovery-tips.js advice and budget prose"
1484
+ }),
1485
+ readOnlySlot("result.diagnosticsCodes", "literal", "protocol-structural", {
1486
+ source: "internal/session-journal-schema.js PTC-* codes and help structure"
1487
+ }),
1488
+ // The envelope template is measured (the plugin writes every byte of it)
1489
+ // but not writable: the recognizer reads the byte count it reports.
1490
+ readOnlySlot("result.envelope", "projected", "fact-derived", {
1491
+ source: "registry-literal",
1492
+ defaultText: RESULT_ENVELOPE
1493
+ })
1494
+ ])
1495
+ })
1496
+ ]);
1497
+ var PROMPT_SLOTS = Object.freeze(PROMPT_ANCHORS.flatMap((anchor) => anchor.slots));
1498
+ var slotConstantName = (id2) => id2.replace(/[.:-]+(.)?/gu, (_, next) => (next ?? "").toUpperCase());
1499
+ var PROMPT_SLOT_IDS = Object.freeze(Object.fromEntries(
1500
+ PROMPT_SLOTS.filter((slot) => slot.source === "registry-literal").map((slot) => [slotConstantName(slot.id), slot.id])
1501
+ ));
1502
+ var PROMPT_ASSETS = PROMPT_SLOTS;
1503
+ var ANCHORS_BY_ID = new Map(PROMPT_ANCHORS.map((anchor) => [anchor.id, anchor]));
1504
+ var SLOTS_BY_ID = new Map(PROMPT_SLOTS.map((slot) => [slot.id, slot]));
1505
+ var ANCHOR_OF_SLOT = new Map(PROMPT_ANCHORS.flatMap((anchor) => anchor.slots.map((slot) => [slot.id, anchor.id])));
1506
+ var PROMPT_TEXT_DEFAULT = JSON.stringify({ schema: PROMPT_TEXT_SCHEMA, overrides: {} });
1507
+ var PROMPT_COMPOSER_FILES = Object.freeze([
1508
+ "index.js",
1509
+ "internal/direct-surface-owner.js",
1510
+ "internal/edit-transport-owner.js",
1511
+ "internal/capability-plan.js",
1512
+ "internal/capability-environment.js",
1513
+ "internal/runtime-messages.js",
1514
+ "internal/recovery-tips.js"
1515
+ ]);
1516
+ function promptSlot(id2) {
1517
+ const slot = SLOTS_BY_ID.get(id2);
1518
+ if (slot === void 0) throw new TypeError(`ptc-plus: unknown prompt slot ${id2}`);
1519
+ return slot;
1520
+ }
1521
+ var byteLength = (value) => new TextEncoder().encode(value).length;
1522
+ var holeTokens = (text) => typeof text === "string" ? text.match(/\{[a-zA-Z][a-zA-Z0-9]*\}/gu) ?? [] : [];
1523
+ function effectiveBytes(slot, overrides2) {
1524
+ const text = overrides2.has(slot.id) ? overrides2.get(slot.id) : slot.defaultText;
1525
+ return typeof text === "string" ? byteLength(text) : 0;
1526
+ }
1527
+ function sumEffectiveBytes(overrides2) {
1528
+ let total = 0;
1529
+ for (const slot of PROMPT_SLOTS) total += effectiveBytes(slot, overrides2);
1530
+ return total;
1531
+ }
1532
+ function unknownOverrideBytes(overrides2) {
1533
+ let total = 0;
1534
+ for (const [id2, text] of overrides2) {
1535
+ if (SLOTS_BY_ID.has(id2)) continue;
1536
+ total += byteLength(text);
1537
+ }
1538
+ return total;
1539
+ }
1540
+ function isRecord2(value) {
1541
+ return value !== null && typeof value === "object" && !Array.isArray(value);
1542
+ }
1543
+ function parsePromptTextDocument(value) {
1544
+ if (typeof value !== "string") throw new TypeError("ptc-plus: promptText must be a JSON string");
1545
+ let parsed;
1546
+ try {
1547
+ parsed = JSON.parse(value);
1548
+ } catch {
1549
+ throw new TypeError("ptc-plus: promptText must contain valid JSON");
1550
+ }
1551
+ if (!isRecord2(parsed) || parsed.schema !== PROMPT_TEXT_SCHEMA || !isRecord2(parsed.overrides)) {
1552
+ throw new TypeError(`ptc-plus: promptText must be a ${PROMPT_TEXT_SCHEMA} document with an overrides object`);
1553
+ }
1554
+ for (const [id2, text] of Object.entries(parsed.overrides)) {
1555
+ if (!id2.trim()) throw new TypeError("ptc-plus: promptText override ids must not be empty");
1556
+ if (typeof text !== "string") throw new TypeError(`ptc-plus: promptText override ${id2} must be a string`);
1557
+ }
1558
+ return parsed;
1559
+ }
1560
+ function validatePromptTextDocument(value) {
1561
+ const parsed = parsePromptTextDocument(value);
1562
+ const overrides2 = /* @__PURE__ */ new Map();
1563
+ for (const [id2, text] of Object.entries(parsed.overrides)) {
1564
+ const slot = SLOTS_BY_ID.get(id2);
1565
+ if (slot === void 0) {
1566
+ overrides2.set(id2, text);
1567
+ continue;
1568
+ }
1569
+ if (slot.owner !== "A") {
1570
+ throw new TypeError(`ptc-plus: promptText slot ${id2} is read-only (${slot.reason}); its bytes belong to another owner`);
1571
+ }
1572
+ const bytes = byteLength(text);
1573
+ if (bytes > PROMPT_TEXT_MAX_SLOT_BYTES) {
1574
+ throw new TypeError(`ptc-plus: promptText slot ${id2} would deliver ${bytes} bytes, over the ${PROMPT_TEXT_MAX_SLOT_BYTES} byte slot limit`);
1575
+ }
1576
+ if (text.trim().length === 0 && !slot.omittable) {
1577
+ throw new TypeError(`ptc-plus: promptText slot ${id2} must not be empty`);
1578
+ }
1579
+ if (slot.kind === "projected") {
1580
+ for (const hole of holeTokens(slot.defaultText)) {
1581
+ if (text.split(hole).length - 1 !== 1) {
1582
+ throw new TypeError(`ptc-plus: promptText slot ${id2} must keep exactly one ${hole} placeholder`);
1583
+ }
1584
+ }
1585
+ }
1586
+ overrides2.set(id2, text);
1587
+ }
1588
+ for (const anchor of PROMPT_ANCHORS) {
1589
+ let total = 0;
1590
+ for (const slot of anchor.slots) {
1591
+ total += effectiveBytes(slot, overrides2);
1592
+ if (total > PROMPT_TEXT_MAX_ANCHOR_BYTES) {
1593
+ throw new TypeError(`ptc-plus: promptText anchor ${anchor.id} would deliver ${total} bytes, over the ${PROMPT_TEXT_MAX_ANCHOR_BYTES} byte anchor limit (at slot ${slot.id})`);
1594
+ }
1595
+ }
1596
+ }
1597
+ let document2 = sumEffectiveBytes(overrides2) + unknownOverrideBytes(overrides2);
1598
+ if (document2 > PROMPT_TEXT_MAX_DOCUMENT_BYTES) {
1599
+ throw new TypeError(`ptc-plus: promptText would deliver ${document2} bytes, over the ${PROMPT_TEXT_MAX_DOCUMENT_BYTES} byte document limit`);
1600
+ }
1601
+ return parsed;
1602
+ }
1603
+ function resolvePromptText(value) {
1604
+ const overrides2 = /* @__PURE__ */ new Map();
1605
+ const reported = [];
1606
+ if (value !== void 0 && typeof value !== "string") {
1607
+ reported.push({ slotId: void 0, anchorId: void 0, reason: "invalid-document-type" });
1608
+ return freezeResolved(overrides2, reported);
1609
+ }
1610
+ let parsed;
1611
+ try {
1612
+ parsed = parsePromptTextDocument(value ?? PROMPT_TEXT_DEFAULT);
1613
+ } catch (error) {
1614
+ reported.push({ slotId: void 0, anchorId: void 0, reason: error.message });
1615
+ return freezeResolved(overrides2, reported);
1616
+ }
1617
+ const anchorTotals = /* @__PURE__ */ new Map();
1618
+ let document2 = 0;
1619
+ for (const [id2, text] of Object.entries(parsed.overrides)) {
1620
+ const bytes = byteLength(text);
1621
+ const slot = SLOTS_BY_ID.get(id2);
1622
+ if (slot === void 0) {
1623
+ document2 += bytes;
1624
+ reported.push({ slotId: id2, anchorId: void 0, reason: "unknown-slot" });
1625
+ continue;
1626
+ }
1627
+ const anchorId = ANCHOR_OF_SLOT.get(id2);
1628
+ if (slot.owner !== "A") {
1629
+ reported.push({ slotId: id2, anchorId, reason: "not-writable" });
1630
+ continue;
1631
+ }
1632
+ if (bytes > PROMPT_TEXT_MAX_SLOT_BYTES) {
1633
+ reported.push({ slotId: id2, anchorId, reason: "slot-exceeds-limit" });
1634
+ continue;
1635
+ }
1636
+ if (text.trim().length === 0 && !slot.omittable) {
1637
+ reported.push({ slotId: id2, anchorId, reason: "required-slot-empty" });
1638
+ continue;
1639
+ }
1640
+ if (slot.kind === "projected") {
1641
+ const holes = holeTokens(slot.defaultText ?? "");
1642
+ const kept = holes.filter((hole) => text.includes(hole));
1643
+ const duplicates = kept.some((hole) => text.split(hole).length - 1 > 1);
1644
+ if (holes.length > 0 && (kept.length !== holes.length || duplicates)) {
1645
+ reported.push({ slotId: id2, anchorId, reason: "missing-hole" });
1646
+ continue;
1647
+ }
1648
+ }
1649
+ const total = (anchorTotals.get(anchorId) ?? 0) + bytes;
1650
+ if (total > PROMPT_TEXT_MAX_ANCHOR_BYTES) {
1651
+ reported.push({ slotId: id2, anchorId, reason: "anchor-exceeds-limit" });
1652
+ continue;
1653
+ }
1654
+ anchorTotals.set(anchorId, total);
1655
+ overrides2.set(id2, text);
1656
+ document2 += bytes;
1657
+ }
1658
+ if (document2 > PROMPT_TEXT_MAX_DOCUMENT_BYTES) {
1659
+ reported.push({ slotId: void 0, anchorId: void 0, reason: "document-exceeds-limit" });
1660
+ overrides2.clear();
1661
+ }
1662
+ enforceEffectiveCeilings(overrides2, reported);
1663
+ return freezeResolved(overrides2, reported);
1664
+ }
1665
+ function enforceEffectiveCeilings(overrides2, reported) {
1666
+ for (const anchor of PROMPT_ANCHORS) {
1667
+ const overridden = anchor.slots.filter((slot) => overrides2.has(slot.id));
1668
+ if (overridden.length === 0) continue;
1669
+ const total = anchor.slots.reduce((sum, slot) => sum + effectiveBytes(slot, overrides2), 0);
1670
+ if (total <= PROMPT_TEXT_MAX_ANCHOR_BYTES) continue;
1671
+ for (const slot of overridden) {
1672
+ reported.push({ slotId: slot.id, anchorId: anchor.id, reason: "anchor-exceeds-limit" });
1673
+ overrides2.delete(slot.id);
1674
+ }
1675
+ }
1676
+ if (sumEffectiveBytes(overrides2) + unknownOverrideBytes(overrides2) <= PROMPT_TEXT_MAX_DOCUMENT_BYTES) return;
1677
+ for (const id2 of [...overrides2.keys()]) {
1678
+ reported.push({ slotId: id2, anchorId: ANCHOR_OF_SLOT.get(id2), reason: "document-exceeds-limit" });
1679
+ }
1680
+ overrides2.clear();
1681
+ }
1682
+ function freezeResolved(overrides2, reported) {
1683
+ const text = (id2) => {
1684
+ const slot = promptSlot(id2);
1685
+ if (overrides2.has(id2)) return overrides2.get(id2);
1686
+ return slot.defaultText;
1687
+ };
1688
+ return Object.freeze({
1689
+ text,
1690
+ omitted: (id2) => overrides2.get(id2) === "",
1691
+ overridden: (id2) => overrides2.has(id2),
1692
+ reported: Object.freeze(reported)
1693
+ });
1694
+ }
1695
+ function accountPromptText(resolved) {
1696
+ const slots = [];
1697
+ const anchors = [];
1698
+ const owners = { A: 0, B: 0, C: 0 };
1699
+ const counts = { pure: { A: 0, B: 0, C: 0 }, mixed: 0, total: 0 };
1700
+ const channels = /* @__PURE__ */ new Map();
1701
+ const slotsByOwner = { A: 0, B: 0, C: 0 };
1702
+ const unmeasuredByOwner = { A: 0, B: 0, C: 0 };
1703
+ const dynamicByOwner = { A: 0, B: 0, C: 0 };
1704
+ for (const anchor of PROMPT_ANCHORS) {
1705
+ const anchorOwners = /* @__PURE__ */ new Set();
1706
+ let anchorBytes = 0;
1707
+ const anchorSlots = [];
1708
+ for (const slot of anchor.slots) {
1709
+ const declared = resolved.text(slot.id);
1710
+ const container = slot.kind === "aggregate";
1711
+ const measured = !container && anchor.wired === true && typeof declared === "string";
1712
+ const bytes = measured ? byteLength(declared) : 0;
1713
+ const unwired = !container && !measured && anchor.wired !== true;
1714
+ const dynamic = !container && !measured && anchor.wired === true;
1715
+ anchorOwners.add(slot.owner);
1716
+ owners[slot.owner] += bytes;
1717
+ slotsByOwner[slot.owner] += 1;
1718
+ if (unwired) unmeasuredByOwner[slot.owner] += 1;
1719
+ if (dynamic) dynamicByOwner[slot.owner] += 1;
1720
+ anchorBytes += bytes;
1721
+ const row = Object.freeze({
1722
+ slotId: slot.id,
1723
+ anchorId: anchor.id,
1724
+ owner: slot.owner,
1725
+ reason: slot.reason,
1726
+ kind: slot.kind,
1727
+ bytes,
1728
+ measured,
1729
+ unwired,
1730
+ dynamic,
1731
+ overridden: resolved.overridden(slot.id)
1732
+ });
1733
+ slots.push(row);
1734
+ anchorSlots.push(row);
1735
+ }
1736
+ const pure = anchorOwners.size === 1 ? [...anchorOwners][0] : void 0;
1737
+ if (pure === void 0) counts.mixed += 1;
1738
+ else counts.pure[pure] += 1;
1739
+ counts.total += 1;
1740
+ const anchorUnmeasured = anchorSlots.filter((slot) => slot.unwired).length;
1741
+ const anchorDynamic = anchorSlots.filter((slot) => slot.dynamic).length;
1742
+ const perChannel = channels.get(anchor.channel) ?? { anchors: 0, wired: 0, bytes: 0, unmeasuredSlots: 0, dynamicSlots: 0 };
1743
+ perChannel.anchors += 1;
1744
+ if (anchor.wired === true) perChannel.wired += 1;
1745
+ perChannel.bytes += anchorBytes;
1746
+ perChannel.unmeasuredSlots += anchorUnmeasured;
1747
+ perChannel.dynamicSlots += anchorDynamic;
1748
+ channels.set(anchor.channel, perChannel);
1749
+ anchors.push(Object.freeze({
1750
+ anchorId: anchor.id,
1751
+ channel: anchor.channel,
1752
+ presence: anchor.presence,
1753
+ wired: anchor.wired === true,
1754
+ owner: pure ?? "mixed",
1755
+ bytes: anchorBytes,
1756
+ unmeasuredSlots: anchorUnmeasured,
1757
+ dynamicSlots: anchorDynamic,
1758
+ slots: Object.freeze(anchorSlots)
1759
+ }));
1760
+ }
1761
+ return Object.freeze({
1762
+ slots: Object.freeze(slots),
1763
+ anchors: Object.freeze(anchors),
1764
+ owners: Object.freeze(owners),
1765
+ channels: Object.freeze(PROMPT_CHANNELS.map((channel) => Object.freeze({
1766
+ channel,
1767
+ anchors: channels.get(channel)?.anchors ?? 0,
1768
+ wired: channels.get(channel)?.wired ?? 0,
1769
+ bytes: channels.get(channel)?.bytes ?? 0,
1770
+ unmeasuredSlots: channels.get(channel)?.unmeasuredSlots ?? 0,
1771
+ dynamicSlots: channels.get(channel)?.dynamicSlots ?? 0
1772
+ }))),
1773
+ counts: Object.freeze({
1774
+ pure: Object.freeze(counts.pure),
1775
+ mixed: counts.mixed,
1776
+ total: counts.total,
1777
+ slots: Object.freeze(slotsByOwner),
1778
+ unmeasured: Object.freeze(unmeasuredByOwner),
1779
+ dynamic: Object.freeze(dynamicByOwner),
1780
+ // Flat totals so a caller never sums two maps by hand.
1781
+ unmeasuredSlots: Object.values(unmeasuredByOwner).reduce((sum, value) => sum + value, 0),
1782
+ dynamicSlots: Object.values(dynamicByOwner).reduce((sum, value) => sum + value, 0)
1783
+ })
1784
+ });
1785
+ }
1786
+
1211
1787
  // internal/config-spec.js
1212
1788
  var MAX_TIMER_DELAY_MS = 2147483647;
1213
1789
  var SETTINGS_NAMESPACE = "ptc-plus";
@@ -1408,10 +1984,10 @@ var CONFIG_FIELDS = Object.freeze([
1408
1984
  type: "enum",
1409
1985
  options: Object.freeze(["stateful", "protected"]),
1410
1986
  default: "stateful",
1411
- label: "\u5141\u8BB8\u91CD\u58F0\u660E\u548C\u8986\u76D6",
1412
- labelEn: "Allow redeclarations and overrides",
1413
- description: "\u540C\u4E00\u4F5C\u7528\u57DF\u7684\u58F0\u660E\u548C\u8D4B\u503C\u53EF\u66F4\u65B0\u53D8\u91CF\u3001\u51FD\u6570\u3001\u7C7B\u53CA\u5BFC\u5165\u3002\u5173\u95ED\u540E\u68C0\u6D4B\u8DE8 cell \u91CD\u58F0\u660E\uFF0C\u5E76\u4FDD\u62A4\u65B0\u5EFA\u7684 const \u548C import\uFF1B\u9759\u6001 import/export \u59CB\u7EC8\u53EF\u7528\u3002",
1414
- descriptionEn: "Declarations and assignments update variables, functions, classes and imports in the same scope. Disabling detects cross-cell redeclarations and protects newly created const and import bindings; static import/export remains available."
1987
+ label: "\u8DE8 cell \u58F0\u660E\u7B56\u7565",
1988
+ labelEn: "Cross-cell declaration policy",
1989
+ description: "\u540C\u4E00\u4F5C\u7528\u57DF\u7684\u58F0\u660E\u548C\u8D4B\u503C\u53EF\u66F4\u65B0\u53D8\u91CF\u3001\u51FD\u6570\u3001\u7C7B\u53CA\u5BFC\u5165\u3002\u9009\u201C\u542F\u7528\u540D\u79F0\u4FDD\u62A4\u201D\u65F6\u6539\u4E3A\u68C0\u6D4B\u8DE8 cell \u91CD\u58F0\u660E\uFF0C\u5E76\u4FDD\u62A4\u65B0\u5EFA\u7684 const \u548C import\uFF1B\u9759\u6001 import/export \u59CB\u7EC8\u53EF\u7528\u3002",
1990
+ descriptionEn: "Declarations and assignments update variables, functions, classes and imports in the same scope. With \u201CProtect names\u201D selected, cross-cell redeclarations are detected instead and newly created const and import bindings are protected; static import/export remains available."
1415
1991
  },
1416
1992
  {
1417
1993
  key: "canonicalizeToolCalls",
@@ -1494,6 +2070,68 @@ var CONFIG_FIELDS = Object.freeze([
1494
2070
  description: "worker \u91CD\u542F\u540E\u4ECE session journal \u91CD\u5EFA\u53EF\u6062\u590D\u7684 REPL \u72B6\u6001\u3002",
1495
2071
  descriptionEn: "Rebuilds recoverable REPL state from the session journal after a worker restart."
1496
2072
  },
2073
+ {
2074
+ key: "retentionPayloadRuns",
2075
+ type: "integer",
2076
+ default: 8,
2077
+ min: 8,
2078
+ max: 512,
2079
+ label: "\u4FDD\u7559\u6700\u8FD1\u5355\u5143\u683C\u6570",
2080
+ labelEn: "Retained recent cells",
2081
+ description: "\u68C0\u67E5\u70B9\u4FDD\u7559\u6700\u8FD1\u591A\u5C11\u4E2A\u5355\u5143\u683C\u7684\u53C2\u6570\u539F\u6587\u3002\u8C03\u5927\u80FD\u76F4\u63A5\u7F16\u8F91\u66F4\u4E45\u4EE5\u524D\u7684\u8BA1\u7B97\uFF0C\u4F46\u68C0\u67E5\u70B9\u66F4\u5927\uFF1B\u66F4\u65E9\u7684\u5355\u5143\u683C\u9700\u8981\u4ECE\u4F1A\u8BDD\u65E5\u5FD7\u91CD\u65B0\u6298\u53E0\u624D\u80FD\u7F16\u8F91\u6216\u91CD\u65B0\u53D1\u5E03\u3002",
2082
+ descriptionEn: "How many recent cells keep their argument text in the checkpoint. A larger window keeps more history editable without a log read but grows the checkpoint; older cells must be refolded from the session log to be edited or republished."
2083
+ },
2084
+ {
2085
+ key: "retentionPayloadBytes",
2086
+ type: "integer",
2087
+ default: 8388608,
2088
+ min: 1048576,
2089
+ max: 16777216,
2090
+ label: "\u4FDD\u7559\u8F7D\u8377\u9884\u7B97 (UTF-8 bytes)",
2091
+ labelEn: "Retained payload budget (UTF-8 bytes)",
2092
+ description: "\u4FDD\u7559\u5355\u5143\u683C\u53C2\u6570\u539F\u6587\u7684\u7D2F\u8BA1\u4E0A\u9650\u3002\u8FBE\u5230\u4E0A\u9650\u540E\u6700\u65E7\u7684\u539F\u6587\u88AB\u79FB\u9664\uFF0C\u68C0\u67E5\u70B9\u4F53\u79EF\u56E0\u6B64\u4E0E\u4F1A\u8BDD\u5199\u5165\u603B\u91CF\u65E0\u5173\uFF1B\u5355\u4E2A\u8D85\u8FC7\u9884\u7B97\u7684\u5355\u5143\u683C\u4E5F\u4F1A\u88AB\u79FB\u9664\u5E76\u4ECE\u65E5\u5FD7\u91CD\u6298\u3002\u68C0\u67E5\u70B9\u4F53\u79EF\u7EA6\u4E3A\u672C\u9884\u7B97\u7684\u4E24\u500D\uFF0C\u4E0A\u9650 16 MiB \u5BF9\u5E94\u7EA6 32 MB \u7684\u6700\u574F\u60C5\u51B5\u3002",
2093
+ descriptionEn: "Cumulative budget for the retained argument text. Past it the oldest payload is removed, which keeps the checkpoint independent of how much the session wrote; a single cell larger than the budget is removed as well and refolded from the log. A checkpoint is roughly twice this budget, so the 16 MiB maximum bounds the worst case near 32 MB."
2094
+ },
2095
+ {
2096
+ key: "retentionClusters",
2097
+ type: "integer",
2098
+ default: 8,
2099
+ min: 0,
2100
+ max: 5e4,
2101
+ label: "\u4FDD\u7559\u5355\u5143\u683C\u7C07\u4E0A\u9650",
2102
+ labelEn: "Retained cluster limit",
2103
+ description: '\u68C0\u67E5\u70B9\u4FDD\u7559\u591A\u5C11\u4E2A\u5355\u5143\u683C\u7C07\u7684\u8EAB\u4EFD\u4E0E\u89C2\u6D4B\uFF0C\u8D85\u8FC7\u540E\u6700\u65E7\u7684\u7C07\u6298\u8FDB\u533A\u95F4\u6458\u8981\uFF08\u5176\u540E\u7EED\u64CD\u4F5C\u9700\u8981\u4ECE\u65E5\u5FD7\u91CD\u6298\uFF09\u3002\u9ED8\u8BA4\u4E0E"\u4FDD\u7559\u6700\u8FD1\u5355\u5143\u683C\u6570"\u4E00\u81F4\uFF0C\u6240\u4EE5\u68C0\u67E5\u70B9\u4E0D\u4F1A\u968F\u4F1A\u8BDD\u957F\u5EA6\u7EBF\u6027\u589E\u957F\uFF1B\u8C03\u5927\u80FD\u4FDD\u7559\u66F4\u591A\u65E0\u9700\u91CD\u6298\u7684\u6062\u590D\u8BC1\u636E\uFF0C\u4F46\u68C0\u67E5\u70B9\u66F4\u5927\u3002\u586B 0 \u8868\u793A\u4E0D\u9650\u5236\uFF1A\u4E0D\u505A\u6309\u6570\u91CF\u7684\u6298\u53E0\uFF0C\u53EA\u7531\u8F7D\u8377\u9884\u7B97\u7EA6\u675F\u4F53\u79EF\u3002',
2104
+ descriptionEn: "How many cell clusters keep their identity and observations in the checkpoint; older ones fold into an interval summary and need a log refold afterwards. It defaults to the retained-cells window, which is what keeps a long session from growing linearly; a larger value keeps more recovery evidence without a refold at the cost of a bigger checkpoint. 0 means unlimited: no count-based folding, with the payload budget as the only bound."
2105
+ },
2106
+ {
2107
+ key: "capabilityPromptTextEnabled",
2108
+ type: "boolean",
2109
+ default: true,
2110
+ label: "\u63D0\u793A\u6587\u672C",
2111
+ labelEn: "Prompt text",
2112
+ description: "\u628A\u300C\u63D0\u793A\u6587\u672C\u300D\u9875\u7B7E\u91CC\u6539\u5199\u7684\u56FA\u5B9A\u53E5\u5B50\u5E94\u7528\u5230\u6A21\u578B\u7684\u8BF7\u6C42\u3001\u5DE5\u5177\u8BF4\u660E\u3001\u80FD\u529B\u65B9\u6848\u4E0E\u63D0\u793A\uFF1B\u5173\u95ED\u540E\u8FD9\u4E9B\u6E20\u9053\u4E00\u5F8B\u56DE\u5230\u5185\u7F6E\u6587\u672C\uFF0C\u5DF2\u4FDD\u5B58\u7684\u6539\u5199\u4FDD\u7559\u4F46\u6682\u505C\u751F\u6548\u3002",
2113
+ descriptionEn: "Applies the sentences edited in the Prompt text tab to model requests, tool descriptions, the capability plan and tips. When off, those channels use the built-in text; saved edits are kept but paused."
2114
+ },
2115
+ {
2116
+ key: "promptText",
2117
+ type: "string",
2118
+ default: PROMPT_TEXT_DEFAULT,
2119
+ label: "\u63D0\u793A\u6587\u672C\u8986\u76D6",
2120
+ labelEn: "Prompt text overrides",
2121
+ description: "\u6309\u69FD\u4F4D id \u8986\u76D6\u63D2\u4EF6\u5199\u7ED9\u6A21\u578B\u7684\u56FA\u5B9A\u63D0\u793A\u6587\u672C\uFF1B\u7A7A\u5BF9\u8C61\u8868\u793A\u4F7F\u7528\u5185\u7F6E\u6587\u672C\u3002\u8BCA\u65AD\u3001\u4FE1\u5C01\u4E0E\u7531\u914D\u7F6E\u6D3E\u751F\u7684\u7B56\u7565\u53E5\u59CB\u7EC8\u53EA\u8BFB\u3002",
2122
+ descriptionEn: "Override the fixed prompt text the plugin writes for the model, keyed by slot id; an empty document keeps the built-in text. Diagnostics, message envelopes and configuration-derived policy sentences stay read-only."
2123
+ },
2124
+ {
2125
+ key: "unmeasuredCellLimit",
2126
+ type: "integer",
2127
+ default: 2,
2128
+ min: 1,
2129
+ max: Number.MAX_SAFE_INTEGER,
2130
+ label: "\u8FDE\u7EED\u672A\u6D4B\u91CF cell \u4E22\u5F03\u9608\u503C",
2131
+ labelEn: "Consecutive unmeasured cells before the worker is dropped",
2132
+ description: "\u8FDE\u7EED\u7B2C\u51E0\u4E2A\u672A\u6D4B\u91CF cell \u89E6\u53D1\u4E22\u5F03 live worker\uFF08\u9ED8\u8BA4 2\uFF1A\u7B2C\u4E00\u4E2A\u4FDD\u7559\uFF0C\u7B2C\u4E8C\u4E2A\u4E22\u5F03\uFF09\uFF1B\u5DF2\u8BC1\u660E\u7684 frontier \u4FDD\u7559\u7ED9\u4E0B\u4E00 cell \u91CD\u653E\u3002",
2133
+ descriptionEn: "The consecutive unmeasured cell that drops the live worker (default 2: the first is kept, the second drops it). The proved frontier stays replayable for the next cell."
2134
+ },
1497
2135
  {
1498
2136
  key: "officialReplPriority",
1499
2137
  type: "boolean",
@@ -1503,6 +2141,15 @@ var CONFIG_FIELDS = Object.freeze([
1503
2141
  description: "\u68C0\u6D4B\u5230\u5B98\u65B9\u6301\u4E45 REPL \u6A21\u5F0F\u65F6\u7531\u5B98\u65B9\u8FD0\u884C\u65F6\u63A5\u7BA1 PTC \u4F1A\u8BDD\u6267\u884C\uFF1BPTC Plus \u8BA9\u51FA run_code \u53CA\u5176\u8FDB\u7A0B\u5185\u4F1A\u8BDD\u72B6\u6001\u8BED\u4E49\uFF0C\u5173\u95ED\u65F6\u59CB\u7EC8\u7531 PTC Plus \u63A5\u7BA1\u3002",
1504
2142
  descriptionEn: "Lets the official runtime own PTC session execution when the official persistent REPL mode is active; PTC Plus then leaves run_code and its in-process session-state semantics to DSH. Disabled keeps PTC Plus in charge."
1505
2143
  },
2144
+ {
2145
+ key: "editRewritesHistory",
2146
+ type: "boolean",
2147
+ default: false,
2148
+ label: "\u7F16\u8F91\u65F6\u66FF\u6362\u539F\u5355\u5143\u683C",
2149
+ labelEn: "Replace the edited cell in place",
2150
+ description: '\u9ED8\u8BA4\u5173\u95ED\uFF0C\u4E00\u822C\u4E5F\u4E0D\u9700\u8981\u6253\u5F00\uFF1A\u7F16\u8F91\u53EA\u4F1A\u8FFD\u52A0\u4E00\u6B21\u6267\u884C\uFF0C\u539F\u5355\u5143\u683C\u548C\u5B83\u521B\u5EFA\u7684\u7ED1\u5B9A\u90FD\u8FD8\u5728\u3002\u5F00\u542F\u540E\uFF0C\u7F16\u8F91\u4F1A\u66FF\u6362\u539F\u5355\u5143\u683C\uFF0C\u4E4B\u540E\u7684\u91CD\u5EFA\u6309\u65B0\u7248\u672C\u8FDB\u884C\uFF0C\u65B0\u7248\u672C\u91CC\u4E0D\u518D\u58F0\u660E\u7684\u540D\u5B57\u4F1A\u88AB\u70B9\u540D"\u5DF2\u88AB\u66FF\u6362"\uFF0C\u800C\u4E0D\u662F\u6084\u6084\u6D88\u5931\u3002\u53EA\u6709\u5F53\u4F60\u5E0C\u671B\u73AF\u5883\u8868\u73B0\u5F97"\u8FD9\u4E00\u683C\u4E00\u76F4\u5C31\u662F\u65B0\u7248\u672C"\u65F6\u624D\u9700\u8981\u6253\u5F00\u3002',
2151
+ descriptionEn: "Off by default, and usually unnecessary: an edit appends one more execution, leaving the original cell and the bindings it created in place. When on, the edit replaces the original cell, later rebuilds follow the new version, and a name the new version no longer declares is reported as replaced rather than silently disappearing. Turn it on only when the environment should behave as if that cell had always been the new version."
2152
+ },
1506
2153
  {
1507
2154
  key: "tipsEnabled",
1508
2155
  type: "boolean",
@@ -1567,6 +2214,50 @@ var CONFIG_FIELDS = Object.freeze([
1567
2214
  description: "\u9650\u5236\u5355\u4E2A cell \u7684\u65E5\u5FD7\u548C\u8FD4\u56DE\u7ED3\u679C\u7684\u5408\u8BA1\u5927\u5C0F\u3002",
1568
2215
  descriptionEn: "Limits the combined size of one cell's logs and returned result."
1569
2216
  },
2217
+ {
2218
+ key: "sampleBoundMs",
2219
+ type: "integer",
2220
+ default: 1e3,
2221
+ min: 1,
2222
+ max: MAX_TIMER_DELAY_MS,
2223
+ label: "\u8BA1\u7B97\u57FA\u7EBF\u91C7\u6837\u7B49\u5F85\u4E0A\u9650 (ms)",
2224
+ labelEn: "Compute-baseline sample wait limit (ms)",
2225
+ description: "\u7B49\u5F85 worker \u56DE\u7B54\u8BA1\u7B97\u57FA\u7EBF\u91C7\u6837\u7684\u4E0A\u9650\uFF1B\u5BBF\u4E3B\u5FD9\u788C\u65F6\u5148\u8BFB\u7A7A helper \u901A\u9053\u518D\u5224\u65AD\u7F3A\u5931\uFF0C\u672A\u89C2\u5BDF\u5230\u7684\u91C7\u6837\u6309\u672A\u6D4B\u91CF no-op \u7ED3\u7B97\uFF0C\u662F\u5426\u4FDD\u7559 worker \u7531 unmeasuredCellLimit \u51B3\u5B9A\uFF1Btransport \u62A5\u544A\u9000\u51FA\u3001\u65AD\u8FDE\u6216\u65E0\u6CD5\u53D1\u9001\u65F6\u4ECD\u8D70 worker-exit \u91CD\u7F6E\u3002",
2226
+ descriptionEn: "Bounds the wait for the worker compute-baseline answer. A busy host reads the helper channel out before concluding an answer is missing; an unobserved sample settles as an unmeasured no-op and unmeasuredCellLimit decides whether the worker stays; a transport-reported exit, disconnect or unsendable request keeps the worker-exit reset route."
2227
+ },
2228
+ {
2229
+ key: "workerReclaimMs",
2230
+ type: "integer",
2231
+ default: 5e3,
2232
+ min: 1e3,
2233
+ max: MAX_TIMER_DELAY_MS,
2234
+ label: "worker \u56DE\u6536\u786E\u8BA4\u4E0A\u9650 (ms)",
2235
+ labelEn: "Worker reclamation confirmation limit (ms)",
2236
+ description: "\u505C\u6B62 helper \u7684\u5173\u95ED\u9636\u6BB5\u4E0A\u9650\uFF08\u81F3\u5C11 1000ms\uFF09\uFF1Bexit \u786E\u8BA4\u4E0E\u5176\u540E\u7684\u8F93\u51FA\u5173\u95ED\u5404\u81EA\u4EE5\u6B64\u4E3A\u4E0A\u754C\uFF0Crelease grace \u4F1A\u88AB\u538B\u7F29\u4EE5\u7ED9 kill \u9884\u7559\u81F3\u5C11 1000ms \u7684\u786E\u8BA4\u7A97\u53E3\u3002worker \u521B\u5EFA\u4E0E\u5173\u95ED\u65F6\u8BFB\u53D6\u5F53\u524D\u914D\u7F6E\u3002cell \u89E6\u53D1\u7684 session kernel exit \u8D85\u65F6\u4F1A\u4FDD\u7559 helper \u5E76\u5728\u4F1A\u8BDD\u91CA\u653E\u524D\u963B\u6B62\u540E\u7EED cell\uFF1Bstartup\u3001idle \u6216\u8F93\u51FA\u5173\u95ED\u8DEF\u5F84\u7684\u5931\u8D25\uFF0C\u4EE5\u53CA binding console \u4E0E candidate helper\uFF0C\u53EA\u4FDD\u7559\u5B9E\u4F8B\u5E76\u5728\u91CA\u653E\u65F6\u62A5\u544A\u3002",
2237
+ descriptionEn: "Bounds one close stage of a stopped helper (at least 1000 ms): exit confirmation and the following output close are each bounded by it, with the release grace capped so the kill keeps at least a 1000 ms confirmation window. Read from the current configuration when a worker is created or closed. A cell-driven session-kernel exit miss retains the helper and blocks later cells until the session is released; a startup, idle or output-close miss, and the binding console and candidate helpers, only retain the instance and report it at release."
2238
+ },
2239
+ {
2240
+ key: "startupProbeMs",
2241
+ type: "integer",
2242
+ default: 5e3,
2243
+ min: 1,
2244
+ max: MAX_TIMER_DELAY_MS,
2245
+ label: "REPL \u542F\u52A8\u63A2\u9488\u4E0A\u9650 (ms)",
2246
+ labelEn: "REPL startup probe limit (ms)",
2247
+ description: "worker \u542F\u52A8\u65F6\u6821\u9A8C REPL \u5951\u7EA6\u7684\u7B49\u5F85\u4E0A\u9650\uFF1B\u8D85\u65F6\u6309\u542F\u52A8\u5931\u8D25\u7ED3\u7B97\uFF0C\u4E0D\u6267\u884C\u4EFB\u4F55 cell\u3002worker \u521B\u5EFA\u65F6\u8BFB\u53D6\u5F53\u524D\u914D\u7F6E\u3002",
2248
+ descriptionEn: "Bounds the worker startup check of the REPL contract. A timeout settles as a startup failure and no cell executes. Read from the current configuration when a worker is created."
2249
+ },
2250
+ {
2251
+ key: "executionSeamTimeoutMs",
2252
+ type: "integer",
2253
+ default: 3e4,
2254
+ min: 1,
2255
+ max: MAX_TIMER_DELAY_MS,
2256
+ label: "\u7B49\u5F85\u5BBF\u4E3B\u6267\u884C\u5165\u53E3\u4E0A\u9650 (ms)",
2257
+ labelEn: "Host execution-seam wait limit (ms)",
2258
+ description: "\u6FC0\u6D3B\u65F6\u7B49\u5F85\u5BBF\u4E3B\u6CE8\u518C\u6267\u884C\u5165\u53E3\u7684\u4E0A\u9650\uFF1B\u8D85\u65F6\u628A\u5F53\u524D\u90E8\u7F72\u62A5\u544A\u4E3A\u4E0D\u652F\u6301\u3002\u53EA\u5728\u63D2\u4EF6\u6FC0\u6D3B\u6216\u91CD\u8F7D\u65F6\u8BFB\u53D6\uFF0C\u8FD0\u884C\u4E2D\u7684\u4FEE\u6539\u5728\u4E0B\u6B21\u6FC0\u6D3B\u751F\u6548\u3002",
2259
+ descriptionEn: "Bounds the activation wait for the host to register its execution seam. A timeout reports the deployment as unsupported. Read only when the plugin activates or reloads; a live change applies at the next activation."
2260
+ },
1570
2261
  {
1571
2262
  key: "maxValueNodes",
1572
2263
  type: "integer",
@@ -1653,7 +2344,7 @@ var CONFIG_GROUPS = Object.freeze([
1653
2344
  key: "recovery",
1654
2345
  label: "\u72B6\u6001\u4E0E\u6062\u590D",
1655
2346
  labelEn: "State and recovery",
1656
- fields: Object.freeze(["durableReplay", "officialReplPriority", "tipsEnabled", "tipCooldownMessages", "tipEscalationFailures"])
2347
+ fields: Object.freeze(["durableReplay", "editRewritesHistory", "unmeasuredCellLimit", "officialReplPriority", "tipsEnabled", "tipCooldownMessages", "tipEscalationFailures"])
1657
2348
  },
1658
2349
  {
1659
2350
  key: "extensions",
@@ -1683,6 +2374,10 @@ var CONFIG_GROUPS = Object.freeze([
1683
2374
  "maxOldGenerationSizeMb",
1684
2375
  "maxNestedRunCodeDepth",
1685
2376
  "maxOutputBytes",
2377
+ "sampleBoundMs",
2378
+ "workerReclaimMs",
2379
+ "startupProbeMs",
2380
+ "executionSeamTimeoutMs",
1686
2381
  "maxValueNodes",
1687
2382
  "maxValueEdges",
1688
2383
  "maxValueArrayLength",
@@ -1706,7 +2401,12 @@ var CONFIG_GROUPS = Object.freeze([
1706
2401
  "capabilityBudgetBytes",
1707
2402
  "capabilityDirectoryBytes",
1708
2403
  "capabilityRecoveryBytes",
1709
- "modelPreviewTokens"
2404
+ "modelPreviewTokens",
2405
+ "retentionPayloadRuns",
2406
+ "retentionPayloadBytes",
2407
+ "retentionClusters",
2408
+ "capabilityPromptTextEnabled",
2409
+ "promptText"
1710
2410
  ])
1711
2411
  }
1712
2412
  ]);
@@ -1720,16 +2420,6 @@ var CONFIG_DEFAULTS = Object.freeze(
1720
2420
  Object.fromEntries(CONFIG_FIELDS.map((field) => [field.key, field.default]))
1721
2421
  );
1722
2422
 
1723
- // internal/repl-rewrite-contract.js
1724
- var LEGACY_DEFAULT_EXPORT_BINDING = "legacy-variable";
1725
- var LIVE_DEFAULT_EXPORT_BINDING = "live-readonly";
1726
- var LEGACY_IMPORT_EXPRESSION_BOUNDARY = "legacy";
1727
- var LIVE_IMPORT_EXPRESSION_BOUNDARY = "statement-safe";
1728
- var LIVE_MODULE_SEMANTICS = Object.freeze({
1729
- defaultExportBinding: LIVE_DEFAULT_EXPORT_BINDING,
1730
- importExpressionBoundary: LIVE_IMPORT_EXPRESSION_BOUNDARY
1731
- });
1732
-
1733
2423
  // internal/session-journal-schema.js
1734
2424
  var IMPORT_BOUNDARY_JOURNAL_VERSION = 7;
1735
2425
  var PER_NAME_USER_BINDINGS_JOURNAL_VERSION = 8;
@@ -1753,7 +2443,7 @@ var WHOLE_ENTRY_JOURNAL_FIELDS = /* @__PURE__ */ new Set(["version", "bindingPol
1753
2443
  var PER_NAME_JOURNAL_FIELDS = /* @__PURE__ */ new Set([...WHOLE_ENTRY_JOURNAL_FIELDS, "userBindingsShadowPolicy", "userBindingNames"]);
1754
2444
  var LANGUAGE_SEMANTICS_JOURNAL_FIELDS = /* @__PURE__ */ new Set([...PER_NAME_JOURNAL_FIELDS, "languageSemantics"]);
1755
2445
  var MODULE_TRANSFORM_JOURNAL_FIELDS = /* @__PURE__ */ new Set([...LANGUAGE_SEMANTICS_JOURNAL_FIELDS, "moduleTransform"]);
1756
- var JOURNAL_FIELDS = /* @__PURE__ */ new Set([...MODULE_TRANSFORM_JOURNAL_FIELDS, "executionCwd"]);
2446
+ var JOURNAL_FIELDS = /* @__PURE__ */ new Set([...MODULE_TRANSFORM_JOURNAL_FIELDS, "executionCwd", "values", "unrecordedBindings"]);
1757
2447
  var FINGERPRINT_REUSE_JOURNAL_FIELDS = new Set([...WHOLE_ENTRY_JOURNAL_FIELDS].filter((field) => field !== "userBindingsReusePolicy"));
1758
2448
  var RELATIONLESS_JOURNAL_FIELDS = new Set([...FINGERPRINT_REUSE_JOURNAL_FIELDS].filter((field) => field !== "userBindingsFingerprint"));
1759
2449
  var PREDECESSOR_JOURNAL_FIELDS = /* @__PURE__ */ new Set(["version", "bindingMode", "rewritePolicy", "status", "calls", "operations", "confirms", "diagnostics", "completion", "volatileReason"]);
@@ -1770,14 +2460,14 @@ var DEFAULT_EXPORT_BINDINGS = /* @__PURE__ */ new Set([
1770
2460
  LEGACY_DEFAULT_EXPORT_BINDING,
1771
2461
  LIVE_DEFAULT_EXPORT_BINDING
1772
2462
  ]);
1773
- var CALL_SUCCESS_FIELDS = /* @__PURE__ */ new Set(["global", "member", "args", "ok", "value", "settle"]);
1774
- var CALL_ERROR_FIELDS = /* @__PURE__ */ new Set(["global", "member", "args", "ok", "error", "settle"]);
1775
- var OPERATION_FIELDS = /* @__PURE__ */ new Set(["action", "name"]);
2463
+ var CALL_SUCCESS_FIELDS = /* @__PURE__ */ new Set(["global", "member", "args", "argsDigest", "argsBytes", "ok", "value", "settle"]);
2464
+ var CALL_ERROR_FIELDS = /* @__PURE__ */ new Set(["global", "member", "args", "argsDigest", "argsBytes", "ok", "error", "settle"]);
2465
+ var OPERATION_FIELDS = /* @__PURE__ */ new Set(["action", "name", "kind"]);
1776
2466
  var RETURN_FIELDS = /* @__PURE__ */ new Set(["kind", "hasValue", "value"]);
1777
2467
  var THROW_FIELDS = /* @__PURE__ */ new Set(["kind", "error"]);
1778
2468
  var ERROR_FIELDS = /* @__PURE__ */ new Set(["kind", "message"]);
1779
2469
  var EDIT_TARGET_FIELDS = /* @__PURE__ */ new Set(["targetCallSeq"]);
1780
- var DERIVED_RUN_FIELDS = /* @__PURE__ */ new Set(["code", "description"]);
2470
+ var DERIVED_RUN_FIELDS = /* @__PURE__ */ new Set(["code", "codeDigest", "codeBytes", "description"]);
1781
2471
  var JOURNAL_VERSIONS = /* @__PURE__ */ new Set([LEGACY_JOURNAL_VERSION, INTERMEDIATE_JOURNAL_VERSION, PREVIOUS_JOURNAL_VERSION, USER_BINDING_RELATIONLESS_JOURNAL_VERSION, FINGERPRINT_REUSE_JOURNAL_VERSION, VERSIONED_BINDING_REUSE_JOURNAL_VERSION, IMPORT_BOUNDARY_JOURNAL_VERSION, PER_NAME_USER_BINDINGS_JOURNAL_VERSION, LANGUAGE_SEMANTICS_JOURNAL_VERSION, MODULE_TRANSFORM_JOURNAL_VERSION, JOURNAL_VERSION]);
1782
2472
  var USER_BINDINGS_REUSE_POLICIES = /* @__PURE__ */ new Set([LEGACY_USER_BINDINGS_REUSE_POLICY, LIVE_USER_BINDINGS_REUSE_POLICY]);
1783
2473
  var USER_BINDINGS_SHADOW_POLICIES = /* @__PURE__ */ new Set([LEGACY_USER_BINDINGS_SHADOW_POLICY, LIVE_USER_BINDINGS_SHADOW_POLICY]);
@@ -1923,11 +2613,11 @@ var {
1923
2613
  maxStringBytes: MAX_STRING_BYTES
1924
2614
  } = DEFAULT_VALUE_LIMITS;
1925
2615
  var textEncoder = new TextEncoder();
1926
- function isRecord2(value) {
2616
+ function isRecord3(value) {
1927
2617
  return value !== null && typeof value === "object" && !Array.isArray(value);
1928
2618
  }
1929
2619
  function hasClosedFields(value, allowed, required = []) {
1930
- if (!isRecord2(value)) return false;
2620
+ if (!isRecord3(value)) return false;
1931
2621
  const keys2 = Reflect.ownKeys(value);
1932
2622
  if (keys2.some((key) => typeof key !== "string" || !allowed.has(key) || !Object.prototype.propertyIsEnumerable.call(value, key))) return false;
1933
2623
  return [...required].every((key) => Object.hasOwn(value, key));
@@ -1936,7 +2626,7 @@ function hasExactFields(value, fields) {
1936
2626
  return hasClosedFields(value, fields, fields) && Reflect.ownKeys(value).length === fields.size;
1937
2627
  }
1938
2628
  function hasExactOrderedFields(value, fields) {
1939
- if (!isRecord2(value)) return false;
2629
+ if (!isRecord3(value)) return false;
1940
2630
  const keys2 = Reflect.ownKeys(value);
1941
2631
  const ordered = [...fields];
1942
2632
  return keys2.length === ordered.length && keys2.every((key, index2) => key === ordered[index2] && Object.prototype.propertyIsEnumerable.call(value, key));
@@ -1951,7 +2641,7 @@ function isValidPosition(value) {
1951
2641
  return hasExactFields(value, POSITION_FIELDS) && Number.isSafeInteger(value.line) && value.line >= 1 && Number.isSafeInteger(value.column) && value.column >= 1;
1952
2642
  }
1953
2643
  function isValidDiagnosticCause(value, depth) {
1954
- if (depth > 16 || !isRecord2(value)) return false;
2644
+ if (depth > 16 || !isRecord3(value)) return false;
1955
2645
  if (Object.hasOwn(value, "severity")) return isValidDiagnostic(value, depth + 1);
1956
2646
  return hasClosedFields(value, CAUSE_FIELDS, ["message"]) && (value.code === void 0 || isLine(value.code)) && isLine(value.message);
1957
2647
  }
@@ -1985,7 +2675,7 @@ function isValidValueAtom(value, state) {
1985
2675
  if (value === null || typeof value === "boolean") return true;
1986
2676
  if (typeof value === "string") return accountText(value, state);
1987
2677
  if (typeof value === "number") return Number.isFinite(value) && !Object.is(value, -0);
1988
- if (!isRecord2(value) || typeof value.tag !== "string") return false;
2678
+ if (!isRecord3(value) || typeof value.tag !== "string") return false;
1989
2679
  if (value.tag === "undefined") return hasExactOrderedFields(value, VALUE_UNDEFINED_FIELDS);
1990
2680
  if (value.tag === "number") {
1991
2681
  return hasExactOrderedFields(value, VALUE_NUMBER_FIELDS) && ["nan", "infinity", "-infinity", "-0"].includes(value.value);
@@ -2013,7 +2703,7 @@ function isValidValueWire(value) {
2013
2703
  };
2014
2704
  if (!isValidValueAtom(value.root, state)) return false;
2015
2705
  for (const [nodeIndex, node] of value.nodes.entries()) {
2016
- if (!state.discovered.has(nodeIndex) || !isRecord2(node)) return false;
2706
+ if (!state.discovered.has(nodeIndex) || !isRecord3(node)) return false;
2017
2707
  if (node.type === "array") {
2018
2708
  if (!hasExactOrderedFields(node, VALUE_ARRAY_FIELDS) || !Number.isSafeInteger(node.length) || node.length < 0 || node.length > MAX_ARRAY_LENGTH || !Array.isArray(node.entries)) return false;
2019
2709
  state.arraySlots += node.length;
@@ -2057,10 +2747,18 @@ function isValidModuleSemantics(value, version) {
2057
2747
  const legacy = version <= VERSIONED_BINDING_REUSE_JOURNAL_VERSION;
2058
2748
  return hasExactFields(value, legacy ? LEGACY_MODULE_SEMANTICS_FIELDS : MODULE_SEMANTICS_FIELDS) && DEFAULT_EXPORT_BINDINGS.has(value.defaultExportBinding) && (legacy || IMPORT_EXPRESSION_BOUNDARIES.has(value.importExpressionBoundary));
2059
2749
  }
2750
+ function payloadShape(value, textField, digestField, bytesField) {
2751
+ if (Object.hasOwn(value, textField)) {
2752
+ return Object.hasOwn(value, digestField) || Object.hasOwn(value, bytesField) ? void 0 : "text";
2753
+ }
2754
+ return typeof value[digestField] === "string" && /^[a-f0-9]{64}$/u.test(value[digestField]) && isSafeSequence(value[bytesField]) ? "digest" : void 0;
2755
+ }
2060
2756
  function isValidCall(value) {
2061
- if (!isRecord2(value) || value.ok !== true && value.ok !== false) return false;
2757
+ if (!isRecord3(value) || value.ok !== true && value.ok !== false) return false;
2062
2758
  const fields = value.ok ? CALL_SUCCESS_FIELDS : CALL_ERROR_FIELDS;
2063
- if (!hasExactFields(value, fields) || typeof value.global !== "string" || typeof value.member !== "string" || !isValidValueWire(value.args) || !isSafeSequence(value.settle)) return false;
2759
+ const argsShape = payloadShape(value, "args", "argsDigest", "argsBytes");
2760
+ if (argsShape === void 0 || !hasClosedFields(value, fields) || typeof value.global !== "string" || typeof value.member !== "string" || !isSafeSequence(value.settle)) return false;
2761
+ if (argsShape === "text" && !isValidValueWire(value.args)) return false;
2064
2762
  return value.ok ? isValidValueWire(value.value) : typeof value.error === "string";
2065
2763
  }
2066
2764
  function isValidOperation(value) {
@@ -2069,7 +2767,7 @@ function isValidOperation(value) {
2069
2767
  return typeof value.name === "string" && /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(value.name);
2070
2768
  }
2071
2769
  function isValidCompletion(value) {
2072
- if (!isRecord2(value) || !["return", "throw"].includes(value.kind)) return false;
2770
+ if (!isRecord3(value) || !["return", "throw"].includes(value.kind)) return false;
2073
2771
  if (value.kind === "return") {
2074
2772
  if (!hasClosedFields(value, RETURN_FIELDS, ["kind", "hasValue"]) || typeof value.hasValue !== "boolean") return false;
2075
2773
  return value.hasValue ? Object.hasOwn(value, "value") && isValidValueWire(value.value) : !Object.hasOwn(value, "value");
@@ -2083,7 +2781,7 @@ function isValidConfirms(value, version) {
2083
2781
  return value.every(isSafeSequence);
2084
2782
  }
2085
2783
  function isReadableJournalUnchecked(value) {
2086
- if (!isRecord2(value) || !JOURNAL_VERSIONS.has(value.version) || !STATUSES.has(value.status)) {
2784
+ if (!isRecord3(value) || !JOURNAL_VERSIONS.has(value.version) || !STATUSES.has(value.status)) {
2087
2785
  return false;
2088
2786
  }
2089
2787
  const predecessor = value.version < 4;
@@ -2139,7 +2837,9 @@ function isValidEditTarget(value) {
2139
2837
  }
2140
2838
  function isValidDerivedRun(value) {
2141
2839
  try {
2142
- return hasExactFields(value, DERIVED_RUN_FIELDS) && typeof value.code === "string" && typeof value.description === "string";
2840
+ if (!isRecord3(value) || !hasClosedFields(value, DERIVED_RUN_FIELDS) || typeof value.description !== "string") return false;
2841
+ const codeShape = payloadShape(value, "code", "codeDigest", "codeBytes");
2842
+ return codeShape === "digest" || codeShape === "text" && typeof value.code === "string";
2143
2843
  } catch {
2144
2844
  return false;
2145
2845
  }
@@ -2153,7 +2853,7 @@ function isValidRecoveryBoundaries(value) {
2153
2853
  }
2154
2854
  function isValidEditRelation(meta2, args, journal) {
2155
2855
  try {
2156
- if (!isRecord2(meta2) || !isRecord2(args) || !isValidEditTarget(meta2.dshPtcPlusEdit) || !isValidDerivedRun(meta2.dshPtcPlusDerivedRun) || journal.status === "noop") return false;
2856
+ if (!isRecord3(meta2) || !isRecord3(args) || !isValidEditTarget(meta2.dshPtcPlusEdit) || !isValidDerivedRun(meta2.dshPtcPlusDerivedRun) || journal.status === "noop") return false;
2157
2857
  if (Object.hasOwn(meta2, "dshPtcPlusRecoveryBoundaries") && !isValidRecoveryBoundaries(meta2.dshPtcPlusRecoveryBoundaries)) return false;
2158
2858
  return !Object.hasOwn(args, "expected_target_call_seq") || args.expected_target_call_seq === meta2.dshPtcPlusEdit.targetCallSeq;
2159
2859
  } catch {
@@ -2167,7 +2867,7 @@ function rawArguments(block, settled) {
2167
2867
  function parseArguments(raw) {
2168
2868
  try {
2169
2869
  const value = JSON.parse(raw);
2170
- return isRecord2(value) ? value : void 0;
2870
+ return isRecord3(value) ? value : void 0;
2171
2871
  } catch {
2172
2872
  return void 0;
2173
2873
  }
@@ -2176,7 +2876,7 @@ function resultText(block) {
2176
2876
  if (!Array.isArray(block.content)) return "";
2177
2877
  try {
2178
2878
  const parts = block.content.map((item) => item?.type === "text" && typeof item.text === "string" ? item.text : JSON.stringify(item, null, 2));
2179
- if (parts.length === 0 && isRecord2(block.error)) {
2879
+ if (parts.length === 0 && isRecord3(block.error)) {
2180
2880
  return [block.error.name, block.error.code].filter((value) => typeof value === "string").join(": ");
2181
2881
  }
2182
2882
  return parts.filter((value) => typeof value === "string").join("\n");
@@ -2216,17 +2916,17 @@ function isDurableRecoveryDiagnostic(diagnostic) {
2216
2916
  return diagnostic.code === "PTC-R002" && diagnostic.severity === "warning" && diagnostic.phase === "recover" && diagnostic.stateEffect === "rolled-back";
2217
2917
  }
2218
2918
  function derivePtcToolView(block, toolName = void 0) {
2219
- const settled = isRecord2(block) && block.kind === "tool-result";
2220
- const argsRaw = isRecord2(block) ? rawArguments(block, settled) : "";
2919
+ const settled = isRecord3(block) && block.kind === "tool-result";
2920
+ const argsRaw = isRecord3(block) ? rawArguments(block, settled) : "";
2221
2921
  const args = parseArguments(argsRaw);
2222
2922
  const code2 = typeof args?.code === "string" ? args.code : argsRaw;
2223
2923
  const explicitDescription = typeof args?.description === "string" && args.description.length > 0 ? args.description : void 0;
2224
- const generatedDescription = settled && isRecord2(block.meta) && typeof block.meta[GENERATED_RUN_CODE_DESCRIPTION_KEY] === "string" && block.meta[GENERATED_RUN_CODE_DESCRIPTION_KEY].length > 0 ? block.meta[GENERATED_RUN_CODE_DESCRIPTION_KEY] : void 0;
2924
+ const generatedDescription = settled && isRecord3(block.meta) && typeof block.meta[GENERATED_RUN_CODE_DESCRIPTION_KEY] === "string" && block.meta[GENERATED_RUN_CODE_DESCRIPTION_KEY].length > 0 ? block.meta[GENERATED_RUN_CODE_DESCRIPTION_KEY] : void 0;
2225
2925
  const description = (explicitDescription ?? generatedDescription)?.split(/\r?\n/, 1)[0] ?? "";
2226
2926
  const descriptionGenerated = explicitDescription === void 0 && generatedDescription !== void 0;
2227
2927
  const output = settled ? resultText(block) : "";
2228
2928
  const state = !settled ? "running" : block.error?.code === "interrupted" ? "stopped" : block.isError === true ? "error" : "ok";
2229
- const journal = settled && isRecord2(block.meta) && isCountableJournal(block.meta.dshPtcPlus) ? block.meta.dshPtcPlus : void 0;
2929
+ const journal = settled && isRecord3(block.meta) && isCountableJournal(block.meta.dshPtcPlus) ? block.meta.dshPtcPlus : void 0;
2230
2930
  if (journal === void 0) {
2231
2931
  return Object.freeze({ state, description, descriptionGenerated, code: code2, output, ptc: false, features: Object.freeze([]) });
2232
2932
  }
@@ -2834,6 +3534,7 @@ function resolveConfig(config2 = {}) {
2834
3534
  }
2835
3535
  for (const field of CONFIG_FIELDS) assertField(field, resolved[field.key]);
2836
3536
  validateCapabilityProfiles(JSON.parse(resolved.capabilityProfiles));
3537
+ validatePromptTextDocument(resolved.promptText);
2837
3538
  for (const [key, array] of [["capabilityBaseline", true], ["capabilityOverrides", false]]) {
2838
3539
  let value;
2839
3540
  try {
@@ -2912,6 +3613,44 @@ function registerGated(scope, { subscribe, isEnabled, register }) {
2912
3613
  });
2913
3614
  }
2914
3615
 
3616
+ // internal/capability-delivery-proof.js
3617
+ var CAPABILITY_PROOF_SCHEMA = "ptc-capability-proof/v1";
3618
+ var CAPABILITY_DELIVERY_STATES = /* @__PURE__ */ new Set(["delivered", "pending", "absent"]);
3619
+ var CAPABILITY_USABILITY_STATES = /* @__PURE__ */ new Set(["proven", "unproven"]);
3620
+ var CAPABILITY_ID = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;
3621
+ function isRecord4(value) {
3622
+ return value !== null && typeof value === "object" && !Array.isArray(value);
3623
+ }
3624
+ function normalizeCapabilityProof(value) {
3625
+ if (!isRecord4(value) || Reflect.ownKeys(value).length !== 5 || !Object.hasOwn(value, "schema") || !Object.hasOwn(value, "id") || !Object.hasOwn(value, "saved") || !Object.hasOwn(value, "delivery") || !Object.hasOwn(value, "usability")) {
3626
+ throw new TypeError("invalid capability proof");
3627
+ }
3628
+ if (value.schema !== CAPABILITY_PROOF_SCHEMA) throw new TypeError("invalid capability proof schema");
3629
+ if (typeof value.id !== "string" || !CAPABILITY_ID.test(value.id)) throw new TypeError("invalid capability proof id");
3630
+ if (typeof value.saved !== "boolean") throw new TypeError("invalid capability proof saved fact");
3631
+ if (!CAPABILITY_DELIVERY_STATES.has(value.delivery)) throw new TypeError("invalid capability proof delivery state");
3632
+ if (!CAPABILITY_USABILITY_STATES.has(value.usability)) throw new TypeError("invalid capability proof usability state");
3633
+ return Object.freeze({
3634
+ schema: CAPABILITY_PROOF_SCHEMA,
3635
+ id: value.id,
3636
+ saved: value.saved,
3637
+ delivery: value.delivery,
3638
+ usability: value.usability
3639
+ });
3640
+ }
3641
+ function capabilityProofText(proof) {
3642
+ const normalized = normalizeCapabilityProof(proof);
3643
+ const id2 = normalized.id;
3644
+ const saved = normalized.saved ? `Saved: yes. The global configuration records a choice for ${id2}.` : `Saved: no. The global configuration records no choice for ${id2}, so this save did not happen; the session choice below is the only change.`;
3645
+ const delivery = {
3646
+ delivered: `Delivered: yes. The model-visible capability catalog published ${id2} at an accepted step.`,
3647
+ pending: `Delivered: not yet. The saved configuration reaches the model-visible catalog at the next accepted step, so ${id2} is not in it now.`,
3648
+ absent: `Delivered: no. The published capability catalog does not list ${id2}, so the model never received it.`
3649
+ }[normalized.delivery];
3650
+ const usability = normalized.usability === "proven" ? `Usable: proven. A completed execution in this session reached ${id2}.` : `Usable: unproven. No completed execution in this session reached ${id2}; only such a result would prove it, and a saved or published entry does not.`;
3651
+ return `${saved} ${delivery} ${usability}`;
3652
+ }
3653
+
2915
3654
  // internal/capability-command-receipt.js
2916
3655
  var PREFIX = "\n\nPTC Plus capability refresh receipt:\n";
2917
3656
  var FALLBACKS = Object.freeze({
@@ -2924,17 +3663,25 @@ var FALLBACKS = Object.freeze({
2924
3663
  off: "Capability management is off; the session stays with the Host capabilities for session"
2925
3664
  });
2926
3665
  var STATES = /* @__PURE__ */ new Set(["recorded", "pending", "unavailable", "usage", "saved-only", "paused", "off"]);
2927
- function capabilityCommandReceipt(state, sessionId, error, proposal) {
3666
+ function capabilityCommandReceipt(state, sessionId, error, proposal, proof) {
2928
3667
  if (!STATES.has(state) || typeof sessionId !== "string" || !sessionId) throw new TypeError("invalid capability command receipt");
2929
3668
  if (error !== void 0 && (state !== "saved-only" || typeof error !== "string" || !error)) throw new TypeError("invalid capability command error");
2930
3669
  if (proposal !== void 0 && (state !== "pending" || !proposal || typeof proposal.commandId !== "string" || typeof proposal.rawInput !== "string" || !proposal.message)) throw new TypeError("invalid capability proposal receipt");
2931
- return `${FALLBACKS[state]} ${sessionId}.${error ? ` ${error}` : ""}` + PREFIX + JSON.stringify({ schema: "ptc-capability-command/v1", state, sessionId, ...error === void 0 ? {} : { error }, ...proposal === void 0 ? {} : { proposal } });
3670
+ const layers = proof === void 0 ? void 0 : normalizeCapabilityProof(proof);
3671
+ return `${FALLBACKS[state]} ${sessionId}.${error ? ` ${error}` : ""}` + (layers === void 0 ? "" : ` ${capabilityProofText(layers)}`) + PREFIX + JSON.stringify({
3672
+ schema: "ptc-capability-command/v1",
3673
+ state,
3674
+ sessionId,
3675
+ ...error === void 0 ? {} : { error },
3676
+ ...proposal === void 0 ? {} : { proposal },
3677
+ ...layers === void 0 ? {} : { proof: layers }
3678
+ });
2932
3679
  }
2933
3680
  function readCapabilityCommandReceipt(text) {
2934
3681
  if (typeof text !== "string" || !text.includes(PREFIX)) return void 0;
2935
3682
  try {
2936
3683
  const receipt = JSON.parse(text.slice(text.indexOf(PREFIX) + PREFIX.length));
2937
- return receipt?.schema === "ptc-capability-command/v1" && STATES.has(receipt.state) && typeof receipt.sessionId === "string" && receipt.sessionId && capabilityCommandReceipt(receipt.state, receipt.sessionId, receipt.error, receipt.proposal) === text ? receipt : void 0;
3684
+ return receipt?.schema === "ptc-capability-command/v1" && STATES.has(receipt.state) && typeof receipt.sessionId === "string" && receipt.sessionId && capabilityCommandReceipt(receipt.state, receipt.sessionId, receipt.error, receipt.proposal, receipt.proof) === text ? receipt : void 0;
2938
3685
  } catch {
2939
3686
  return void 0;
2940
3687
  }
@@ -8462,11 +9209,29 @@ function sortCapabilityEntries(entries, current, valueFor) {
8462
9209
  }
8463
9210
 
8464
9211
  // src/client-capabilities-view.js
9212
+ function capabilityProofCopy(t2, proof) {
9213
+ const delivery = ["delivered", "pending", "absent"].includes(proof?.delivery) ? proof.delivery : void 0;
9214
+ const usability = ["proven", "unproven"].includes(proof?.usability) ? proof.usability : void 0;
9215
+ if (delivery === void 0 || usability === void 0) return t2("capabilities.quick.unknown");
9216
+ return t2("capabilities.proof.line", {
9217
+ saved: t2(proof.saved === true ? "capabilities.proof.saved.yes" : "capabilities.proof.saved.no"),
9218
+ delivery: t2(`capabilities.proof.delivery.${delivery}`),
9219
+ usability: t2(`capabilities.proof.usability.${usability}`)
9220
+ });
9221
+ }
8465
9222
  function capabilityCommandText(t2, text) {
8466
9223
  if (text?.key) return t2(text.key, text.params);
8467
9224
  const receipt = readCapabilityCommandReceipt(text);
8468
- return receipt ? t2(`capabilities.receipt.${receipt.state}`, { session: receipt.sessionId, error: receipt.error ?? "" }) : text;
9225
+ if (!receipt) return text;
9226
+ const line = t2(`capabilities.receipt.${receipt.state}`, { session: receipt.sessionId, error: receipt.error ?? "" });
9227
+ return receipt.proof === void 0 ? line : `${line} ${capabilityProofCopy(t2, receipt.proof)}`;
8469
9228
  }
9229
+ var HOST_CONTEXT_SECTIONS = Object.freeze([
9230
+ Object.freeze({ id: "host:system-prompt", presence: "capabilities.prompt.hostPresenceEvery" }),
9231
+ Object.freeze({ id: "host:tools:sdk", presence: "capabilities.prompt.hostPresenceCapabilities" })
9232
+ ]);
9233
+ var PROMPT_TABLE_COLUMN_KEYS = Object.freeze(["channel", "anchor", "presence", "bytes", "reason", "kind"]);
9234
+ var PROMPT_TABLE_COLUMNS = PROMPT_TABLE_COLUMN_KEYS.length;
8470
9235
  function capabilityChoiceLabel(t2, value) {
8471
9236
  return t2(value === "inherit" ? "capabilities.quick.noOverride" : ["enabled", "pending", "unknown"].includes(value) ? `capabilities.quick.${value}` : [...selections, ...CAPABILITY_DISCLOSURES].includes(value) ? `capabilities.${value}` : "capabilities.quick.unknown");
8472
9237
  }
@@ -8477,21 +9242,47 @@ function capabilityRuleLabel(t2, rule, empty2 = "capabilities.policy.inheritRule
8477
9242
  function validCatalogRule(rule, temporary = false) {
8478
9243
  return rule !== null && typeof rule === "object" && !Array.isArray(rule) && Object.entries(rule).every(([dimension, choice]) => ["availability", "disclosure"].includes(dimension) && (temporary && choice === "automatic" || (dimension === "availability" ? ["enabled", "closed"].includes(choice) : CAPABILITY_DISCLOSURES.includes(choice))));
8479
9244
  }
9245
+ var noSnapshot = () => void 0;
9246
+ function firstHumanMessageSeq(nodes) {
9247
+ if (nodes === null || nodes === void 0 || typeof nodes.values !== "function") return null;
9248
+ let first = null;
9249
+ for (const node of nodes.values()) {
9250
+ if (node?.kind !== "user" || node.data?.source?.kind !== "user") continue;
9251
+ const seq = node.anchorSeq ?? node.data?.seq;
9252
+ if (!Number.isSafeInteger(seq)) continue;
9253
+ if (first === null || seq < first) first = seq;
9254
+ }
9255
+ return first;
9256
+ }
9257
+ function capabilityReceiptVisible(node, { blank = false, firstUserSeq = null, windowComplete = true } = {}) {
9258
+ if (blank === true) return false;
9259
+ if (windowComplete !== true) return true;
9260
+ return !(Number.isSafeInteger(node?.seq) && Number.isSafeInteger(firstUserSeq) && node.seq < firstUserSeq);
9261
+ }
8480
9262
  function createCapabilityCommandCard(React32) {
8481
9263
  const h = React32.createElement;
8482
- return function CapabilityCommandCard({ node, t: t2 }) {
9264
+ return function CapabilityCommandCard({ node, t: t2, useChat, useSession }) {
8483
9265
  const [showSource, setShowSource] = React32.useState(false);
9266
+ const readSession = typeof useSession === "function" ? useSession : noSnapshot;
9267
+ const blank = readSession((snapshot2) => snapshot2?.blank === true) === true;
9268
+ const windowComplete = readSession((snapshot2) => snapshot2?.hasMore !== true);
9269
+ const readChat = typeof useChat === "function" ? useChat : noSnapshot;
9270
+ const firstUserSeq = readChat((snapshot2) => firstHumanMessageSeq(snapshot2?.nodes));
9271
+ if (typeof node.args !== "string") return null;
9272
+ if (!capabilityReceiptVisible(node, { blank, firstUserSeq, windowComplete })) return null;
8484
9273
  const command2 = `/${node.name ?? "capabilities"}${node.args ? ` ${String(node.args).trim()}` : ""}`;
8485
9274
  const text = node.outcome?.text;
8486
9275
  const receipt = readCapabilityCommandReceipt(text);
9276
+ if (receipt?.state === "pending") return null;
8487
9277
  const legacyRefresh = text === "Session capability environment refreshed; the model-visible notification is recorded.";
8488
9278
  if (receipt || String(node.args ?? "").trim() === "refresh" || legacyRefresh) {
8489
9279
  const outcome2 = receipt ? t2(`capabilities.card.${receipt.state}`, { error: receipt.error ?? "" }) : legacyRefresh ? t2("capabilities.card.recorded") : node.outcome ? (typeof text === "string" && !text.trim() ? void 0 : capabilityCommandText(t2, text)) ?? t2(node.outcome.kind === "error" ? "capabilities.commandFailed" : "capabilities.refreshAcknowledged") : t2("capabilities.refreshing");
9280
+ const notice = receipt?.proof === void 0 || outcome2 === void 0 ? outcome2 : `${outcome2} ${capabilityProofCopy(t2, receipt.proof)}`;
8490
9281
  return h("p", {
8491
9282
  className: "ptcPlusCapabilityCommandNotice",
8492
9283
  role: node.outcome?.kind === "error" ? "alert" : "status",
8493
9284
  "data-state": node.outcome?.kind ?? "pending"
8494
- }, outcome2);
9285
+ }, notice);
8495
9286
  }
8496
9287
  let json;
8497
9288
  if (typeof text === "string") {
@@ -8605,12 +9396,7 @@ function capabilityPlanReason(t2, entry) {
8605
9396
  function createCapabilitySettingsViews(React32, { SearchIcon, Select: Select2, Modal = createFallbackModal(React32) }) {
8606
9397
  const h = React32.createElement;
8607
9398
  const field = (key) => CONFIG_FIELDS.find((item) => item.key === key);
8608
- const responsibilityGroups = [
8609
- { tab: "manual", keys: ["rules"] },
8610
- { tab: "budgets", keys: ["description", "recovery", "preview"] },
8611
- { tab: "statistics", keys: ["statistics"] }
8612
- ];
8613
- const responsibilities = responsibilityGroups.flatMap((group) => group.keys);
9399
+ const responsibilities = ["rules", "description", "recovery", "preview", "statistics", "promptText"];
8614
9400
  const choicesFor = (configuration, plan) => {
8615
9401
  const historical = plan && ["ptc-capability-plan/v1", "ptc-capability-plan/v3"].includes(plan.schema) && configuration && configuration.capabilityPolicy === void 0;
8616
9402
  let statistics;
@@ -8625,7 +9411,10 @@ function createCapabilitySettingsViews(React32, { SearchIcon, Select: Select2, M
8625
9411
  enabled: configuration?.capabilityManagementEnabled ?? plan?.enabled,
8626
9412
  statistics,
8627
9413
  recoveryEnabled: configuration?.capabilityRecoveryEnabled ?? (historical ? plan.enabled : void 0),
8628
- previewEnabled: configuration?.modelPreviewEnabled ?? (historical ? plan.enabled : void 0)
9414
+ previewEnabled: configuration?.modelPreviewEnabled ?? (historical ? plan.enabled : void 0),
9415
+ // The switch is new: a stored configuration without it means "on", the
9416
+ // documented default, while an unreadable configuration stays unknown.
9417
+ promptTextEnabled: configuration === void 0 ? void 0 : configuration.capabilityPromptTextEnabled !== false
8629
9418
  };
8630
9419
  };
8631
9420
  const flagsFor = (settings) => ({
@@ -8633,7 +9422,8 @@ function createCapabilitySettingsViews(React32, { SearchIcon, Select: Select2, M
8633
9422
  description: settings.enabled,
8634
9423
  statistics: settings.statistics?.enabled,
8635
9424
  recovery: settings.recoveryEnabled,
8636
- preview: settings.previewEnabled
9425
+ preview: settings.previewEnabled,
9426
+ promptText: settings.promptTextEnabled
8637
9427
  });
8638
9428
  const choiceState = (retained, applied, key) => typeof retained[key] !== "boolean" ? "unknown" : retained[key] ? typeof applied[key] !== "boolean" ? "unknown" : applied[key] === false ? "paused" : "selected" : key === "rules" || key === "description" ? "host" : "unselected";
8639
9429
  function CombinationSummary({
@@ -8677,32 +9467,23 @@ function createCapabilitySettingsViews(React32, { SearchIcon, Select: Select2, M
8677
9467
  h("h4", null, t2("capabilities.combination.saved")),
8678
9468
  h("span", { className: "ptcPlusCapabilitySaveState", role: "status" }, feedback)
8679
9469
  ),
8680
- h("div", { className: "ptcPlusCombinationChoices" }, ...responsibilityGroups.map((group) => h(
8681
- "div",
8682
- {
8683
- key: group.tab,
8684
- className: "ptcPlusCombinationGroup",
8685
- role: "group",
8686
- "aria-label": t2(`capabilities.tab.${group.tab}`)
8687
- },
8688
- h("strong", { className: "ptcPlusCombinationGroupTitle" }, t2(`capabilities.tab.${group.tab}`)),
8689
- h("div", { className: "ptcPlusCombinationGroupChoices" }, ...group.keys.map((key) => {
8690
- const state = choiceState(retained, applied, key);
8691
- return h(
8692
- "button",
8693
- {
8694
- key,
8695
- type: "button",
8696
- className: "ptcPlusCombinationChoice",
8697
- "data-state": state,
8698
- "aria-controls": key === "rules" || key === "statistics" ? `${id2}-pane-${group.tab}` : `${id2}-context-pane-${key}`,
8699
- onClick: () => onNavigate(key)
8700
- },
8701
- h("span", null, t2(`capabilities.combination.${key}`)),
8702
- h("small", null, t2(`capabilities.combination.state.${state}`))
8703
- );
8704
- }))
8705
- ))),
9470
+ h("div", { className: "ptcPlusCombinationChoices" }, ...responsibilities.map((key) => {
9471
+ const state = choiceState(retained, applied, key);
9472
+ return h(
9473
+ "button",
9474
+ {
9475
+ key,
9476
+ type: "button",
9477
+ className: "ptcPlusCombinationChoice",
9478
+ "data-state": state,
9479
+ "data-choice": key,
9480
+ "aria-controls": key === "promptText" ? `${id2}-pane-prompt` : key === "rules" || key === "statistics" ? `${id2}-pane-${key === "rules" ? "manual" : "statistics"}` : `${id2}-context-pane-${key}`,
9481
+ onClick: () => onNavigate(key)
9482
+ },
9483
+ h("span", null, t2(`capabilities.combination.${key}`)),
9484
+ h("small", null, t2(`capabilities.combination.state.${state}`))
9485
+ );
9486
+ })),
8706
9487
  h("p", { className: "ptcPlusDetail", role: "status" }, effect),
8707
9488
  h(
8708
9489
  "details",
@@ -10041,6 +10822,451 @@ function createCapabilitySettingsViews(React32, { SearchIcon, Select: Select2, M
10041
10822
  update(tabs[next]);
10042
10823
  event.currentTarget.parentElement.querySelectorAll("[role=tab]")[next].focus({ preventScroll: true });
10043
10824
  }
10825
+ const PROMPT_REASON_KEYS = Object.freeze({
10826
+ "fact-derived": "factDerived",
10827
+ "aggregate-frozen": "aggregateFrozen",
10828
+ "protocol-exact-text": "protocolExactText",
10829
+ "protocol-structural": "protocolStructural",
10830
+ "shadows-host": "shadowsHost",
10831
+ "other-owner": "otherOwner"
10832
+ });
10833
+ function promptReasonLabel(t2, reason) {
10834
+ const key = PROMPT_REASON_KEYS[reason];
10835
+ return key === void 0 ? reason : t2(`capabilities.prompt.reason.${key}`);
10836
+ }
10837
+ function promptKindLabel(t2, kind) {
10838
+ return kind === void 0 ? "" : t2(`capabilities.prompt.kind.${kind}`);
10839
+ }
10840
+ function PromptTextSettings({ value, disabled, onChange, t: t2, id: id2 }) {
10841
+ let document2;
10842
+ let readError;
10843
+ try {
10844
+ document2 = parsePromptTextDocument(value.promptText);
10845
+ } catch (error) {
10846
+ readError = error.message;
10847
+ document2 = { schema: PROMPT_TEXT_SCHEMA, overrides: {} };
10848
+ }
10849
+ const paused = value.capabilityPromptTextEnabled === false;
10850
+ const blocked = paused || disabled === true || typeof disabled === "function" && disabled("promptText") === true;
10851
+ const resolved = resolvePromptText(value.promptText);
10852
+ const account = accountPromptText(resolved);
10853
+ const [draft, setDraft] = React32.useState(null);
10854
+ const [selectedAnchorId, setSelectedAnchorId] = React32.useState(null);
10855
+ const anchorPanelRef = React32.useRef(null);
10856
+ const [openSlots, setOpenSlots] = React32.useState({});
10857
+ const overrides2 = draft ?? document2.overrides;
10858
+ const byteCount = (text) => new TextEncoder().encode(text).length;
10859
+ const group = (number2) => String(Math.round(number2)).replace(/\B(?=(\d{3})+(?!\d))/gu, " ");
10860
+ const bytePair = (bytes) => t2("capabilities.prompt.bytesPair", {
10861
+ bytes: group(bytes),
10862
+ kb: (bytes / 1024).toFixed(1)
10863
+ });
10864
+ const write2 = (next) => onChange(
10865
+ CONFIG_FIELDS.find((field2) => field2.key === "promptText"),
10866
+ JSON.stringify({ schema: PROMPT_TEXT_SCHEMA, overrides: next })
10867
+ );
10868
+ const update = (slotId, next) => {
10869
+ const base2 = { ...overrides2 };
10870
+ if (next === void 0) delete base2[slotId];
10871
+ else base2[slotId] = next;
10872
+ setDraft(base2);
10873
+ };
10874
+ const save = () => {
10875
+ if (draft === null) return;
10876
+ write2(draft);
10877
+ setDraft(null);
10878
+ };
10879
+ const cancel = () => setDraft(null);
10880
+ const pending = draft !== null;
10881
+ const unmeasuredSlots = account.counts.unmeasuredSlots;
10882
+ const dynamicSlots = account.counts.dynamicSlots;
10883
+ const unwiredAnchors = account.anchors.filter((anchor) => anchor.wired !== true);
10884
+ const measuredBytes = account.owners.A + account.owners.B + account.owners.C;
10885
+ const ownerOf = (anchor) => anchor.owner === "mixed" ? "mixed" : anchor.owner;
10886
+ const ownerAnchors = (key) => account.anchors.filter((anchor) => ownerOf(anchor) === key).length;
10887
+ const icon = (path) => h("svg", {
10888
+ viewBox: "0 0 20 20",
10889
+ width: 16,
10890
+ height: 16,
10891
+ fill: "none",
10892
+ stroke: "currentColor",
10893
+ "stroke-width": 1.6,
10894
+ "stroke-linecap": "round",
10895
+ "stroke-linejoin": "round",
10896
+ "aria-hidden": "true"
10897
+ }, ...path.map((d, index2) => h("path", { key: index2, d })));
10898
+ const card = (key, labelKey, glyph) => {
10899
+ const mixed = key === "mixed";
10900
+ const bytes = account.owners[key] ?? 0;
10901
+ const value_ = mixed ? t2("capabilities.prompt.cardMixed", { count: ownerAnchors("mixed") }) : bytes > 0 ? `${bytePair(bytes)} \xB7 ${t2("capabilities.prompt.cardMetaAnchors", { count: ownerAnchors(key) })}` : t2("capabilities.prompt.cardMetaAnchors", { count: ownerAnchors(key) });
10902
+ return h(
10903
+ "div",
10904
+ { key, className: "ptcPlusPromptCard", "data-owner": key },
10905
+ h("span", { className: "ptcPlusPromptCardIcon" }, glyph),
10906
+ h(
10907
+ "span",
10908
+ { className: "ptcPlusPromptCardBody" },
10909
+ h("span", { className: "ptcPlusPromptCardLabel" }, t2(labelKey)),
10910
+ mixed ? h("span", { className: "ptcPlusPromptCardMeta" }, value_) : h("span", { className: "ptcPlusPromptCardValue", "data-owner-bytes": String(account.owners[key] ?? 0) }, value_)
10911
+ )
10912
+ );
10913
+ };
10914
+ const cards = h(
10915
+ "div",
10916
+ { className: "ptcPlusPromptCards" },
10917
+ card("A", "capabilities.prompt.ownerEditable", icon(["M4 16h3l9-9-3-3-9 9v3Z", "M12.5 4.5 15.5 7.5"])),
10918
+ card("B", "capabilities.prompt.ownerReadOnly", icon(["M5.5 9V6.5a4.5 4.5 0 0 1 9 0V9", "M4.5 9h11v7h-11Z"])),
10919
+ card("C", "capabilities.prompt.ownerOther", icon(["M10 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z", "M4 17c0-3 2.7-5 6-5s6 2 6 5"])),
10920
+ card("mixed", "capabilities.prompt.ownerMixed", icon(["M4 6h12", "M4 10h12", "M4 14h12", "M13 4v4", "M7 8v4"]))
10921
+ );
10922
+ const strip = h(
10923
+ "p",
10924
+ { className: "ptcPlusPromptStrip", "data-prompt-strip": String(unwiredAnchors.length) },
10925
+ t2("capabilities.prompt.strip", {
10926
+ anchors: unwiredAnchors.length,
10927
+ bytes: group(measuredBytes),
10928
+ kb: (measuredBytes / 1024).toFixed(1),
10929
+ total: account.counts.total
10930
+ })
10931
+ );
10932
+ const reasonsOf = (anchor) => {
10933
+ const reasons = [...new Set(anchor.slots.map((slot) => slot.reason).filter(Boolean))];
10934
+ return reasons.length === 0 ? "\u2014" : reasons.map((reason) => promptReasonLabel(t2, reason)).join(" + ");
10935
+ };
10936
+ const kindsOf = (anchor) => [...new Set(anchor.slots.map((slot) => slot.kind))].map((kind) => promptKindLabel(t2, kind)).join(" + ");
10937
+ const splitOf = (anchor) => {
10938
+ const measured = anchor.slots.filter((slot) => slot.measured === true && slot.bytes > 0);
10939
+ return measured.length > 1 ? t2("capabilities.prompt.anchorBytesSplit", {
10940
+ parts: measured.map((slot) => `${slot.slotId.split(".").pop()} ${slot.bytes}`).join(" / ")
10941
+ }) : null;
10942
+ };
10943
+ const select = (anchorId) => setSelectedAnchorId(anchorId);
10944
+ React32.useEffect(() => {
10945
+ if (selectedAnchorId === null) return;
10946
+ const node = anchorPanelRef.current;
10947
+ if (node === null || typeof node.scrollIntoView !== "function") return;
10948
+ node.scrollIntoView({ block: "nearest", behavior: "smooth" });
10949
+ }, [selectedAnchorId]);
10950
+ const rowKey = (event, anchorId) => {
10951
+ if (event.key !== "Enter" && event.key !== " ") return;
10952
+ event.preventDefault();
10953
+ select(anchorId);
10954
+ };
10955
+ const anchorRow = (anchor, index2) => {
10956
+ const split = splitOf(anchor);
10957
+ return h(
10958
+ "tr",
10959
+ {
10960
+ key: anchor.anchorId,
10961
+ className: "ptcPlusPromptRow",
10962
+ "data-anchor-id": anchor.anchorId,
10963
+ "data-wired": anchor.wired === true ? "true" : "false",
10964
+ // A plain <table> row cannot carry aria-selected (that needs role="grid"),
10965
+ // so the expanded row is announced with aria-current instead.
10966
+ "data-selected": selectedAnchorId === anchor.anchorId ? "true" : "false",
10967
+ "aria-current": selectedAnchorId === anchor.anchorId ? "true" : void 0,
10968
+ tabIndex: 0,
10969
+ onClick: () => select(anchor.anchorId),
10970
+ onKeyDown: (event) => rowKey(event, anchor.anchorId)
10971
+ },
10972
+ h("td", { className: "ptcPlusPromptIndex" }, String(index2)),
10973
+ h("td", null, h("span", { className: "ptcPlusPromptChannel", "data-channel": anchor.channel }, anchor.channel)),
10974
+ h("td", null, h("code", { className: "ptcPlusPromptAnchorId", title: anchor.anchorId }, anchor.anchorId)),
10975
+ h("td", null, h("span", { className: "ptcPlusPromptPresence", title: t2(anchor.presence) }, t2(anchor.presence))),
10976
+ h(
10977
+ "td",
10978
+ { className: "ptcPlusPromptBytesCell" },
10979
+ anchor.wired !== true ? h("span", { "data-anchor-bytes": "unwired" }, t2("capabilities.prompt.unwiredRow", { slots: anchor.unmeasuredSlots })) : h(
10980
+ "span",
10981
+ { "data-anchor-bytes": String(anchor.bytes) },
10982
+ paused ? t2("capabilities.prompt.pausedBytes", { bytes: anchor.bytes }) : t2("capabilities.prompt.cardBytes", { bytes: anchor.bytes }),
10983
+ split === null ? null : h("small", { className: "ptcPlusPromptSplit", "data-anchor-split": "true" }, split)
10984
+ )
10985
+ ),
10986
+ h("td", { className: "ptcPlusPromptReasonCell" }, reasonsOf(anchor)),
10987
+ h(
10988
+ "td",
10989
+ { className: "ptcPlusPromptKindCell" },
10990
+ kindsOf(anchor),
10991
+ anchor.wired !== true ? h(
10992
+ "span",
10993
+ { className: "ptcPlusPromptTag", "data-prompt-unwired-tag": "true" },
10994
+ t2("capabilities.prompt.unwiredTag")
10995
+ ) : null
10996
+ )
10997
+ );
10998
+ };
10999
+ const hostRow = (section, index2) => h(
11000
+ "tr",
11001
+ {
11002
+ key: section.id,
11003
+ className: "ptcPlusPromptRow ptcPlusPromptHostRow",
11004
+ "data-host-row": section.id
11005
+ },
11006
+ h("td", { className: "ptcPlusPromptIndex" }, String(index2)),
11007
+ h("td", null, h("span", { className: "ptcPlusPromptChannel" }, "prompt")),
11008
+ h("td", null, h("code", { className: "ptcPlusPromptAnchorId", title: section.id }, section.id)),
11009
+ h("td", null, h("span", { className: "ptcPlusPromptPresence" }, t2(section.presence))),
11010
+ h("td", { className: "ptcPlusPromptBytesCell" }, t2("capabilities.prompt.hostUnavailable")),
11011
+ h("td", { className: "ptcPlusPromptReasonCell" }, "\u2014"),
11012
+ h("td", { className: "ptcPlusPromptKindCell" }, t2("capabilities.prompt.ownerHost"))
11013
+ );
11014
+ const table = h(
11015
+ "table",
11016
+ { className: "ptcPlusPromptTable" },
11017
+ h(
11018
+ "colgroup",
11019
+ null,
11020
+ h("col", { className: "ptcPlusPromptColIndex" }),
11021
+ h("col", { className: "ptcPlusPromptColChannel" }),
11022
+ h("col", { className: "ptcPlusPromptColAnchor" }),
11023
+ h("col", { className: "ptcPlusPromptColPresence" }),
11024
+ h("col", { className: "ptcPlusPromptColBytes" }),
11025
+ h("col", { className: "ptcPlusPromptColReason" }),
11026
+ h("col", { className: "ptcPlusPromptColKind" })
11027
+ ),
11028
+ h("thead", null, h(
11029
+ "tr",
11030
+ null,
11031
+ h("th", { scope: "col", className: "ptcPlusPromptIndex" }, ""),
11032
+ h("th", { scope: "col" }, t2("capabilities.prompt.columnChannel")),
11033
+ h("th", { scope: "col" }, t2("capabilities.prompt.columnAnchor")),
11034
+ h("th", { scope: "col" }, t2("capabilities.prompt.columnPresence")),
11035
+ h("th", { scope: "col" }, t2("capabilities.prompt.columnBytesSplit")),
11036
+ h("th", { scope: "col" }, t2("capabilities.prompt.columnReason")),
11037
+ h("th", { scope: "col" }, t2("capabilities.prompt.columnKind"))
11038
+ )),
11039
+ h(
11040
+ "tbody",
11041
+ null,
11042
+ ...account.anchors.map((anchor, index2) => anchorRow(anchor, index2 + 1)),
11043
+ ...HOST_CONTEXT_SECTIONS.map((section, index2) => hostRow(section, account.anchors.length + index2 + 1))
11044
+ )
11045
+ );
11046
+ const chip = (anchor, slot) => {
11047
+ const templateBytes = slot.measured === true && slot.kind === "projected";
11048
+ const aggregateSet = slot.kind === "aggregate";
11049
+ const shared = {
11050
+ className: "ptcPlusPromptChip",
11051
+ "data-slot-id": slot.slotId,
11052
+ "data-slot-kind": slot.kind,
11053
+ ...templateBytes ? { "data-prompt-template-bytes": "true" } : {},
11054
+ ...aggregateSet ? { "data-prompt-aggregate-set": "true" } : {},
11055
+ title: templateBytes ? `${slot.slotId} \xB7 ${t2("capabilities.prompt.templateBytes")}` : aggregateSet ? `${slot.slotId} \xB7 ${t2("capabilities.prompt.aggregateFrozen")}` : slot.slotId
11056
+ };
11057
+ if (slot.owner !== "A") {
11058
+ return h(
11059
+ "span",
11060
+ { key: slot.slotId, ...shared, "data-readonly": "true" },
11061
+ h("span", { className: "ptcPlusPromptChipLabel" }, slot.slotId),
11062
+ h(
11063
+ "span",
11064
+ { className: "ptcPlusPromptChipNote" },
11065
+ t2("capabilities.prompt.readonlyReason", { reason: promptReasonLabel(t2, slot.reason), kind: promptKindLabel(t2, slot.kind) })
11066
+ )
11067
+ );
11068
+ }
11069
+ const selected = (openSlots[anchor.anchorId] ?? editableSlots(anchor)[0]?.slotId) === slot.slotId;
11070
+ return h("button", {
11071
+ key: slot.slotId,
11072
+ ...shared,
11073
+ type: "button",
11074
+ disabled: blocked,
11075
+ "aria-pressed": selected,
11076
+ onClick: () => setOpenSlots((previous) => ({ ...previous, [anchor.anchorId]: slot.slotId }))
11077
+ }, h("span", { className: "ptcPlusPromptChipLabel" }, slot.slotId));
11078
+ };
11079
+ const editableSlots = (anchor) => anchor.slots.filter((slot) => slot.owner === "A" && PROMPT_ASSETS.find((candidate) => candidate.id === slot.slotId)?.defaultText !== null);
11080
+ const editorFor = (anchor) => {
11081
+ const slots = editableSlots(anchor);
11082
+ if (anchor.wired !== true || slots.length === 0) return null;
11083
+ const selectedId = openSlots[anchor.anchorId] ?? slots[0].slotId;
11084
+ const slot = slots.find((candidate) => candidate.slotId === selectedId) ?? slots[0];
11085
+ const asset = PROMPT_ASSETS.find((candidate) => candidate.id === slot.slotId);
11086
+ const override = Object.hasOwn(overrides2, slot.slotId) ? overrides2[slot.slotId] : void 0;
11087
+ const current = override ?? asset.defaultText;
11088
+ return h(
11089
+ "div",
11090
+ { key: slot.slotId, className: "ptcPlusPromptEditor", "data-editor-slot": slot.slotId },
11091
+ h("textarea", {
11092
+ id: `${id2}-prompt-${slot.slotId}`,
11093
+ rows: 3,
11094
+ disabled: blocked,
11095
+ spellCheck: false,
11096
+ className: "ptcPlusPromptTextarea",
11097
+ "aria-label": slot.slotId,
11098
+ value: current,
11099
+ onChange: (event) => update(slot.slotId, event.target.value === "" ? void 0 : event.target.value)
11100
+ }),
11101
+ h(
11102
+ "div",
11103
+ { className: "ptcPlusPromptEditorFoot" },
11104
+ h(
11105
+ "span",
11106
+ { className: "ptcPlusPromptHint" },
11107
+ t2("capabilities.prompt.bytesOfLimit", { used: byteCount(current), max: PROMPT_TEXT_MAX_SLOT_BYTES })
11108
+ ),
11109
+ h(
11110
+ "span",
11111
+ { className: "ptcPlusPromptEditorActions" },
11112
+ asset.omittable ? h("button", {
11113
+ type: "button",
11114
+ className: "ptcPlusButton",
11115
+ disabled: blocked,
11116
+ onClick: () => update(slot.slotId, "")
11117
+ }, t2("capabilities.prompt.omit")) : null,
11118
+ h("button", {
11119
+ type: "button",
11120
+ className: "ptcPlusButton",
11121
+ disabled: blocked || override === void 0,
11122
+ onClick: () => update(slot.slotId, void 0)
11123
+ }, t2("capabilities.prompt.reset"))
11124
+ )
11125
+ )
11126
+ );
11127
+ };
11128
+ const defaultAnchor = account.anchors.find((anchor) => anchor.wired === true && editableSlots(anchor).length > 0);
11129
+ const selectedAnchor = account.anchors.find((anchor) => anchor.anchorId === selectedAnchorId) ?? defaultAnchor;
11130
+ const selectedIndex = selectedAnchor === void 0 ? 0 : account.anchors.indexOf(selectedAnchor) + 1;
11131
+ const anchorPanel = h(
11132
+ "section",
11133
+ { className: "ptcPlusPromptPanel", "data-prompt-panel": "anchor", ref: anchorPanelRef },
11134
+ h(
11135
+ "h5",
11136
+ { className: "ptcPlusPromptPanelTitle" },
11137
+ t2("capabilities.prompt.rowExpand", { index: selectedIndex })
11138
+ ),
11139
+ selectedAnchor === void 0 ? h("p", { className: "ptcPlusPromptHint" }, t2("capabilities.prompt.rowExpandHint")) : h(
11140
+ "div",
11141
+ { className: "ptcPlusPromptPanelBody" },
11142
+ h(
11143
+ "div",
11144
+ { className: "ptcPlusPromptChips", "data-anchor-chips": selectedAnchor.anchorId },
11145
+ ...selectedAnchor.slots.map((slot) => chip(selectedAnchor, slot))
11146
+ ),
11147
+ selectedAnchor.wired !== true ? h("p", { className: "ptcPlusPromptHint" }, t2("capabilities.prompt.unwiredRow", { slots: selectedAnchor.unmeasuredSlots })) : editorFor(selectedAnchor)
11148
+ )
11149
+ );
11150
+ const changes = account.anchors.flatMap((anchor) => anchor.slots.map((slot) => ({ slot, builtin: PROMPT_ASSETS.find((asset) => asset.id === slot.slotId)?.defaultText })).filter((entry) => typeof entry.builtin === "string" && Object.hasOwn(overrides2, entry.slot.slotId) && overrides2[entry.slot.slotId] !== entry.builtin).map((entry) => {
11151
+ const effective = overrides2[entry.slot.slotId];
11152
+ const effect = anchor.channel === "plan" ? t2("capabilities.prompt.effectPlan") : anchor.channel === "install" ? t2("capabilities.prompt.effectInstall") : anchor.channel === "prompt" ? t2("capabilities.prompt.effectPrompt") : t2("capabilities.prompt.effectTrigger");
11153
+ return {
11154
+ anchor,
11155
+ slot: entry.slot,
11156
+ effect,
11157
+ before: byteCount(entry.builtin),
11158
+ after: byteCount(effective),
11159
+ delta: byteCount(effective) - byteCount(entry.builtin)
11160
+ };
11161
+ }));
11162
+ const restoreSlot = (slotId) => update(slotId, void 0);
11163
+ const diffPanel = h(
11164
+ "section",
11165
+ {
11166
+ className: "ptcPlusPromptPanel",
11167
+ ...changes.length === 0 ? {} : { "data-prompt-diff": "true" },
11168
+ "data-prompt-diff-panel": "true"
11169
+ },
11170
+ h("h5", { className: "ptcPlusPromptPanelTitle" }, t2("capabilities.prompt.diffTitle")),
11171
+ changes.length === 0 ? h("p", { className: "ptcPlusPromptHint" }, t2("capabilities.prompt.diffEmpty")) : h(
11172
+ "ul",
11173
+ { className: "ptcPlusPromptDiffList" },
11174
+ ...changes.map((entry, index2) => h(
11175
+ "li",
11176
+ {
11177
+ key: entry.slot.slotId,
11178
+ className: "ptcPlusPromptDiffRow",
11179
+ "data-diff-anchor": entry.anchor.anchorId,
11180
+ "data-diff-slot": entry.slot.slotId
11181
+ },
11182
+ h("span", { className: "ptcPlusPromptDot", "data-tone": String(index2 % 3) }),
11183
+ h(
11184
+ "span",
11185
+ { className: "ptcPlusPromptDiffBody" },
11186
+ h(
11187
+ "span",
11188
+ { className: "ptcPlusPromptDiffHead" },
11189
+ h("code", { className: "ptcPlusPromptDiffSlot" }, entry.slot.slotId),
11190
+ h("span", { className: "ptcPlusPromptHint" }, entry.effect)
11191
+ ),
11192
+ h(
11193
+ "span",
11194
+ { className: "ptcPlusPromptDiffDelta" },
11195
+ t2("capabilities.prompt.diffBytes", {
11196
+ before: group(entry.before),
11197
+ after: group(entry.after),
11198
+ delta: entry.delta > 0 ? `+${group(entry.delta)}` : group(entry.delta)
11199
+ }),
11200
+ h("button", {
11201
+ type: "button",
11202
+ className: "ptcPlusButton",
11203
+ disabled: blocked,
11204
+ onClick: () => restoreSlot(entry.slot.slotId)
11205
+ }, t2("capabilities.prompt.reset"))
11206
+ )
11207
+ )
11208
+ ))
11209
+ ),
11210
+ h(
11211
+ "div",
11212
+ { className: "ptcPlusPromptActions" },
11213
+ h("button", {
11214
+ type: "button",
11215
+ className: "ptcPlusButton",
11216
+ "data-kind": "primary",
11217
+ disabled: blocked || !pending,
11218
+ onClick: save
11219
+ }, t2("capabilities.prompt.save")),
11220
+ h(
11221
+ "button",
11222
+ { type: "button", className: "ptcPlusButton", disabled: blocked || !pending, onClick: cancel },
11223
+ t2("capabilities.prompt.cancel")
11224
+ )
11225
+ )
11226
+ );
11227
+ return h(
11228
+ "section",
11229
+ {
11230
+ className: "ptcPlusPromptText",
11231
+ "data-prompt-paused": paused ? "true" : "false"
11232
+ },
11233
+ h(
11234
+ "header",
11235
+ { className: "ptcPlusPromptHeader" },
11236
+ h("span", { className: "ptcPlusPromptHeaderIcon" }, icon(["M10 2.5 12 8l5.5 2-5.5 2-2 5.5-2-5.5L2.5 10 8 8Z"])),
11237
+ h(
11238
+ "span",
11239
+ { className: "ptcPlusPromptHeaderBody" },
11240
+ h("h4", { className: "ptcPlusPromptTitle" }, t2("capabilities.prompt.title")),
11241
+ h("p", { className: "ptcPlusPromptSubtitle" }, t2("capabilities.prompt.subtitle"))
11242
+ )
11243
+ ),
11244
+ paused ? h(
11245
+ "p",
11246
+ { className: "ptcPlusPromptPaused", role: "status", "data-prompt-paused-notice": "true" },
11247
+ t2("capabilities.prompt.paused")
11248
+ ) : null,
11249
+ readError === void 0 ? null : h("p", { className: "ptcPlusPromptHint" }, t2("capabilities.prompt.unreadable", { error: readError })),
11250
+ ...resolved.reported.map((entry, index2) => h(
11251
+ "p",
11252
+ { key: `report-${index2}`, className: "ptcPlusPromptHint" },
11253
+ t2("capabilities.prompt.reported", {
11254
+ asset: entry.slotId ?? entry.anchorId ?? "document",
11255
+ reason: entry.reason
11256
+ })
11257
+ )),
11258
+ cards,
11259
+ strip,
11260
+ h(
11261
+ "p",
11262
+ { className: "ptcPlusPromptHint", "data-prompt-slot-counts": "true" },
11263
+ t2("capabilities.prompt.slotCounts", { bytes: group(measuredBytes), unmeasured: unmeasuredSlots, dynamic: dynamicSlots })
11264
+ ),
11265
+ table,
11266
+ h("div", { className: "ptcPlusPromptPanels" }, anchorPanel, diffPanel),
11267
+ h("p", { className: "ptcPlusPromptIntro" }, t2("capabilities.prompt.intro"))
11268
+ );
11269
+ }
10044
11270
  function CapabilityWorkbench({
10045
11271
  value,
10046
11272
  configurationReady,
@@ -10070,7 +11296,7 @@ function createCapabilitySettingsViews(React32, { SearchIcon, Select: Select2, M
10070
11296
  }) {
10071
11297
  const [tab, setTab] = React32.useState("manual");
10072
11298
  const [contextSection, setContextSection] = React32.useState("description");
10073
- const tabs = ["manual", "budgets", "statistics", "plans"];
11299
+ const tabs = ["manual", "budgets", "statistics", "prompt", "plans"];
10074
11300
  const feedback = saving ? t2("state.syncing") : saveStatus && saveStatus.key !== "status.applied" ? t2(saveStatus.key, saveStatus.params) : t2(configurationWritable ? "capabilities.savedForNew" : "footer.readOnly");
10075
11301
  return h(
10076
11302
  "div",
@@ -10090,7 +11316,7 @@ function createCapabilitySettingsViews(React32, { SearchIcon, Select: Select2, M
10090
11316
  t: t2,
10091
11317
  id: id2,
10092
11318
  onNavigate: (key) => {
10093
- setTab(key === "rules" ? "manual" : key === "statistics" ? "statistics" : "budgets");
11319
+ setTab(key === "rules" ? "manual" : key === "statistics" ? "statistics" : key === "promptText" ? "prompt" : "budgets");
10094
11320
  if (["description", "recovery", "preview"].includes(key)) setContextSection(key);
10095
11321
  }
10096
11322
  }),
@@ -10119,7 +11345,7 @@ function createCapabilitySettingsViews(React32, { SearchIcon, Select: Select2, M
10119
11345
  "aria-labelledby": `${id2}-tab-${key}`,
10120
11346
  hidden: tab !== key
10121
11347
  },
10122
- h(
11348
+ key === "prompt" ? null : h(
10123
11349
  "div",
10124
11350
  { className: "ptcPlusTaskHead" },
10125
11351
  h("h4", null, t2(`capabilities.title.${key}`)),
@@ -10167,7 +11393,7 @@ function createCapabilitySettingsViews(React32, { SearchIcon, Select: Select2, M
10167
11393
  id: id2,
10168
11394
  section: contextSection,
10169
11395
  setSection: setContextSection
10170
- }) : h(ConfigurationProfiles, { value, plans, disabled, writable: configurationWritable, onChange, onApplyConfiguration, t: t2 })
11396
+ }) : key === "prompt" ? tab === "prompt" ? h(PromptTextSettings, { value, disabled, onChange, t: t2, id: id2 }) : null : h(ConfigurationProfiles, { value, plans, disabled, writable: configurationWritable, onChange, onApplyConfiguration, t: t2 })
10171
11397
  ))
10172
11398
  );
10173
11399
  }
@@ -10245,6 +11471,7 @@ function createCapabilityRefreshView(React32, commands) {
10245
11471
  function createSessionCapabilityControlsView(React32, { commands, Modal, Select: Select2, inspectSessionCatalog }) {
10246
11472
  const h = React32.createElement;
10247
11473
  const emptyDrafts = () => ({});
11474
+ const emptyProofs = () => ({});
10248
11475
  return function SessionCapabilityControls({ sessionId, open, enabled, t: t2, onClose }) {
10249
11476
  const source = React32.useMemo(() => commands.source(sessionId), [sessionId]);
10250
11477
  const available = React32.useSyncExternalStore(source.subscribe, source.getSnapshot);
@@ -10266,6 +11493,7 @@ function createSessionCapabilityControlsView(React32, { commands, Modal, Select:
10266
11493
  const [sort2, setSort] = React32.useState(null);
10267
11494
  const [focusDimension, setFocusDimension] = React32.useState(null);
10268
11495
  const [status, setStatus] = React32.useState(null);
11496
+ const [proofs, setProofs] = React32.useState(emptyProofs);
10269
11497
  const [pending, setPending] = React32.useState(false);
10270
11498
  const request = React32.useRef(null);
10271
11499
  const applying = React32.useRef(false);
@@ -10300,6 +11528,7 @@ function createSessionCapabilityControlsView(React32, { commands, Modal, Select:
10300
11528
  setPane("list");
10301
11529
  setFocusDimension(null);
10302
11530
  setStatus(null);
11531
+ setProofs(emptyProofs());
10303
11532
  setPending(false);
10304
11533
  setError(null);
10305
11534
  }, [sessionId]);
@@ -10430,15 +11659,18 @@ function createSessionCapabilityControlsView(React32, { commands, Modal, Select:
10430
11659
  let pendingCount = 0;
10431
11660
  let failure = null;
10432
11661
  let savedOnly = null;
11662
+ const observed = {};
10433
11663
  for (const [id2, selection, dimension] of staged) {
10434
11664
  if (controller.signal.aborted) break;
11665
+ const line = `set ${targetScope} ${encodeURIComponent(id2)} ${dimension ? dimension + " " : ""}${selection}`;
10435
11666
  try {
10436
- const result = await commands.run(sessionId, `set ${targetScope} ${encodeURIComponent(id2)} ${dimension ? dimension + " " : ""}${selection}`, controller.signal);
11667
+ const result = await commands.run(sessionId, line, controller.signal);
10437
11668
  const receipt = readCapabilityCommandReceipt(result.text);
10438
11669
  if (!receipt || receipt.sessionId !== sessionId || !["recorded", "pending"].includes(receipt.state)) {
10439
11670
  throw new Error(receipt ? capabilityCommandText(t2, result.text) : t2("capabilities.quick.unknownReceipt"));
10440
11671
  }
10441
11672
  if (receipt?.state === "pending") pendingCount += 1;
11673
+ if (receipt.proof !== void 0) observed[receipt.proof.id] = { proof: receipt.proof, command: `/capabilities ${line}` };
10442
11674
  completed += 1;
10443
11675
  } catch (cause) {
10444
11676
  failure = String(cause?.message ?? cause);
@@ -10446,6 +11678,7 @@ function createSessionCapabilityControlsView(React32, { commands, Modal, Select:
10446
11678
  break;
10447
11679
  }
10448
11680
  }
11681
+ if (mounted.current && Object.keys(observed).length) setProofs((current) => ({ ...current, ...observed }));
10449
11682
  if (request.current !== controller || controller.signal.aborted || !mounted.current) return;
10450
11683
  const refreshed = await load(controller.signal);
10451
11684
  if (request.current !== controller || controller.signal.aborted || !mounted.current) return;
@@ -10839,6 +12072,17 @@ function createSessionCapabilityControlsView(React32, { commands, Modal, Select:
10839
12072
  selected.sourceDimensions ? h(React32.Fragment, null, h("dt", null, t2("capabilities.policy.frozenSource")), h("dd", null, dimensionFacts(selected.sourceDimensions))) : null,
10840
12073
  selected.effectiveDimensions ? h(React32.Fragment, null, h("dt", null, t2("capabilities.policy.effectiveDimensions")), h("dd", null, dimensionFacts(selected.effectiveDimensions))) : null
10841
12074
  ),
12075
+ h(
12076
+ "div",
12077
+ { className: "ptcPlusCapabilityProof", "data-capability-proof": selected.id },
12078
+ h("h4", null, t2("capabilities.proof.title")),
12079
+ proofs[selected.id] ? h(
12080
+ React32.Fragment,
12081
+ null,
12082
+ h("p", { className: "ptcPlusDetail", role: "status" }, capabilityProofCopy(t2, proofs[selected.id].proof)),
12083
+ h("small", null, t2("capabilities.proof.observed", { command: proofs[selected.id].command }))
12084
+ ) : h("p", { className: "ptcPlusDetail" }, t2("capabilities.proof.unobserved"))
12085
+ ),
10842
12086
  selected.source?.kind === "mcp" && selected.category !== "server" ? (() => {
10843
12087
  const server = catalog.find((entry) => entry.category === "server" && entry.source?.server === selected.source.server);
10844
12088
  if (!server) return null;
@@ -11835,6 +13079,7 @@ function createReplView(React32, deps) {
11835
13079
  Select: Select2,
11836
13080
  featureEnabled: featureEnabled2,
11837
13081
  normalizeReplMemorySnapshot: normalizeReplMemorySnapshot2,
13082
+ normalizeReplMemoryView: normalizeReplMemoryView2,
11838
13083
  unavailableReplMemorySnapshot: unavailableReplMemorySnapshot2,
11839
13084
  useSessionPreset: useSessionPreset2,
11840
13085
  sessionUsesPtcPreset: sessionUsesPtcPreset2,
@@ -11847,21 +13092,29 @@ function createReplView(React32, deps) {
11847
13092
  return null;
11848
13093
  }
11849
13094
  function useObservedReplMemory({ sessionId, projected, active, elementRef, observeRepl }) {
11850
- const memory = React32.useMemo(() => {
13095
+ const view = React32.useMemo(() => {
11851
13096
  try {
11852
- return normalizeReplMemorySnapshot2(projected);
13097
+ return normalizeReplMemoryView2(projected);
11853
13098
  } catch {
11854
- return unavailableReplMemorySnapshot2();
13099
+ return void 0;
11855
13100
  }
11856
13101
  }, [projected]);
13102
+ const memory = view?.memory ?? unavailableReplMemorySnapshot2();
11857
13103
  const [observed, setObserved] = React32.useState(null);
11858
13104
  React32.useEffect(() => active && typeof observeRepl === "function" ? observeRepl(
11859
13105
  sessionId,
11860
13106
  elementRef.current,
11861
13107
  memory,
11862
- (value) => setObserved({ sessionId, source: memory, value })
11863
- ) : void 0, [active, observeRepl, sessionId, memory, elementRef]);
11864
- return observed?.sessionId === sessionId && observed.source === memory ? observed.value : memory;
13108
+ (value) => setObserved({ sessionId, runtime: view?.runtime, source: memory, value })
13109
+ ) : void 0, [active, observeRepl, sessionId, memory, view, elementRef]);
13110
+ if (observed?.sessionId !== sessionId) return { memory, provenance: "current" };
13111
+ if (view !== void 0 && observed.runtime !== view.runtime && !(observed.runtime === void 0 && view.runtime === void 0)) {
13112
+ return { memory, provenance: "previous-runtime" };
13113
+ }
13114
+ if (observed.runtime === view?.runtime && !memory.available && observed.value?.available === true) {
13115
+ return { memory: observed.value, provenance: "refreshed" };
13116
+ }
13117
+ return { memory: observed.source === memory ? observed.value : memory, provenance: "current" };
11865
13118
  }
11866
13119
  function ReplBindingInspector({ entry, preview, t: t2 }) {
11867
13120
  const readable = preview?.status === "readable";
@@ -11891,7 +13144,7 @@ function createReplView(React32, deps) {
11891
13144
  readable ? h("pre", { className: "ptcPlusObservationPreview" }, preview.text) : h("p", { className: "ptcPlusObservationUnavailable" }, t2(preview === void 0 ? "console.unobservedValue" : "console.unreadable"))
11892
13145
  );
11893
13146
  }
11894
- function ReplSessionBindings({ memory, t: t2 }) {
13147
+ function ReplSessionBindings({ memory, provenance, t: t2 }) {
11895
13148
  const [query, setQuery] = React32.useState("");
11896
13149
  const [kind, setKind] = React32.useState("all");
11897
13150
  const [selectedName, setSelectedName] = React32.useState(null);
@@ -11925,7 +13178,7 @@ function createReplView(React32, deps) {
11925
13178
  memory.entries.length === 0 ? h(
11926
13179
  "div",
11927
13180
  { className: "ptcPlusSessionEmpty" },
11928
- t2(memory.available ? "memory.empty" : "memory.unavailable")
13181
+ t2(!memory.available ? provenance === "previous-runtime" ? "memory.previousRuntime" : "memory.unavailable" : "memory.empty")
11929
13182
  ) : h(
11930
13183
  "div",
11931
13184
  { className: "ptcPlusObservationGrid", "data-empty": selected === void 0 },
@@ -12016,7 +13269,7 @@ function createReplView(React32, deps) {
12016
13269
  const workbench = useWorkbenchController({ enabled: globalEnabled, active: true, callUserBindings });
12017
13270
  const eligible = featureEnabled2(settings, "replView") && sessionUsesPtcPreset2(preset);
12018
13271
  const observationRegion = React32.useRef(null);
12019
- const memory = useObservedReplMemory({
13272
+ const { memory, provenance } = useObservedReplMemory({
12020
13273
  sessionId,
12021
13274
  projected,
12022
13275
  active: eligible,
@@ -12031,6 +13284,7 @@ function createReplView(React32, deps) {
12031
13284
  h("div", { className: "ptcPlusConsoleSection", ref: observationRegion }, h(ReplSessionBindings, {
12032
13285
  key: sessionId,
12033
13286
  memory,
13287
+ provenance,
12034
13288
  t: t2
12035
13289
  })),
12036
13290
  globalEnabled ? h(
@@ -12071,6 +13325,7 @@ function createReplView(React32, deps) {
12071
13325
  }
12072
13326
  function ReplMemoryCard({
12073
13327
  memory,
13328
+ provenance,
12074
13329
  globalEnabled,
12075
13330
  globalBindings,
12076
13331
  loadGlobalBinding,
@@ -12170,7 +13425,7 @@ function createReplView(React32, deps) {
12170
13425
  ),
12171
13426
  globalSource?.id !== entry.id ? null : globalSource.error === true ? h("span", { className: "ptcPlusReplEmpty" }, t2("memory.globalUnavailable")) : h("pre", { className: "ptcPlusGlobalSource" }, globalSource.source)
12172
13427
  )))
12173
- ) : !memory.available ? h("span", { className: "ptcPlusReplEmpty" }, t2("memory.unavailable")) : memory.entries.length === 0 ? h("span", { className: "ptcPlusReplEmpty" }, t2("memory.empty")) : h("ul", { className: "ptcPlusReplList" }, memory.entries.map((binding, index2) => {
13428
+ ) : !memory.available ? h("span", { className: "ptcPlusReplEmpty" }, t2(provenance === "previous-runtime" ? "memory.previousRuntime" : "memory.unavailable")) : memory.entries.length === 0 ? h("span", { className: "ptcPlusReplEmpty" }, t2("memory.empty")) : h("ul", { className: "ptcPlusReplList" }, memory.entries.map((binding, index2) => {
12174
13429
  const expanded = expandedBinding === binding.name;
12175
13430
  const preview = binding.definition.source.replace(/\s+/g, " ").trim();
12176
13431
  const definitionId = `${id2}-binding-${index2}`;
@@ -12435,7 +13690,7 @@ var {
12435
13690
  appendArray: appendArray2,
12436
13691
  popArray
12437
13692
  } = runtimeIntrinsics;
12438
- function isRecord3(value) {
13693
+ function isRecord5(value) {
12439
13694
  return value !== null && typeof value === "object" && !isArray2(value);
12440
13695
  }
12441
13696
  function assertOwnFields(value, allowed, label) {
@@ -12452,7 +13707,7 @@ function assertOwnFields(value, allowed, label) {
12452
13707
  var FIELDS = /* @__PURE__ */ new Set(["includeDeclaration", "instructions", "enabled", "declaration"]);
12453
13708
  function normalizeBindingModelContext(value) {
12454
13709
  if (value === void 0) return void 0;
12455
- if (!isRecord3(value)) throw new TypeError("binding modelContext must be an object");
13710
+ if (!isRecord5(value)) throw new TypeError("binding modelContext must be an object");
12456
13711
  assertOwnFields(value, FIELDS, "binding modelContext");
12457
13712
  const { includeDeclaration = true, instructions = "", enabled = true, declaration = "" } = value;
12458
13713
  if (typeof includeDeclaration !== "boolean") throw new TypeError("binding modelContext.includeDeclaration must be a boolean");
@@ -12485,7 +13740,7 @@ var MAX_COMMAND_ID_LENGTH = 256;
12485
13740
  var VIEW_FIELDS = /* @__PURE__ */ new Set(["phase", "capability", "commandId"]);
12486
13741
  var PHASES2 = /* @__PURE__ */ new Set(["idle", "pending", "ready", "failed"]);
12487
13742
  function normalizeCandidate(value) {
12488
- if (!isRecord3(value) || typeof value.requestId !== "string" || value.requestId.length === 0 || value.requestId.length > 128 || !Number.isSafeInteger(value.version) || value.version < 1 || !["new", "edit"].includes(value.mode) || !isRecord3(value.entry) || !["namespace", "top-level"].includes(value.entry.scope) || value.entry.enabled !== false || !Array.isArray(value.entry.symbols) || value.entry.symbols.some((symbol) => typeof symbol !== "string") || ["id", "name", "purpose", "source"].some((key) => typeof value.entry[key] !== "string") || value.entry.source.length === 0 || value.entry.source.length > 65536) {
13743
+ if (!isRecord5(value) || typeof value.requestId !== "string" || value.requestId.length === 0 || value.requestId.length > 128 || !Number.isSafeInteger(value.version) || value.version < 1 || !["new", "edit"].includes(value.mode) || !isRecord5(value.entry) || !["namespace", "top-level"].includes(value.entry.scope) || value.entry.enabled !== false || !Array.isArray(value.entry.symbols) || value.entry.symbols.some((symbol) => typeof symbol !== "string") || ["id", "name", "purpose", "source"].some((key) => typeof value.entry[key] !== "string") || value.entry.source.length === 0 || value.entry.source.length > 65536) {
12489
13744
  throw new Error("invalid dsh-ptc-plus accepted binding candidate");
12490
13745
  }
12491
13746
  const modelContext = normalizeBindingModelContext(value.entry.modelContext);
@@ -12534,7 +13789,7 @@ function historyFields(value) {
12534
13789
  return value.history === void 0 ? {} : { history: normalizeHistory(value.history) };
12535
13790
  }
12536
13791
  function exactFields(value, fields) {
12537
- if (!isRecord3(value)) return false;
13792
+ if (!isRecord5(value)) return false;
12538
13793
  const keys2 = Reflect.ownKeys(value);
12539
13794
  return keys2.length === fields.size && keys2.every((key) => typeof key === "string" && fields.has(key) && Object.prototype.propertyIsEnumerable.call(value, key));
12540
13795
  }
@@ -14023,7 +15278,7 @@ function createIndicatorView(React32, deps) {
14023
15278
  }
14024
15279
  };
14025
15280
  }, [cancelClose, cancelOpen, schedulePlacement]);
14026
- const memory = useObservedReplMemory({
15281
+ const { memory, provenance } = useObservedReplMemory({
14027
15282
  sessionId,
14028
15283
  projected: projectionMemory,
14029
15284
  active: expanded && sessionUsesPtcPreset2(preset) && featureEnabled2(settings, "plugin"),
@@ -14063,6 +15318,7 @@ function createIndicatorView(React32, deps) {
14063
15318
  }, h("span", { className: "ptcPlusActiveLabel" }, "PTC Plus")),
14064
15319
  h(ReplMemoryCard, {
14065
15320
  memory,
15321
+ provenance,
14066
15322
  globalEnabled,
14067
15323
  globalBindings,
14068
15324
  loadGlobalBinding: (id2) => callUserBindings("load", { id: id2 }),
@@ -39381,7 +40637,7 @@ var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((view, from2, to,
39381
40637
  // src/client-styles.js
39382
40638
  var CLIENT_STYLE_ID = "ptc-plus-client-style";
39383
40639
  var CLIENT_CSS = `
39384
- .ptcPlusCombination{margin-bottom:16px;padding:12px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;min-width:0}.ptcPlusCombination .ptcPlusTaskHead{margin-bottom:10px}.ptcPlusCombinationChoices{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,3fr) minmax(0,1fr);gap:12px}.ptcPlusCombinationGroup{display:flex;flex-direction:column;min-width:0;gap:6px}.ptcPlusCombinationGroupTitle{font-size:11px;line-height:18px;color:var(--dsw-alias-label-tertiary);font-weight:500}.ptcPlusCombinationGroupChoices{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px;flex:1}.ptcPlusCombinationChoice{appearance:none;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:62px;padding:8px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;line-height:18px;text-align:center;overflow-wrap:anywhere;cursor:pointer}.ptcPlusCombinationChoice small{font-size:11px;color:var(--dsw-alias-label-tertiary)}.ptcPlusCombinationChoice[data-state=selected]{border-color:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4d6bfe) 20%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4d6bfe) 6%,var(--dsw-alias-bg-layer-2))}.ptcPlusCombinationChoice[data-state=selected] small{color:var(--dsw-alias-state-business-primary,#4d6bfe)}.ptcPlusCombinationChoice[data-state=paused] small{color:var(--dsw-alias-state-warning-primary,#9b6e22)}.ptcPlusCombinationChoice:hover{background:var(--dsw-alias-interactive-bg-hover)}.ptcPlusCombinationChoice:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4d6bfe);outline-offset:2px}.ptcPlusCombinationFacts{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;line-height:20px}.ptcPlusCombinationSession{margin-top:10px;min-width:0;overflow-wrap:anywhere}.ptcPlusCombination .ptcPlusCapabilitySessionTools{margin-top:12px}.ptcPlusCombination .ptcPlusCapabilitySaveState{max-width:100%;overflow-wrap:anywhere}@media(max-width:720px){.ptcPlusCombinationChoices{grid-template-columns:minmax(0,1fr)}.ptcPlusCombinationGroupChoices{grid-auto-flow:row;grid-auto-columns:auto}.ptcPlusCombinationChoice{flex-direction:row;justify-content:space-between;min-height:40px;text-align:start;gap:10px}.ptcPlusCombinationChoice small{white-space:nowrap}.ptcPlusCombination{padding:10px}.ptcPlusCombination .ptcPlusTaskHead{align-items:flex-start;flex-wrap:wrap}}
40640
+ .ptcPlusCombination{margin-bottom:16px;padding:12px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;min-width:0}.ptcPlusCombination .ptcPlusTaskHead{margin-bottom:10px}.ptcPlusCombinationChoices{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.ptcPlusCombinationChoice{appearance:none;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:62px;padding:8px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;line-height:18px;text-align:center;overflow-wrap:anywhere;cursor:pointer}.ptcPlusCombinationChoice small{font-size:11px;color:var(--dsw-alias-label-tertiary)}.ptcPlusCombinationChoice[data-state=selected]{border-color:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4d6bfe) 20%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4d6bfe) 6%,var(--dsw-alias-bg-layer-2))}.ptcPlusCombinationChoice[data-state=selected] small{color:var(--dsw-alias-state-business-primary,#4d6bfe)}.ptcPlusCombinationChoice[data-state=paused] small{color:var(--dsw-alias-state-warning-primary,#9b6e22)}.ptcPlusCombinationChoice:hover{background:var(--dsw-alias-interactive-bg-hover)}.ptcPlusCombinationChoice:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4d6bfe);outline-offset:2px}.ptcPlusCombinationFacts{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;line-height:20px}.ptcPlusCombinationSession{margin-top:10px;min-width:0;overflow-wrap:anywhere}.ptcPlusCombination .ptcPlusCapabilitySessionTools{margin-top:12px}.ptcPlusCombination .ptcPlusCapabilitySaveState{max-width:100%;overflow-wrap:anywhere}@media(max-width:720px){.ptcPlusCombinationChoices{grid-template-columns:minmax(0,1fr)}.ptcPlusCombinationChoice{flex-direction:row;justify-content:space-between;min-height:40px;text-align:start;gap:10px}.ptcPlusCombinationChoice small{white-space:nowrap}.ptcPlusCombination{padding:10px}.ptcPlusCombination .ptcPlusTaskHead{align-items:flex-start;flex-wrap:wrap}}
39385
40641
  .ptcPlusSelectTrigger{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-width:0;height:34px;padding:0 11px;border:1px solid var(--dsw-alias-border-l4);border-radius:8px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;text-align:start;cursor:pointer}.ptcPlusSelectTrigger>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ptcPlusSelectTrigger:hover:not(:disabled){border-color:var(--dsw-alias-label-dimmed)}.ptcPlusSelectTrigger:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4d6bfe);outline-offset:1px}.ptcPlusSelectTrigger:disabled{opacity:.45;cursor:not-allowed}.ptcPlusSelectChevron{display:inline-flex;align-items:center;justify-content:center;flex:none;width:16px;height:16px;color:var(--dsw-alias-label-secondary);line-height:0}.ptcPlusSelectChevron svg{display:block}.ptcPlusSelectMenu{z-index:1100;box-sizing:border-box;min-width:var(--radix-select-trigger-width);max-width:min(380px,calc(100vw - 24px));max-height:min(360px,var(--radix-select-content-available-height));overflow:hidden;border:1px solid var(--dsw-alias-border-l3);border-radius:10px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 12px 32px rgba(0,0,0,.18));font:13px/20px var(--dsw-font-family,system-ui,sans-serif)}.ptcPlusSelectViewport{max-height:inherit;overflow-y:auto;overscroll-behavior:contain;padding:5px}.ptcPlusSelectOption{position:relative;display:flex;align-items:center;min-height:32px;padding:5px 30px 5px 10px;outline:none;border-radius:6px;overflow-wrap:anywhere;cursor:pointer}.ptcPlusSelectOption[data-highlighted]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.ptcPlusSelectOption[data-state=checked]{color:var(--dsw-alias-state-business-primary,#4d6bfe)}.ptcPlusSelectOption[data-disabled]{opacity:.45;cursor:not-allowed}.ptcPlusSelectCheck{position:absolute;right:10px;color:var(--dsw-alias-state-business-primary,#4d6bfe)}
39386
40642
  .ptcPlusTool,.ptcPlusComposerBindingAnchor{--ptc-plus-warning-label:color-mix(in srgb,var(--dsw-alias-state-warn-primary,#a15c00) 65%,var(--dsw-alias-label-primary,#18191c))}.ptcPlusTool{font-family:inherit;font-size:13px;line-height:18px}.ptcPlusTool .ptcPlusToolRow{box-sizing:border-box;height:auto;min-height:24px;align-items:flex-start;padding-block:3px}.ptcPlusToolDisclosureContent{min-width:0;flex:1}.ptcPlusTool .ptcPlusToolDisclosureLayout{min-width:0;align-items:flex-start}.ptcPlusTool .ptcPlusToolTitle,.ptcPlusTool .ptcPlusToolSummary,.ptcPlusTool .ptcPlusToolSummaryLine,.ptcPlusTool .ptcPlusToolState,.ptcPlusTool .ptcPlusToolDescription,.ptcPlusTool .ptcPlusToolSep{font-size:13px;line-height:18px}.ptcPlusTool .ptcPlusToolTitle{flex:none;margin-inline-end:6px}.ptcPlusTool .ptcPlusToolState{flex:none;white-space:nowrap}.ptcPlusTool .ptcPlusToolSep{display:inline-block;min-width:6px}.ptcPlusToolSummary{display:flex;min-width:0;align-items:baseline}.ptcPlusToolSummaryLine{display:flex;min-width:0;align-items:baseline;overflow:hidden}.ptcPlusToolDescription{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ptcPlusToolSummary .ptcPlusToolDescription{flex:1}.ptcPlusToolPreview{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px;margin-inline-start:6px}.ptcPlusToolPreview .ptcPlusToolSummaryLine{display:block}.ptcPlusToolPreview .ptcPlusToolDescription{display:inline;white-space:normal;overflow-wrap:anywhere}.ptcPlusToolPreview .ptcPlusFeatures{margin:0}
39387
40643
  .ptcPlusToolHover{position:fixed;inset:auto;margin:0;box-sizing:border-box;z-index:100;width:420px;max-height:360px;padding:14px 16px 0;display:flex;flex-direction:column;gap:10px;overflow:clip;pointer-events:none;user-select:none;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));border-radius:12px;background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,#fff));color:var(--dsw-alias-label-primary,#18191c);box-shadow:0 12px 36px rgba(0,0,0,.16);font-family:var(--dsw-font-family,system-ui,sans-serif);font-size:13px;line-height:19px}.ptcPlusToolHover *{pointer-events:none}.ptcPlusToolHover[hidden]{display:none}.ptcPlusToolHover::backdrop{display:none}.ptcPlusToolHoverHeader{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}.ptcPlusToolHoverHeading{font-weight:600;min-width:0}.ptcPlusToolHoverState{white-space:nowrap;font-size:12px;color:var(--dsw-alias-label-secondary)}.ptcPlusToolHoverHeader[data-state=error] .ptcPlusToolHoverState{color:var(--dsw-alias-state-error-primary)}.ptcPlusToolHoverHeader[data-state=stopped] .ptcPlusToolHoverState{color:var(--ptc-plus-warning-label,color-mix(in srgb,var(--dsw-alias-state-warn-primary,#a15c00) 65%,var(--dsw-alias-label-primary,#18191c)))}.ptcPlusToolHoverHeader[data-state=ok] .ptcPlusToolHoverState{color:var(--dsw-alias-state-success-primary,var(--dsw-alias-label-secondary))}.ptcPlusToolHoverContent{min-height:0;overflow:clip;display:flex;flex-direction:column;gap:10px}.ptcPlusToolHoverDescription{color:var(--dsw-alias-label-secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:clip;overflow-wrap:anywhere}.ptcPlusToolHoverSection{min-height:0;overflow:clip;border-top:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));padding-top:8px}.ptcPlusToolHover .ptcPlusToolSectionLabel{display:block;margin-bottom:5px;color:var(--dsw-alias-label-secondary);font-size:12px}.ptcPlusToolHover .ptcPlusToolHoverCode{background:none;border:0;border-radius:0;margin:0;padding:0;overflow:clip}.ptcPlusToolHover .ptcPlusToolHoverCode pre,.ptcPlusToolHover pre.ptcPlusToolHoverCode,.ptcPlusToolHover .ptcPlusIoText{background:none;border:0;border-radius:0;margin:0!important;padding:0;max-height:none;overflow:clip;white-space:pre!important;word-break:normal;font-family:var(--ds-font-family-code,ui-monospace,SFMono-Regular,Consolas,monospace);font-size:12px;line-height:19px}.ptcPlusToolHover .ptcPlusFeatures{margin:0;max-height:19px;overflow:clip}.ptcPlusToolHoverFooter{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:9px 0;border-top:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.ptcPlusToolHoverBounded{display:none;white-space:nowrap}.ptcPlusToolHoverBounded[data-truncated=true],.ptcPlusToolHover[data-clipped=true] .ptcPlusToolHoverBounded{display:block}
@@ -39412,7 +40668,69 @@ var CLIENT_CSS = `
39412
40668
  .ptcPlusCapabilityToolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:12px 0}.ptcPlusCapabilityToolbar>.ptcPlusSearch{flex:1 1 220px;min-width:0}.ptcPlusCapabilityTypes{display:flex;flex-wrap:wrap;gap:5px}.ptcPlusCapabilityTypes button{appearance:none;padding:6px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;text-align:center;cursor:pointer}.ptcPlusCapabilityTypes [aria-pressed=true]{border-color:transparent;background:var(--dsw-alias-state-business-primary,#4d6bfe);color:var(--dsw-alias-bg-base,#fff)}
39413
40669
  .ptcPlusCapabilityFilter{display:flex;flex-direction:column;min-width:0;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary)}.ptcPlusCapabilityFilter>.ptcPlusSelectTrigger{width:100%;max-width:100%;font-size:12px}.ptcPlusCapabilityFilterFields{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;padding:12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px}.ptcPlusCapabilityFilterFields>.ptcPlusCapabilityFilter{flex:1 1 160px}.ptcPlusCapabilityOnlyCommon{display:flex;align-items:center;gap:6px;font-size:12px}.ptcPlusCapabilityOnlyCommon input{width:16px;height:16px;margin:0}.ptcPlusCapabilityResultLine,.ptcPlusActiveFilters{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin:8px 0;color:var(--dsw-alias-label-secondary);font-size:11px}.ptcPlusCapabilityLink{appearance:none;padding:4px 0;border:0;background:transparent;color:var(--dsw-alias-state-business-primary,#4d6bfe);font:inherit;font-size:12px;cursor:pointer}.ptcPlusCapabilityLink:disabled{opacity:.5;cursor:default}
39414
40670
  .ptcPlusCapabilityTable{min-width:0;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;overflow:hidden}.ptcPlusCapabilityColumns,.ptcPlusCapabilityItem{display:grid;grid-template-columns:minmax(140px,1.6fr) 54px minmax(65px,.75fr) minmax(92px,1fr) minmax(104px,1fr);align-items:center;gap:10px;padding:10px 12px}.ptcPlusCapabilityColumns{color:var(--dsw-alias-label-tertiary);font-size:11px;background:var(--dsw-alias-bg-layer-2)}.ptcPlusCapabilitySort{appearance:none;display:inline-flex;align-items:center;justify-content:flex-start;gap:4px;width:100%;min-height:28px;padding:3px 0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;text-align:start;cursor:pointer}.ptcPlusCapabilitySort>span{display:inline-flex;flex:none;align-items:center;justify-content:center;width:11px;height:11px;font-size:10px;line-height:1}.ptcPlusCapabilityColumns [aria-sort=ascending],.ptcPlusCapabilityColumns [aria-sort=descending]{color:var(--dsw-alias-state-business-primary,#4d6bfe)}.ptcPlusCapabilityContextCell>.ptcPlusCapabilityContext{width:100%}.ptcPlusCapabilityList{max-height:480px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.ptcPlusCapabilityItem{border-bottom:1px solid var(--dsw-alias-border-l2)}.ptcPlusCapabilityItem:last-child{border-bottom:0}.ptcPlusCapabilityItem[data-selected=true]{background:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4d6bfe) 6%,transparent)}.ptcPlusCapabilityItem:not([data-selected=true]){cursor:pointer}.ptcPlusCapabilityItem:not([data-selected=true]):hover{background:var(--dsw-alias-interactive-bg-hover)}.ptcPlusCapabilityItem>*{min-width:0}.ptcPlusCapabilityIdentity{display:flex;flex-direction:column;gap:3px;min-width:0}.ptcPlusCapabilityName{font-size:13px;overflow-wrap:anywhere}.ptcPlusCapabilityIdentity code{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:15px;overflow-wrap:anywhere}.ptcPlusCapabilitySource{color:var(--dsw-alias-label-secondary);font-size:11px;overflow-wrap:anywhere}.ptcPlusCapabilityBadge{justify-self:start;padding:2px 6px;border-radius:4px;background:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4d6bfe) 8%,transparent);color:var(--dsw-alias-state-business-primary,#4d6bfe);font-size:10px;line-height:17px}.ptcPlusCapabilityBadge[data-kind=skill]{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2)}.ptcPlusCapabilityAvailability{display:flex;align-items:center;gap:6px;font-size:11px}.ptcPlusCapabilityAvailability[data-state=closed],.ptcPlusCapabilityAvailability[data-state=unapplied],.ptcPlusCapabilityAvailability[data-state=source-closed],.ptcPlusCapabilityAvailability[data-state=unknown],.ptcPlusCapabilityAvailability[data-state=unavailable]{color:var(--dsw-alias-label-tertiary)}.ptcPlusCapabilityContext{appearance:none;display:flex;align-items:center;justify-content:center;gap:6px;padding:5px 2px;border:0;border-radius:5px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;text-align:center;cursor:pointer}.ptcPlusCapabilityContext{justify-content:space-between;text-align:start}.ptcPlusCapabilityContext svg{flex:none;color:var(--dsw-alias-label-tertiary)}.ptcPlusCapabilityWorkbench button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
39415
- .ptcPlusCapabilityEditorFields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}.ptcPlusCapabilityField{display:flex;flex-direction:column;gap:6px;min-width:0;font-size:11px;color:var(--dsw-alias-label-secondary)}.ptcPlusCapabilityField>.ptcPlusSelectTrigger{width:100%;max-width:100%}.ptcPlusCapabilitySwitchRow{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px}.ptcPlusCapabilitySwitchText{display:flex;flex-direction:column;gap:3px;min-width:0}.ptcPlusCapabilitySwitchLabel{font-size:13px}.ptcPlusCapabilitySwitchHint{font-size:11px;color:var(--dsw-alias-label-tertiary)}@media(max-width:520px){.ptcPlusCapabilityEditorFields{grid-template-columns:minmax(0,1fr)}}.ptcPlusCapabilityNotice{padding:10px;border-radius:6px;background:var(--dsw-alias-bg-layer-2);font-size:12px;overflow-wrap:anywhere}.ptcPlusCapabilityEditorSection{margin-top:16px;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l2);min-width:0}.ptcPlusCapabilityEditorSection h5{margin:0 0 8px;font-size:11px;line-height:18px;font-weight:500;color:var(--dsw-alias-label-tertiary)}.ptcPlusCapabilityEditorSection>.ptcPlusCapabilityProse{margin:0;font-size:12px;line-height:20px;white-space:pre-wrap;overflow-wrap:anywhere}.ptcPlusCapabilityEditorSection>.ptcPlusDetail{margin:0 0 8px}.ptcPlusCapabilityEmpty{padding:20px 10px;text-align:center}
40671
+ .ptcPlusCapabilityEditorFields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}
40672
+ .ptcPlusPromptText{display:flex;flex-direction:column;gap:12px;min-width:0}
40673
+ .ptcPlusPromptHeader{display:flex;align-items:flex-start;gap:8px;min-width:0}
40674
+ .ptcPlusPromptHeaderIcon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:20px;height:20px;color:var(--dsw-alias-label-secondary)}
40675
+ .ptcPlusPromptHeaderBody{display:flex;flex-direction:column;gap:2px;min-width:0}
40676
+ .ptcPlusPromptTitle{margin:0;font-size:15px;line-height:22px;font-weight:600;color:var(--dsw-alias-label-primary)}
40677
+ .ptcPlusPromptSubtitle{margin:0;font-size:11px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
40678
+ .ptcPlusPromptCards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
40679
+ .ptcPlusPromptCard{display:flex;align-items:center;gap:10px;min-width:0;padding:10px 12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1)}
40680
+ .ptcPlusPromptCardIcon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:26px;height:26px;border-radius:6px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}
40681
+ .ptcPlusPromptCardBody{display:flex;flex-direction:column;gap:1px;min-width:0}
40682
+ .ptcPlusPromptCardLabel{font-size:11px;line-height:16px;color:var(--dsw-alias-label-secondary)}
40683
+ .ptcPlusPromptCardValue,.ptcPlusPromptCardMeta{font-size:12px;line-height:18px;color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}
40684
+ .ptcPlusPromptCardMeta{color:var(--dsw-alias-label-tertiary)}
40685
+ .ptcPlusPromptStrip{margin:0;padding:6px 10px;border-radius:6px;background:var(--dsw-alias-bg-layer-2);font-size:11px;line-height:18px;color:var(--dsw-alias-label-secondary)}
40686
+ .ptcPlusPromptIntro{margin:0;font-size:11px;line-height:17px;color:var(--dsw-alias-label-tertiary)}
40687
+ .ptcPlusPromptTable{width:100%;border-collapse:collapse;table-layout:fixed;font-size:11.5px;line-height:18px;color:var(--dsw-alias-label-primary)}
40688
+ .ptcPlusPromptTable th{padding:6px 8px;font-size:11px;font-weight:500;text-align:left;color:var(--dsw-alias-label-secondary);border-bottom:1px solid var(--dsw-alias-border-l2);white-space:nowrap}
40689
+ .ptcPlusPromptTable td{padding:6.5px 8px;border-bottom:1px solid color-mix(in srgb,var(--dsw-alias-border-l2) 55%,transparent);vertical-align:middle;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
40690
+ .ptcPlusPromptTable tbody tr:nth-child(even){background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 45%,transparent)}
40691
+ .ptcPlusPromptTable tbody tr{cursor:pointer}
40692
+ .ptcPlusPromptTable tbody tr:hover{background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 80%,transparent)}
40693
+ .ptcPlusPromptTable tbody tr[data-selected=true]{background:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4d6bfe) 10%,transparent)}
40694
+ .ptcPlusPromptTable tbody tr:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4d6bfe);outline-offset:-2px}
40695
+ .ptcPlusPromptColIndex{width:28px}.ptcPlusPromptColChannel{width:58px}.ptcPlusPromptColAnchor{width:24%}.ptcPlusPromptColPresence{width:11%}.ptcPlusPromptColBytes{width:28%}.ptcPlusPromptColReason{width:15%}.ptcPlusPromptColKind{width:12%}
40696
+ .ptcPlusPromptIndex{font-family:var(--dsw-alias-font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-size:10.5px;color:var(--dsw-alias-label-tertiary);text-align:right}
40697
+ .ptcPlusPromptChannel{display:inline-flex;align-items:center;padding:0 6px;border-radius:4px;background:var(--dsw-alias-bg-layer-2);font-size:10.5px;line-height:17px;color:var(--dsw-alias-label-secondary)}
40698
+ .ptcPlusPromptAnchorId{font-family:var(--dsw-alias-font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-size:11px;color:var(--dsw-alias-label-primary)}
40699
+ .ptcPlusPromptPresence{display:inline-flex;align-items:center;padding:0 6px;border:1px solid var(--dsw-alias-border-l2);border-radius:4px;font-size:10.5px;line-height:16px;color:var(--dsw-alias-label-secondary)}
40700
+ .ptcPlusPromptBytesCell{font-family:var(--dsw-alias-font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-size:10.5px}
40701
+ .ptcPlusPromptSplit{margin-left:4px;font-family:inherit;font-size:10px;color:var(--dsw-alias-label-tertiary)}
40702
+ .ptcPlusPromptReasonCell,.ptcPlusPromptKindCell{font-size:10.5px;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}
40703
+ .ptcPlusPromptTag{display:inline-flex;align-items:center;margin-left:6px;padding:0 5px;border:1px solid var(--dsw-alias-border-l2);border-radius:4px;font-size:10px;line-height:16px;color:var(--dsw-alias-label-secondary)}
40704
+ .ptcPlusPromptHostRow{background:var(--dsw-alias-bg-layer-2);cursor:default}
40705
+ .ptcPlusPromptPanels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:stretch}
40706
+ .ptcPlusPromptPanel{display:flex;flex-direction:column;gap:8px;min-width:0;padding:12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px}
40707
+ .ptcPlusPromptPanelTitle{margin:0;font-size:12px;line-height:18px;font-weight:600;color:var(--dsw-alias-label-primary)}
40708
+ .ptcPlusPromptPanelBody,.ptcPlusPromptEditor{display:flex;flex-direction:column;gap:8px;min-width:0}
40709
+ .ptcPlusPromptHint{margin:0;font-size:10.5px;line-height:17px;color:var(--dsw-alias-label-tertiary)}
40710
+ .ptcPlusPromptChips{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
40711
+ .ptcPlusPromptChip{display:inline-flex;align-items:center;gap:4px;appearance:none;max-width:100%;padding:2px 8px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;background:var(--dsw-alias-bg-layer-1);font-size:10.5px;line-height:18px;color:var(--dsw-alias-label-primary);cursor:pointer}
40712
+ .ptcPlusPromptChip[aria-pressed=true]{border-color:var(--dsw-alias-state-business-primary,#4d6bfe);background:var(--dsw-alias-state-business-primary,#4d6bfe);color:#fff}
40713
+ .ptcPlusPromptChip[data-readonly=true]{cursor:default;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}
40714
+ .ptcPlusPromptChipLabel{font-family:var(--dsw-alias-font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);overflow-wrap:anywhere}
40715
+ .ptcPlusPromptChipNote{color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere}
40716
+ .ptcPlusPromptChip[aria-pressed=true] .ptcPlusPromptChipNote{color:inherit;opacity:.85}
40717
+ .ptcPlusPromptTextarea{width:100%;box-sizing:border-box;min-height:132px;resize:vertical;font-family:var(--dsw-alias-font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-size:11px;line-height:18px;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}
40718
+ .ptcPlusPromptEditorFoot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;min-width:0}
40719
+ .ptcPlusPromptEditorActions{display:flex;gap:8px;margin-left:auto}
40720
+ .ptcPlusPromptDiffList{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;min-width:0}
40721
+ .ptcPlusPromptDiffRow{display:flex;align-items:flex-start;gap:8px;min-width:0}
40722
+ .ptcPlusPromptDot{flex:none;width:7px;height:7px;margin-top:6px;border-radius:50%;background:var(--dsw-alias-state-success-primary,#22a06b)}
40723
+ .ptcPlusPromptDot[data-tone="1"]{background:var(--dsw-alias-state-business-primary,#4d6bfe)}
40724
+ .ptcPlusPromptDot[data-tone="2"]{background:var(--dsw-alias-state-warn-primary,#d98e04)}
40725
+ .ptcPlusPromptDiffBody{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1 1 auto}
40726
+ .ptcPlusPromptDiffHead{display:flex;align-items:baseline;justify-content:space-between;gap:8px;min-width:0}
40727
+ .ptcPlusPromptDiffSlot{font-family:var(--dsw-alias-font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-size:10.5px;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
40728
+ .ptcPlusPromptDiffDelta{display:flex;align-items:center;gap:8px;font-family:var(--dsw-alias-font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-size:10px;color:var(--dsw-alias-label-tertiary)}
40729
+ .ptcPlusPromptDiffDelta button{font-family:inherit;font-size:10px}
40730
+ .ptcPlusPromptActions{display:flex;justify-content:flex-end;gap:8px;margin-top:auto;padding-top:6px}
40731
+
40732
+ .ptcPlusPromptPaused{padding:8px 10px;border-radius:6px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-state-warn-primary);font-size:12px;line-height:18px;margin:0}
40733
+ @media(max-width:900px){.ptcPlusPromptCards{grid-template-columns:repeat(2,minmax(0,1fr))}.ptcPlusPromptPanels{grid-template-columns:minmax(0,1fr)}}
39416
40734
  .ptcPlusPolicyRules{padding:14px;margin:12px 0;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2)}.ptcPlusPolicyRules h4{margin:0}.ptcPlusPolicyRule{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:10px 0}.ptcPlusPolicyRule>strong{flex:1 1 100px;min-width:0;overflow-wrap:anywhere;font-size:12px}.ptcPlusPolicyRule>.ptcPlusCapabilityFilter{flex:1 1 160px}
39417
40735
  .ptcPlusContextLayout{display:grid;grid-template-columns:minmax(140px,27%) minmax(0,1fr);gap:20px;margin-top:16px}.ptcPlusContextNavigation{display:flex;flex-direction:column;gap:6px;padding:12px 12px 12px 0;border-right:1px solid var(--dsw-alias-border-l2)}.ptcPlusContextNavigation button{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 10px;appearance:none;border:0;border-left:3px solid transparent;border-radius:4px;padding:14px 12px;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;text-align:start;cursor:pointer}.ptcPlusContextNavigation [aria-selected=true]{border-left-color:var(--dsw-alias-state-business-primary,#4d6bfe);background:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4d6bfe) 6%,transparent);color:var(--dsw-alias-state-business-primary,#4d6bfe)}.ptcPlusContextState{font-size:11px;line-height:18px;white-space:nowrap;color:var(--dsw-alias-label-secondary)}.ptcPlusContextState[data-enabled=true]{color:var(--dsw-alias-state-success-primary)}.ptcPlusContextState[data-paused=true]{color:var(--dsw-alias-state-warn-primary)}.ptcPlusContextSummary{flex-basis:100%;min-width:0;font-size:11px;line-height:18px;color:var(--dsw-alias-label-secondary);white-space:normal;overflow-wrap:anywhere}.ptcPlusContextContent{min-width:0;padding:12px 0}.ptcPlusContextContent h4{font-size:16px;margin:0}.ptcPlusContextContent h5{font-size:13px;line-height:20px;margin:0 0 12px}.ptcPlusContextContent>.ptcPlusCapabilityFilter{margin-top:16px}.ptcPlusPolicyAllocation{margin:18px 0}.ptcPlusAllocationChoices{display:flex;flex-wrap:wrap;gap:16px}.ptcPlusAllocationChoices label{display:flex;align-items:center;gap:8px;font-size:12px}.ptcPlusContextQuota,.ptcPlusAllocationPreview{margin:16px 0;padding:12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px}
39418
40736
  .ptcPlusCapabilityWorkbench .ptcPlusButton[data-kind=primary]{background:var(--dsw-alias-state-business-primary,#4d6bfe);color:var(--dsw-alias-bg-base,#fff);border-color:transparent}.ptcPlusCapabilityWorkbench summary{cursor:pointer;line-height:22px;font-size:12px}.ptcPlusCapabilityWorkbench summary:focus-visible,.ptcPlusCapabilityWorkbench button:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4d6bfe);outline-offset:2px}.ptcPlusCapabilitySessionTools{margin-top:18px;padding-top:10px;border-top:1px solid var(--dsw-alias-border-l2)}.ptcPlusCapabilityApply{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px;margin:12px 0}.ptcPlusCapabilityApply>.ptcPlusCapabilityFilter{flex:1 1 200px}.ptcPlusCapabilityRefresh{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}.ptcPlusCapabilityRefresh p{flex-basis:100%;margin:0;overflow-wrap:anywhere}.ptcPlusMenuUtilities .ptcPlusCapabilityRefresh{flex:1;align-self:stretch}.ptcPlusMenuUtilities .ptcPlusCapabilityRefresh>.ptcPlusMenuButton{width:100%}
@@ -39870,6 +41188,7 @@ var MAX_BINDINGS = 128;
39870
41188
  var MAX_BINDING_NAME_LENGTH = 128;
39871
41189
  var MAX_DEFINITION_SOURCE_LENGTH = 1024;
39872
41190
  var MAX_DEFINITION_SOURCE_TOTAL_LENGTH = 16 * 1024;
41191
+ var MAX_GENERATION_LENGTH = 128;
39873
41192
  var SNAPSHOT_FIELDS = /* @__PURE__ */ new Set(["available", "entries", "total", "omitted"]);
39874
41193
  var COUNTED_SNAPSHOT_FIELDS = /* @__PURE__ */ new Set([...SNAPSHOT_FIELDS, "reuseTotal"]);
39875
41194
  var OBSERVED_SNAPSHOT_FIELDS = /* @__PURE__ */ new Set([...SNAPSHOT_FIELDS, "observation"]);
@@ -39879,11 +41198,12 @@ var PREVIEW_FIELDS = /* @__PURE__ */ new Set(["name", "status", "text", "truncat
39879
41198
  var ENTRY_FIELDS = /* @__PURE__ */ new Set(["name", "kind", "definition"]);
39880
41199
  var COUNTED_ENTRY_FIELDS = /* @__PURE__ */ new Set([...ENTRY_FIELDS, "reuseCount"]);
39881
41200
  var DEFINITION_FIELDS = /* @__PURE__ */ new Set(["source", "line", "column"]);
41201
+ var VIEW_FIELDS2 = /* @__PURE__ */ new Set(["runtime", "memory"]);
39882
41202
  function isReuseCount(value) {
39883
41203
  return Number.isSafeInteger(value) && value >= 0;
39884
41204
  }
39885
41205
  function exactFields2(value, fields) {
39886
- if (!isRecord3(value)) return false;
41206
+ if (!isRecord5(value)) return false;
39887
41207
  const keys2 = Reflect.ownKeys(value);
39888
41208
  return keys2.length === fields.size && keys2.every((key) => typeof key === "string" && fields.has(key) && Object.prototype.propertyIsEnumerable.call(value, key));
39889
41209
  }
@@ -39897,6 +41217,12 @@ var EMPTY_REPL_MEMORY = Object.freeze({
39897
41217
  function unavailableReplMemorySnapshot() {
39898
41218
  return EMPTY_REPL_MEMORY;
39899
41219
  }
41220
+ function normalizeGeneration(value) {
41221
+ if (typeof value !== "string" || value.length === 0 || value.length > MAX_GENERATION_LENGTH) {
41222
+ throw new Error("invalid dsh-ptc-plus REPL memory generation");
41223
+ }
41224
+ return value;
41225
+ }
39900
41226
  function normalizeDefinition(value) {
39901
41227
  if (!exactFields2(value, DEFINITION_FIELDS) || typeof value.source !== "string" || value.source.length === 0 || value.source.length > MAX_DEFINITION_SOURCE_LENGTH || !Number.isSafeInteger(value.line) || value.line < 1 || !Number.isSafeInteger(value.column) || value.column < 1) {
39902
41228
  throw new Error("invalid dsh-ptc-plus REPL binding definition");
@@ -39971,6 +41297,13 @@ function normalizeReplMemorySnapshot(value) {
39971
41297
  ...observation === void 0 ? {} : { observation }
39972
41298
  });
39973
41299
  }
41300
+ function normalizeReplMemoryView(value) {
41301
+ if (!exactFields2(value, VIEW_FIELDS2)) throw new Error("invalid dsh-ptc-plus REPL memory view");
41302
+ return Object.freeze({
41303
+ runtime: normalizeGeneration(value.runtime),
41304
+ memory: normalizeReplMemorySnapshot(value.memory)
41305
+ });
41306
+ }
39974
41307
 
39975
41308
  // src/client-copy.js
39976
41309
  var LOCALE_NS = "settings.ptcPlus";
@@ -39982,6 +41315,7 @@ var CHROME_COPY = Object.freeze({
39982
41315
  "capabilities.combination.statistics": "\u4F7F\u7528\u7EDF\u8BA1",
39983
41316
  "capabilities.combination.recovery": "\u63D0\u793A\u6062\u590D",
39984
41317
  "capabilities.combination.preview": "\u8F93\u51FA\u8282\u9009",
41318
+ "capabilities.combination.promptText": "\u63D0\u793A\u6587\u672C",
39985
41319
  "capabilities.combination.state.selected": "\u5DF2\u9009\u7528",
39986
41320
  "capabilities.combination.state.unselected": "\u672A\u9009\u7528",
39987
41321
  "capabilities.combination.state.paused": "\u5DF2\u6682\u505C",
@@ -40192,7 +41526,6 @@ var CHROME_COPY = Object.freeze({
40192
41526
  "capabilities.quick.apply": "\u63D0\u4EA4\u5E76\u751F\u6548",
40193
41527
  "capabilities.quick.prefill": "\u586B\u5165\u547D\u4EE4\u8349\u7A3F",
40194
41528
  "capabilities.card.recorded": "\u4F1A\u8BDD\u80FD\u529B\u5DF2\u66F4\u65B0\u3002",
40195
- "capabilities.card.pending": "\u80FD\u529B\u5DF2\u51C6\u5907\uFF0C\u5C06\u5728\u4E0B\u4E00\u6B21\u83B7\u51C6\u7684\u6A21\u578B\u6B65\u9AA4\u751F\u6548\u3002",
40196
41529
  "capabilities.card.paused": "\u80FD\u529B\u4E0E\u4E0A\u4E0B\u6587\u5DF2\u5173\u95ED\uFF1B\u672C\u4F1A\u8BDD\u6CBF\u7528\u5BBF\u4E3B\u80FD\u529B\u3002",
40197
41530
  "capabilities.card.off": "\u80FD\u529B\u7BA1\u7406\u5DF2\u5173\u95ED\uFF1B\u672C\u4F1A\u8BDD\u6CBF\u7528\u5BBF\u4E3B\u80FD\u529B\u3002",
40198
41531
  "capabilities.card.saved-only": "\u5168\u5C40\u8BBE\u7F6E\u5DF2\u4FDD\u5B58\uFF0C\u4F1A\u8BDD\u66F4\u65B0\u5931\u8D25\u3002{error}",
@@ -40214,6 +41547,17 @@ var CHROME_COPY = Object.freeze({
40214
41547
  "capabilities.receipt.off": "\u80FD\u529B\u7BA1\u7406\u5DF2\u5173\u95ED\uFF1B\u4F1A\u8BDD {session} \u6CBF\u7528\u5BBF\u4E3B\u80FD\u529B\u3002",
40215
41548
  "capabilities.receipt.unavailable": "\u8BF7\u9009\u62E9\u4ECD\u6D3B\u8DC3\u7684 PTC \u4F1A\u8BDD\u3002",
40216
41549
  "capabilities.receipt.usage": "\u4F7F\u7528 /capabilities \u67E5\u770B\uFF0C\u6216 /capabilities refresh \u540C\u6B65\u5DF2\u4FDD\u5B58\u8BBE\u7F6E\u3002",
41550
+ "capabilities.proof.title": "\u4E09\u5C42\u4E8B\u5B9E",
41551
+ "capabilities.proof.line": "\u5DF2\u4FDD\u5B58\uFF1A{saved}\uFF1B\u5DF2\u6295\u9012\uFF1A{delivery}\uFF1B\u5DF2\u53EF\u7528\uFF1A{usability}\u3002",
41552
+ "capabilities.proof.saved.yes": "\u662F\uFF0C\u5168\u5C40\u8BBE\u7F6E\u8BB0\u5F55\u4E86\u8FD9\u9879\u9009\u62E9",
41553
+ "capabilities.proof.saved.no": "\u5426\uFF0C\u8FD9\u6761\u547D\u4EE4\u6CA1\u6709\u6539\u52A8\u5168\u5C40\u8BBE\u7F6E",
41554
+ "capabilities.proof.delivery.delivered": "\u662F\uFF0C\u6A21\u578B\u53EF\u89C1\u76EE\u5F55\u5DF2\u5728\u53D7\u7406\u7684\u6B65\u9AA4\u53D1\u5E03\u8BE5\u9879",
41555
+ "capabilities.proof.delivery.pending": "\u5C1A\u672A\uFF0C\u5DF2\u4FDD\u5B58\u7684\u8BBE\u7F6E\u8981\u5230\u4E0B\u4E00\u4E2A\u53D7\u7406\u6B65\u9AA4\u624D\u8FDB\u5165\u76EE\u5F55",
41556
+ "capabilities.proof.delivery.absent": "\u5426\uFF0C\u76EE\u5F55\u6CA1\u6709\u5217\u51FA\u8BE5\u9879\uFF0C\u6A21\u578B\u6CA1\u6709\u6536\u5230\u5B83",
41557
+ "capabilities.proof.usability.proven": "\u5DF2\u8BC1\u660E\uFF0C\u672C\u4F1A\u8BDD\u6709\u5B8C\u6210\u7684\u6267\u884C\u53D6\u5230\u4E86\u5B83",
41558
+ "capabilities.proof.usability.unproven": "\u672A\u8BC1\u660E\uFF0C\u672C\u4F1A\u8BDD\u6CA1\u6709\u5B8C\u6210\u7684\u6267\u884C\u53D6\u5230\u8FC7\u5B83\uFF1B\u4FDD\u5B58\u6216\u53D1\u5E03\u90FD\u4E0D\u6784\u6210\u8BC1\u660E",
41559
+ "capabilities.proof.observed": "\u6765\u81EA {command} \u8FD4\u56DE\u7684\u6536\u636E\u3002",
41560
+ "capabilities.proof.unobserved": "\u672C\u9762\u677F\u8FD8\u6CA1\u6709\u8FD9\u9879\u80FD\u529B\u7684\u6295\u9012\u4E0E\u53EF\u7528\u6027\u8BC1\u636E\uFF1B\u5E94\u7528\u4E00\u6B21\u6539\u52A8\uFF0C\u6216\u56DE\u5230\u4F1A\u8BDD\u67E5\u770B\u547D\u4EE4\u6536\u636E\u3002",
40217
41561
  "bindings.toggleEnabled": "\u5DF2\u4FDD\u5B58\u201C{name}\u201D\u7684\u542F\u7528\u9009\u62E9\uFF1B\u6A21\u578B\u76EE\u5F55\u5728\u4E0B\u4E00\u6B21\u83B7\u51C6\u6B65\u9AA4\u66F4\u65B0\uFF0C\u7A0B\u5E8F\u503C\u5C1A\u672A\u8BC1\u660E\u521D\u59CB\u5316\u3002",
40218
41562
  "bindings.toggleDisabled": "\u5DF2\u4FDD\u5B58\u201C{name}\u201D\u7684\u505C\u7528\u9009\u62E9\uFF1B\u6A21\u578B\u76EE\u5F55\u5728\u4E0B\u4E00\u6B21\u83B7\u51C6\u6B65\u9AA4\u64A4\u9500\uFF0C\u4E0D\u64A4\u9500\u5DF2\u7ECF\u53D1\u751F\u7684\u6548\u679C\u3002",
40219
41563
  "capabilities.observationGroup": "\u53EA\u8BFB\u4F1A\u8BDD\u89C2\u5BDF",
@@ -40390,6 +41734,88 @@ var CHROME_COPY = Object.freeze({
40390
41734
  "capabilities.refreshAcknowledged": "DSH \u5DF2\u786E\u8BA4\u5237\u65B0\u64CD\u4F5C\u3002",
40391
41735
  "capabilities.settingsTabs": "\u80FD\u529B\u8BBE\u7F6E\u9875\u7B7E",
40392
41736
  "capabilities.tab.manual": "\u80FD\u529B\u914D\u7F6E",
41737
+ "capabilities.tab.prompt": "\u63D0\u793A\u6587\u672C",
41738
+ "capabilities.title.prompt": "\u6A21\u578B\u53EF\u89C1\u7684\u56FA\u5B9A\u63D0\u793A\u6587\u672C",
41739
+ "capabilities.prompt.title": "\u80FD\u529B\u4E0E\u4E0A\u4E0B\u6587 \xB7 \u63D0\u793A\u6587\u672C",
41740
+ "capabilities.prompt.subtitle": "\u6A21\u578B\u53EF\u89C1\u4E0A\u4E0B\u6587\u7EDF\u4E00\u88C5\u914D\u53F0 \xB7 \u5168\u90E8\u5728\u518C",
41741
+ "capabilities.prompt.bytesPair": "{bytes} B\uFF08{kb} KB\uFF09",
41742
+ "capabilities.prompt.slotCounts": "\u5DF2\u6D4B {bytes} B \xB7 \u672A\u6D4B\u69FD {unmeasured} \xB7 \u52A8\u6001\u69FD {dynamic}",
41743
+ "capabilities.prompt.cardMetaAnchors": "{count} \u4E2A\u951A\u70B9",
41744
+ "capabilities.prompt.strip": "\u672A\u7EB3\u7BA1 {anchors} \u4E2A\u951A\u70B9 \xB7 \u5408\u8BA1 {bytes} B\uFF08{kb} KB\uFF09\xB7 \u5171 {total} \u4E2A\u951A\u70B9",
41745
+ "capabilities.prompt.rowExpand": "\u7B2C {index} \u884C\u5C55\u5F00",
41746
+ "capabilities.prompt.rowExpandHint": "\u9009\u62E9\u4E0A\u8868\u7684\u4E00\u884C\uFF0C\u5728\u8FD9\u91CC\u7F16\u8F91\u5B83\u7684\u69FD\u4F4D\u3002",
41747
+ "capabilities.prompt.bytesOfLimit": "{used} / {max} B\uFF08\u69FD\u4E0A\u9650\uFF09",
41748
+ "capabilities.prompt.unwiredTag": "\u901A\u9053\u672A\u63A5\u901A",
41749
+ "capabilities.prompt.diffEmpty": "\u8FD8\u6CA1\u6709\u5F85\u4FDD\u5B58\u7684\u6539\u52A8\u3002",
41750
+ "capabilities.prompt.diffBytes": "{before} B \u2192 {after} B\uFF08{delta}\uFF09",
41751
+ "capabilities.prompt.save": "\u4FDD\u5B58",
41752
+ "capabilities.prompt.cancel": "\u53D6\u6D88",
41753
+ "capabilities.prompt.intro": "\u6309\u951A\u70B9\u4E0E\u69FD\u4F4D\u8986\u76D6\u63D2\u4EF6\u5199\u7ED9\u6A21\u578B\u7684\u56FA\u5B9A\u6587\u672C\uFF1B\u6BCF\u4E00\u884C\u6807\u6CE8\u6240\u5C5E\u901A\u9053\u3001\u5B58\u5728\u6761\u4EF6\u4E0E\u53EA\u8BFB\u539F\u56E0\uFF0C\u751F\u6548\u65F6\u673A\u968F\u901A\u9053\u4E0D\u540C\uFF08\u4E0B\u4E00\u6B21\u8BF7\u6C42\u3001\u65B0\u4F1A\u8BDD\u6216\u4E0B\u6B21\u89E6\u53D1\uFF09\u3002\u7F16\u8F91\u6846\u7559\u7A7A\u8868\u793A\u6062\u590D\u5185\u7F6E\u6587\u672C\uFF1B\u201C\u7701\u7565\u8BE5\u6BB5\u201D\u53EA\u5728\u53EF\u7701\u7565\u7684\u69FD\u4F4D\u4E0A\u51FA\u73B0\uFF0C\u8868\u793A\u4E0D\u6295\u9012\u90A3\u4E00\u6BB5\u3002\u534F\u8BAE\u6587\u672C\u3001\u7531\u914D\u7F6E\u6216\u8FD0\u884C\u4E8B\u5B9E\u751F\u6210\u7684\u53E5\u5B50\uFF0C\u4EE5\u53CA\u4F60\u81EA\u5DF1\u5199\u7684\u7ED1\u5B9A\u8BF4\u660E\u53EA\u8BFB\u5C55\u793A\u3002",
41754
+ "capabilities.prompt.bytes": "{used} / {max} \u5B57\u8282",
41755
+ "capabilities.prompt.reset": "\u6062\u590D\u5185\u7F6E",
41756
+ "capabilities.prompt.omit": "\u7701\u7565\u8BE5\u6BB5",
41757
+ "capabilities.prompt.omitted": "\u8BE5\u6BB5\u5DF2\u7701\u7565\uFF08\u6D3E\u751F\u7B56\u7565\u53E5\u4ECD\u4F1A\u9644\u52A0\uFF09",
41758
+ "capabilities.prompt.unreadable": "\u5F53\u524D\u6587\u6863\u65E0\u6CD5\u89E3\u6790\uFF1A{error}\uFF1B\u9762\u677F\u6309\u5185\u7F6E\u6587\u672C\u663E\u793A\uFF0C\u4FDD\u5B58\u540E\u53EF\u6062\u590D\u3002",
41759
+ "capabilities.prompt.reported": "{asset}\uFF1A{reason}",
41760
+ "capabilities.prompt.ownerEditable": "\u53EF\u7F16\u8F91",
41761
+ "capabilities.prompt.ownerReadOnly": "\u53EA\u8BFB\u7EB3\u7BA1",
41762
+ "capabilities.prompt.ownerOther": "\u4ED6\u4EBA\u6240\u6709",
41763
+ "capabilities.prompt.ownerMixed": "\u6DF7\u5408",
41764
+ "capabilities.prompt.cardBytes": "{bytes} B",
41765
+ "capabilities.prompt.cardMixed": "{count} \u4E2A\u6DF7\u5408\u951A\u70B9",
41766
+ "capabilities.prompt.templateBytes": "\u6A21\u677F\u5B57\u8282\uFF08\u5B54\u5728\u6E32\u67D3\u65F6\u586B\u5145\uFF09",
41767
+ "capabilities.prompt.aggregateFrozen": "\u805A\u5408\u51BB\u7ED3\uFF1A\u6761\u76EE\u6587\u672C\u53EF\u6539\uFF0C\u589E\u5220\u6761\u76EE\u4F1A\u79FB\u52A8\u76F8\u90BB\u5B57\u8282",
41768
+ "capabilities.prompt.totals": "\u5DF2\u6D4B {bytes} B \xB7 \u5171 {anchors} \u4E2A\u951A\u70B9 \xB7 \u672A\u6D4B\u69FD {unmeasured} \xB7 \u52A8\u6001\u69FD {dynamic}",
41769
+ "capabilities.prompt.cardDynamic": "{count} \u4E2A\u52A8\u6001\u69FD",
41770
+ "capabilities.prompt.aggregateSlot": "\u805A\u5408\u5BB9\u5668\uFF08\u81EA\u8EAB\u65E0\u5B57\u8282\uFF09",
41771
+ "capabilities.prompt.cardUnwired": "\u2014\uFF08{count} \u4E2A\u69FD\u672A\u63A5\u901A\uFF09",
41772
+ "capabilities.prompt.unwiredRow": "\u901A\u9053\u672A\u63A5\u901A \xB7 {slots} \u4E2A\u69FD\u672A\u6D4B",
41773
+ "capabilities.prompt.unwiredSummary": "{anchors} \u4E2A\u951A\u70B9\u3001{slots} \u4E2A\u69FD\u7684\u901A\u9053\u5C1A\u672A\u63A5\u901A\uFF1B\u5B83\u4EEC\u4E0D\u8BA1\u5165\u5B57\u8282\u5408\u8BA1\u3002",
41774
+ "capabilities.prompt.retention": "\u68C0\u67E5\u70B9\u4FDD\u7559\uFF1A\u6700\u8FD1 {runs} \u683C \xB7 \u8F7D\u8377 {bytes} \xB7 \u7C07\u4E0A\u9650 {clusters}\u3002\u8C03\u5927\u4F1A\u8BA9\u66F4\u65E9\u7684\u8BA1\u7B97\u53EF\u76F4\u63A5\u7F16\u8F91\uFF0C\u4F46\u68C0\u67E5\u70B9\u66F4\u5927\u3002",
41775
+ "capabilities.prompt.retentionUnlimited": "\u4E0D\u9650\u5236",
41776
+ "capabilities.prompt.dynamicSlot": "\u52A8\u6001\uFF08\u88C5\u914D\u671F\u5B9E\u6D4B\uFF0C\u65E0\u5B57\u9762\u9ED8\u8BA4\uFF09",
41777
+ "capabilities.prompt.anchorMeta": "{channel} \xB7 {presence} \xB7 {owner}",
41778
+ "capabilities.prompt.slotBytes": "{bytes} B \xB7 {owner} \u7C7B",
41779
+ "capabilities.prompt.unmeasuredSlot": "\u672A\u6D4B\uFF08\u65E0\u53EF\u6838\u5BF9\u5B57\u8282\uFF09",
41780
+ "capabilities.prompt.readonlyReason": "{reason} \xB7 {kind}",
41781
+ "capabilities.prompt.slotSelector": "{slot}\uFF08{bytes} B\uFF09",
41782
+ "capabilities.prompt.chipMeta": "\u69FD\u4F4D {owner}",
41783
+ "capabilities.prompt.paused": "\u63D0\u793A\u6587\u672C\u5DF2\u6682\u505C\uFF1A\u914D\u7F6E\u91CC\u7684\u63D0\u793A\u6587\u672C\u5F00\u5173\u5173\u95ED\uFF0C\u6539\u5199\u7684\u53E5\u5B50\u4E0D\u4F1A\u8FDB\u5165\u8BF7\u6C42\u3001\u5DE5\u5177\u8BF4\u660E\u3001\u80FD\u529B\u65B9\u6848\u4E0E\u63D0\u793A\uFF1B\u5DF2\u4FDD\u5B58\u7684\u6539\u5199\u4FDD\u7559\uFF0C\u91CD\u65B0\u5F00\u542F\u540E\u751F\u6548\u3002",
41784
+ "capabilities.prompt.pausedBytes": "{bytes} B\uFF08\u5DF2\u6682\u505C\uFF0C\u672A\u5E94\u7528\uFF09",
41785
+ "capabilities.prompt.columnBytesSplit": "\u5B57\u8282\uFF08\u6309\u69FD\u62C6\u5206\uFF09",
41786
+ "capabilities.prompt.columnReason": "\u539F\u56E0\u7801",
41787
+ "capabilities.prompt.columnKind": "\u69FD\u4F4D\u79CD\u7C7B",
41788
+ "capabilities.prompt.columnSlots": "\u69FD\u4F4D",
41789
+ "capabilities.prompt.anchorBytesSplit": "\uFF08{parts}\uFF09",
41790
+ "capabilities.prompt.diffTitle": "\u4FDD\u5B58\u524D\u5DEE\u5F02\u9884\u89C8",
41791
+ "capabilities.prompt.diffDelta": "{delta} \u5B57\u8282",
41792
+ "capabilities.prompt.effectPrompt": "\u5F85\u4E0B\u6B21\u88C5\u914D\u751F\u6548",
41793
+ "capabilities.prompt.effectInstall": "\u65B0\u4F1A\u8BDD\u5B89\u88C5\u65F6\u751F\u6548",
41794
+ "capabilities.prompt.effectPlan": "\u65B0\u4F1A\u8BDD\u6216 refresh \u751F\u6548",
41795
+ "capabilities.prompt.effectTrigger": "\u4E0B\u6B21\u89E6\u53D1\u65F6\u751F\u6548",
41796
+ "capabilities.prompt.columnChannel": "\u901A\u9053",
41797
+ "capabilities.prompt.columnAnchor": "\u951A\u70B9",
41798
+ "capabilities.prompt.columnPresence": "\u5B58\u5728\u6761\u4EF6",
41799
+ "capabilities.prompt.columnBytes": "\u5B57\u8282",
41800
+ "capabilities.prompt.columnStatus": "\u72B6\u6001",
41801
+ "capabilities.prompt.ownerHost": "DSH \u5BBF\u4E3B",
41802
+ "capabilities.prompt.hostSection": "\u5BBF\u4E3B\u6BB5\u843D\uFF0C\u53EA\u8BFB\uFF1A\u63D2\u4EF6\u80FD\u770B\u5230\u6BB5\u540D\u4E0E\u6765\u6E90\uFF0C\u4E0D\u80FD\u5728\u8FD9\u91CC\u6539\u5199",
41803
+ "capabilities.prompt.hostUnavailable": "\u5BBF\u4E3B\u7CFB\u7EDF\u63D0\u793A\uFF08\u63D2\u4EF6\u4E0D\u53EF\u679A\u4E3E\uFF09",
41804
+ "capabilities.prompt.hostPresenceEvery": "\u6BCF\u4E2A\u8BF7\u6C42",
41805
+ "capabilities.prompt.hostPresenceCapabilities": "\u80FD\u529B\u7BA1\u7406\u542F\u7528",
41806
+ "capabilities.prompt.readonlySummary": "{count} \u4E2A\u53EA\u8BFB\u69FD",
41807
+ // Reason codes and slot kinds are registry identifiers; the pane shows a
41808
+ // localized label and keeps the raw code in the element title, so a Chinese UI
41809
+ // never reads like a dump of registry constants.
41810
+ "capabilities.prompt.reason.factDerived": "\u4E8B\u5B9E\u6D3E\u751F",
41811
+ "capabilities.prompt.reason.aggregateFrozen": "\u805A\u5408\u51BB\u7ED3",
41812
+ "capabilities.prompt.reason.protocolExactText": "\u534F\u8BAE\xB7\u7CBE\u786E\u6587\u672C",
41813
+ "capabilities.prompt.reason.protocolStructural": "\u534F\u8BAE\xB7\u7ED3\u6784",
41814
+ "capabilities.prompt.reason.shadowsHost": "\u906E\u853D\u5BBF\u4E3B",
41815
+ "capabilities.prompt.reason.otherOwner": "\u4ED6\u4EBA\u6240\u6709",
41816
+ "capabilities.prompt.kind.literal": "\u5B57\u9762\u91CF",
41817
+ "capabilities.prompt.kind.aggregate": "\u805A\u5408",
41818
+ "capabilities.prompt.kind.projected": "\u6295\u5F71",
40393
41819
  "capabilities.tab.statistics": "\u4F7F\u7528\u7EDF\u8BA1",
40394
41820
  "capabilities.tab.budgets": "\u63D0\u793A\u8BBE\u7F6E",
40395
41821
  "capabilities.tab.plans": "\u914D\u7F6E\u65B9\u6848",
@@ -40571,6 +41997,7 @@ var CHROME_COPY = Object.freeze({
40571
41997
  "memory.globalCount": "{count} \u4E2A\u5168\u5C40\u6761\u76EE",
40572
41998
  "memory.empty": "\u5F53\u524D\u6CA1\u6709\u53EF\u590D\u7528\u7ED1\u5B9A",
40573
41999
  "memory.unavailable": "\u5F53\u524D\u7ED1\u5B9A\u72B6\u6001\u5C1A\u4E0D\u53EF\u786E\u8BA4",
42000
+ "memory.previousRuntime": "\u8FD9\u4EFD\u6E05\u5355\u6765\u81EA\u4E0A\u4E00\u4E2A\u8FD0\u884C\u671F\uFF0C\u4E0D\u518D\u4EE3\u8868\u5F53\u524D\u73AF\u5883\uFF1B\u6267\u884C\u4E00\u683C\u5373\u53EF\u91CD\u65B0\u89C2\u5BDF",
40574
42001
  "memory.more": "\u53E6\u6709 {count} \u4E2A\u7ED1\u5B9A\u672A\u663E\u793A",
40575
42002
  "memory.reuseCount": "\u590D\u7528 {count} \u6B21",
40576
42003
  "memory.reuseTotal": "\u5171\u590D\u7528 {count} \u6B21",
@@ -40613,6 +42040,7 @@ var CHROME_COPY = Object.freeze({
40613
42040
  "capabilities.combination.statistics": "Usage statistics",
40614
42041
  "capabilities.combination.recovery": "Prompt recovery",
40615
42042
  "capabilities.combination.preview": "Output excerpts",
42043
+ "capabilities.combination.promptText": "Prompt text",
40616
42044
  "capabilities.combination.state.selected": "Selected",
40617
42045
  "capabilities.combination.state.unselected": "Not selected",
40618
42046
  "capabilities.combination.state.paused": "Paused",
@@ -40823,7 +42251,6 @@ var CHROME_COPY = Object.freeze({
40823
42251
  "capabilities.quick.apply": "Submit and apply",
40824
42252
  "capabilities.quick.prefill": "Fill command draft",
40825
42253
  "capabilities.card.recorded": "Session capabilities updated.",
40826
- "capabilities.card.pending": "Capabilities prepared; they take effect at the next accepted model step.",
40827
42254
  "capabilities.card.paused": "Capabilities and context are off; this session stays with the Host capabilities.",
40828
42255
  "capabilities.card.off": "Capability management is off; this session stays with the Host capabilities.",
40829
42256
  "capabilities.card.saved-only": "Global settings saved; session update failed. {error}",
@@ -40845,6 +42272,17 @@ var CHROME_COPY = Object.freeze({
40845
42272
  "capabilities.receipt.off": "Capability management is off; session {session} stays with the Host capabilities.",
40846
42273
  "capabilities.receipt.unavailable": "Select an active PTC session.",
40847
42274
  "capabilities.receipt.usage": "Use /capabilities to inspect or /capabilities refresh to apply saved settings.",
42275
+ "capabilities.proof.title": "Three separate facts",
42276
+ "capabilities.proof.line": "Saved: {saved}; delivered: {delivery}; usable: {usability}.",
42277
+ "capabilities.proof.saved.yes": "yes, the global configuration records this choice",
42278
+ "capabilities.proof.saved.no": "no, this command did not change the global configuration",
42279
+ "capabilities.proof.delivery.delivered": "yes, the model-visible catalog published it at an accepted step",
42280
+ "capabilities.proof.delivery.pending": "not yet, the saved configuration reaches the catalog at the next accepted step",
42281
+ "capabilities.proof.delivery.absent": "no, the catalog does not list it, so the model never received it",
42282
+ "capabilities.proof.usability.proven": "proven, a completed execution in this session reached it",
42283
+ "capabilities.proof.usability.unproven": "unproven, no completed execution in this session reached it; a save or a published entry does not prove it",
42284
+ "capabilities.proof.observed": "From the receipt {command} returned.",
42285
+ "capabilities.proof.unobserved": "This panel holds no delivery or usability evidence for this capability yet; apply a change, or read the command receipt in the conversation.",
40848
42286
  "bindings.toggleEnabled": "Enabled \u201C{name}\u201D in saved configuration. The model catalog updates at the next accepted step; worker initialization is not yet established.",
40849
42287
  "bindings.toggleDisabled": "Disabled \u201C{name}\u201D in saved configuration. The model catalog withdraws it at the next accepted step; earlier effects are unchanged.",
40850
42288
  "capabilities.observationGroup": "Read-only session observation",
@@ -41021,6 +42459,85 @@ var CHROME_COPY = Object.freeze({
41021
42459
  "capabilities.refreshAcknowledged": "DSH acknowledged the refresh operation.",
41022
42460
  "capabilities.settingsTabs": "Capability settings tabs",
41023
42461
  "capabilities.tab.manual": "Capability configuration",
42462
+ "capabilities.tab.prompt": "Prompt text",
42463
+ "capabilities.title.prompt": "Fixed prompt text the model reads",
42464
+ "capabilities.prompt.title": "Capabilities & Context \xB7 Prompt text",
42465
+ "capabilities.prompt.subtitle": "One surface for the model-visible context \xB7 everything on record",
42466
+ "capabilities.prompt.bytesPair": "{bytes} B ({kb} KB)",
42467
+ "capabilities.prompt.slotCounts": "Measured {bytes} B \xB7 {unmeasured} unmeasured slots \xB7 {dynamic} dynamic slots",
42468
+ "capabilities.prompt.cardMetaAnchors": "{count} anchors",
42469
+ "capabilities.prompt.strip": "{anchors} anchors not wired \xB7 {bytes} B ({kb} KB) total \xB7 {total} anchors",
42470
+ "capabilities.prompt.rowExpand": "Row {index} expanded",
42471
+ "capabilities.prompt.rowExpandHint": "Select a row above to edit its slots here.",
42472
+ "capabilities.prompt.bytesOfLimit": "{used} / {max} B (slot limit)",
42473
+ "capabilities.prompt.unwiredTag": "channel not wired",
42474
+ "capabilities.prompt.diffEmpty": "No pending changes.",
42475
+ "capabilities.prompt.diffBytes": "{before} B \u2192 {after} B ({delta})",
42476
+ "capabilities.prompt.save": "Save",
42477
+ "capabilities.prompt.cancel": "Cancel",
42478
+ "capabilities.prompt.intro": "Override the fixed text the plugin writes, per anchor and slot. Each row names its channel, presence condition and read-only reason, and when an edit takes effect depends on that channel (next request, new session, or next trigger). Clearing the editor restores the built-in text; \u201Comit this paragraph\u201D appears only on omittable slots and means the paragraph is not delivered. Protocol text, sentences generated from configuration or runtime facts, and the binding notes you wrote yourself stay read-only.",
42479
+ "capabilities.prompt.bytes": "{used} / {max} bytes",
42480
+ "capabilities.prompt.reset": "Use built-in",
42481
+ "capabilities.prompt.omit": "Omit this paragraph",
42482
+ "capabilities.prompt.omitted": "This paragraph is omitted; derived policy sentences are still appended",
42483
+ "capabilities.prompt.unreadable": "The stored document cannot be parsed: {error}. The panel shows built-in text; saving restores it.",
42484
+ "capabilities.prompt.reported": "{asset}: {reason}",
42485
+ "capabilities.prompt.ownerEditable": "Editable",
42486
+ "capabilities.prompt.ownerReadOnly": "Read-only, managed",
42487
+ "capabilities.prompt.ownerOther": "Owned elsewhere",
42488
+ "capabilities.prompt.ownerMixed": "Mixed",
42489
+ "capabilities.prompt.cardBytes": "{bytes} B",
42490
+ "capabilities.prompt.cardMixed": "{count} mixed anchor(s)",
42491
+ "capabilities.prompt.templateBytes": "template bytes (holes filled at render time)",
42492
+ "capabilities.prompt.aggregateFrozen": "Frozen item set: item text is editable, adding or removing an item moves neighbouring bytes",
42493
+ "capabilities.prompt.totals": "measured {bytes} B \xB7 {anchors} anchors \xB7 unmeasured slots {unmeasured} \xB7 dynamic slots {dynamic}",
42494
+ "capabilities.prompt.cardDynamic": "{count} dynamic slots",
42495
+ "capabilities.prompt.aggregateSlot": "aggregate container (owns no bytes)",
42496
+ "capabilities.prompt.cardUnwired": "\u2014 ({count} slots not connected)",
42497
+ "capabilities.prompt.unwiredRow": "channel not connected \xB7 {slots} slots unmeasured",
42498
+ "capabilities.prompt.unwiredSummary": "{anchors} anchors and {slots} slots have no connected channel; they are excluded from the byte total.",
42499
+ "capabilities.prompt.retention": "Checkpoint retention: newest {runs} cells \xB7 {bytes} payload \xB7 {clusters} clusters. A larger window keeps older cells editable but grows the checkpoint.",
42500
+ "capabilities.prompt.retentionUnlimited": "unlimited",
42501
+ "capabilities.prompt.dynamicSlot": "dynamic (measured at assembly; no literal default)",
42502
+ "capabilities.prompt.anchorMeta": "{channel} \xB7 {presence} \xB7 {owner}",
42503
+ "capabilities.prompt.slotBytes": "{bytes} B \xB7 owner {owner}",
42504
+ "capabilities.prompt.unmeasuredSlot": "unmeasured (no bytes to reconcile)",
42505
+ "capabilities.prompt.readonlyReason": "{reason} \xB7 {kind}",
42506
+ "capabilities.prompt.slotSelector": "{slot} ({bytes} B)",
42507
+ "capabilities.prompt.chipMeta": "slot {owner}",
42508
+ "capabilities.prompt.paused": "Prompt text is paused: the prompt text switch in configuration is off, so edited sentences do not reach requests, tool descriptions, the capability plan or tips. Saved edits are kept and apply again when you turn it back on.",
42509
+ "capabilities.prompt.pausedBytes": "{bytes} B (paused, not applied)",
42510
+ "capabilities.prompt.columnBytesSplit": "Bytes (per slot)",
42511
+ "capabilities.prompt.columnReason": "Reason code",
42512
+ "capabilities.prompt.columnKind": "Slot kind",
42513
+ "capabilities.prompt.columnSlots": "Slots",
42514
+ "capabilities.prompt.anchorBytesSplit": "({parts})",
42515
+ "capabilities.prompt.diffTitle": "Pending changes before saving",
42516
+ "capabilities.prompt.diffDelta": "{delta} bytes",
42517
+ "capabilities.prompt.effectPrompt": "applies on the next assembly",
42518
+ "capabilities.prompt.effectInstall": "applies at the next agent install",
42519
+ "capabilities.prompt.effectPlan": "applies on a new session or refresh",
42520
+ "capabilities.prompt.effectTrigger": "applies on the next trigger",
42521
+ "capabilities.prompt.columnChannel": "Channel",
42522
+ "capabilities.prompt.columnAnchor": "Anchor",
42523
+ "capabilities.prompt.columnPresence": "Presence",
42524
+ "capabilities.prompt.columnBytes": "Bytes",
42525
+ "capabilities.prompt.columnStatus": "Status",
42526
+ "capabilities.prompt.ownerHost": "DSH host",
42527
+ "capabilities.prompt.hostSection": "Host-owned section, read-only: the plugin can name it and read its bytes, but cannot rewrite it here",
42528
+ "capabilities.prompt.hostUnavailable": "Host system prompt (not enumerable by the plugin)",
42529
+ "capabilities.prompt.hostPresenceEvery": "every request",
42530
+ "capabilities.prompt.hostPresenceCapabilities": "capability management enabled",
42531
+ "capabilities.prompt.readonlySummary": "{count} read-only slot(s)",
42532
+ "capabilities.prompt.reason.factDerived": "fact-derived",
42533
+ "capabilities.prompt.reason.aggregateFrozen": "aggregate-frozen",
42534
+ "capabilities.prompt.reason.protocolExactText": "protocol-exact-text",
42535
+ "capabilities.prompt.reason.protocolStructural": "protocol-structural",
42536
+ "capabilities.prompt.reason.shadowsHost": "shadows-host",
42537
+ "capabilities.prompt.reason.otherOwner": "other-owner",
42538
+ "capabilities.prompt.kind.literal": "literal",
42539
+ "capabilities.prompt.kind.aggregate": "aggregate",
42540
+ "capabilities.prompt.kind.projected": "projected",
41024
42541
  "capabilities.tab.statistics": "Usage statistics",
41025
42542
  "capabilities.tab.budgets": "Prompt settings",
41026
42543
  "capabilities.tab.plans": "Configurations",
@@ -41202,6 +42719,7 @@ var CHROME_COPY = Object.freeze({
41202
42719
  "memory.globalCount": "{count} global entries",
41203
42720
  "memory.empty": "No reusable bindings",
41204
42721
  "memory.unavailable": "Current binding state cannot be confirmed",
42722
+ "memory.previousRuntime": "This inventory came from a previous runtime and no longer describes the current environment; run a cell to observe it again",
41205
42723
  "memory.more": "{count} more bindings not shown",
41206
42724
  // Number-neutral so a single reuse stays grammatical without a plural rule.
41207
42725
  "memory.reuseCount": "reused {count}\xD7",
@@ -42461,6 +43979,7 @@ function createClientPlugin(require2) {
42461
43979
  Select: Select2,
42462
43980
  featureEnabled,
42463
43981
  normalizeReplMemorySnapshot,
43982
+ normalizeReplMemoryView,
42464
43983
  unavailableReplMemorySnapshot,
42465
43984
  useSessionPreset,
42466
43985
  sessionUsesPtcPreset,