dsh-ptc-plus 0.4.2 → 0.4.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 (83) hide show
  1. package/README.en.md +166 -76
  2. package/README.md +167 -77
  3. package/assets/dsh-ptc-plus-banner-en.webp +0 -0
  4. package/assets/dsh-ptc-plus-banner-zh.webp +0 -0
  5. package/assets/ptc-plus-icon.svg +5 -0
  6. package/client.js +593 -306
  7. package/compiler-core.cjs +162 -160
  8. package/compiler-core.cjs.map +3 -3
  9. package/docs/README.md +3 -1
  10. package/docs/adr/0005-temporary-rejected-cell-edit-transport.md +8 -7
  11. package/docs/adr/0008-define-agent-operating-contract.md +2 -2
  12. package/docs/adr/0010-session-log-derived-recovery-tips.md +7 -0
  13. package/docs/adr/0016-archive-resolved-review-findings.md +3 -3
  14. package/docs/adr/0019-plugin-settings-and-kill-switch.md +3 -3
  15. package/docs/adr/0020-optional-cordis-tools-in-ptc-mode.md +2 -0
  16. package/docs/adr/0021-separate-host-bootstrap-from-session-runtime.md +14 -3
  17. package/docs/adr/0023-global-user-bindings.md +1 -1
  18. package/docs/adr/0026-persist-the-delivery-verdict-against-the-verified-candidate.md +23 -7
  19. package/docs/adr/0027-run-the-session-kernel-in-a-killable-helper-process.md +4 -0
  20. package/docs/adr/0028-attach-to-the-host-ptc-execution-seam.md +26 -6
  21. package/docs/adr/0031-close-semantic-obligations-by-owner.md +29 -0
  22. package/docs/adr/README.md +4 -4
  23. package/docs/architecture.md +6 -5
  24. package/docs/binding-review-placement-design.md +1 -1
  25. package/docs/client-ui.md +8 -4
  26. package/docs/durability-design.md +7 -7
  27. package/docs/installation.md +26 -8
  28. package/docs/runtime-reference.md +18 -11
  29. package/docs/semantic-validation.md +7 -3
  30. package/docs/user-bindings.en.md +7 -6
  31. package/docs/user-bindings.md +6 -5
  32. package/docs/value-wire.md +1 -1
  33. package/docs/verification.md +38 -1
  34. package/index.js +39 -34
  35. package/internal/async-local-storage-intrinsics.js +12 -7
  36. package/internal/callable-source-facts.js +37 -1
  37. package/internal/cell-analysis.js +64 -9
  38. package/internal/config-spec.js +1 -1
  39. package/internal/cordis-tools-owner.js +20 -10
  40. package/internal/edit-transport-owner.js +80 -20
  41. package/internal/execution-seam-compat.js +192 -30
  42. package/internal/kernel-worker.js +162 -72
  43. package/internal/message-sources.js +14 -0
  44. package/internal/module-compilation.js +2 -1
  45. package/internal/repl-memory-projection.js +10 -0
  46. package/internal/repl-scope-normalizer.js +72 -35
  47. package/internal/repl-value-observer.js +141 -45
  48. package/internal/runtime-config.js +62 -2
  49. package/internal/runtime-intrinsics.js +3 -0
  50. package/internal/runtime-messages.js +6 -4
  51. package/internal/session-cell-executor.js +24 -1
  52. package/internal/session-journal-recovery.js +267 -67
  53. package/internal/session-journal.js +466 -40
  54. package/internal/session-log-view.js +5 -4
  55. package/internal/session-runtime.js +45 -21
  56. package/internal/session-state.js +7 -29
  57. package/internal/settings-compat.js +66 -1
  58. package/internal/source-position-map.js +19 -0
  59. package/internal/user-binding-console-worker.js +23 -9
  60. package/internal/user-binding-draft-projection.js +3 -2
  61. package/internal/user-bindings-owner.js +2 -1
  62. package/internal/user-bindings.js +6 -1
  63. package/internal/validated-parse-repair.js +6 -2
  64. package/internal/value-wire.js +95 -30
  65. package/internal/worker-client.js +99 -8
  66. package/internal/worker-cwd-virtualization.js +10 -9
  67. package/internal/worker-output-capture.js +187 -0
  68. package/internal/worker-output-fence.js +26 -0
  69. package/internal/worker-realm-surfaces.js +197 -0
  70. package/internal/worker-repl-realm.js +10 -4
  71. package/package.json +36 -4
  72. package/src/client-activity.js +4 -1
  73. package/src/client-authoring-view.js +121 -62
  74. package/src/client-console.js +4 -2
  75. package/src/client-copy.js +4 -2
  76. package/src/client-feature-gates.js +7 -9
  77. package/src/client-host-compat.js +104 -27
  78. package/src/client-repl-view.js +3 -1
  79. package/src/client-styles.js +12 -1
  80. package/src/client-tool-view.js +3 -1
  81. package/src/client-transport.js +2 -2
  82. package/src/client-workbench.js +4 -3
  83. package/src/client.js +56 -17
package/src/client.js CHANGED
@@ -9,6 +9,9 @@ import { createIndicatorView } from './client-indicator-view.js'
9
9
  import { createTypeScriptEditor } from './client-code-editor.js'
10
10
  import { createBindingConsole } from './client-console.js'
11
11
  import {
12
+ createMenuChildrenEvidence,
13
+ hostIconComponents,
14
+ isHostIconComponent,
12
15
  isIdleSessionComposer,
13
16
  publishSettingsCard,
14
17
  sessionUsesPtcPreset,
@@ -32,34 +35,37 @@ window.__ModuleLoader__.load({
32
35
  id: __PTC_PLUS_CLIENT_MODULE_ID__,
33
36
  factory: (require) => {
34
37
  const React = require('react')
38
+ const primitives = require('@deepseek-ai/dsh-client-ui-primitives')
35
39
  const {
36
40
  Button,
37
41
  CodeBlock,
38
42
  DisclosureRow,
39
- IconCheckOutline14,
40
- IconChevronDownOutline14,
41
- IconInspectOutline12,
42
- IconSparkle16,
43
- IconCloseOutline16,
44
- IconSearchOutline16,
45
- IconPlusOutline16,
46
- IconRefreshOutline16,
47
- IconTrashOutline16,
48
- IconEditOutline16,
49
- IconPlayOutline16,
50
- IconStopFill16,
51
43
  Menu,
52
44
  Modal,
53
45
  Toast,
54
46
  Tooltip,
55
- } = require('@deepseek-ai/dsh-client-ui-primitives')
47
+ } = primitives
48
+ const {
49
+ check: IconCheckOutline14,
50
+ chevron: IconChevronDownOutline14,
51
+ inspect: IconInspectOutline12,
52
+ sparkle: IconSparkle16,
53
+ close: IconCloseOutline16,
54
+ search: IconSearchOutline16,
55
+ plus: IconPlusOutline16,
56
+ refresh: IconRefreshOutline16,
57
+ trash: IconTrashOutline16,
58
+ edit: IconEditOutline16,
59
+ play: IconPlayOutline16,
60
+ stop: IconStopFill16,
61
+ } = hostIconComponents(primitives)
56
62
  const module = { exports: {} }
57
63
  const h = React.createElement
58
64
  const TypeScriptEditor = createTypeScriptEditor(React)
59
65
 
60
66
  function IconButton({ icon: Icon, label, ...props }) {
61
67
  const button = h('button', { ...props, type: 'button', className: 'ptcPlusIconButton',
62
- 'aria-label': label, title: label }, typeof Icon === 'function' ? h(Icon, { size: 16 }) : label)
68
+ 'aria-label': label, title: label }, isHostIconComponent(Icon) ? h(Icon, { size: 16 }) : label)
63
69
  return typeof Tooltip === 'function' ? h(Tooltip, { label, delayMs: 400 }, button) : button
64
70
  }
65
71
 
@@ -79,9 +85,40 @@ window.__ModuleLoader__.load({
79
85
  icons: { chevron: IconChevronDownOutline14, check: IconCheckOutline14, inspect: IconInspectOutline12 },
80
86
  })
81
87
 
88
+ /**
89
+ * Resolve the settings transport of the running generation. The current
90
+ * release publishes `configForms`; the preceding one published
91
+ * `settingsScope`. Both are optional child injections so the client entry
92
+ * does not stay pending on the name the installed generation does not use.
93
+ */
94
+ function settingsPreferenceScope(ctx) {
95
+ return new Promise((resolve, reject) => {
96
+ let settled = false
97
+ let configFormsWatcher
98
+ let settingsScopeWatcher
99
+ const take = (name, scope) => {
100
+ if (settled) return
101
+ settled = true
102
+ if (name !== 'configForms' && typeof configFormsWatcher === 'function') configFormsWatcher()
103
+ if (name !== 'settingsScope' && typeof settingsScopeWatcher === 'function') settingsScopeWatcher()
104
+ resolve(name === 'configForms'
105
+ ? scope.configForms.get(SETTINGS_NAMESPACE)
106
+ : scope.settingsScope.bind({ namespace: SETTINGS_NAMESPACE }))
107
+ }
108
+ try {
109
+ configFormsWatcher = ctx.inject(['configForms'], scope => take('configForms', scope))
110
+ if (!settled) {
111
+ settingsScopeWatcher = ctx.inject(['settingsScope'], scope => take('settingsScope', scope))
112
+ }
113
+ } catch (error) {
114
+ reject(error)
115
+ }
116
+ })
117
+ }
118
+
82
119
  async function apply(ctx) {
83
120
  const rpc = await createClientRpc(ctx)
84
- const preferenceScope = ctx.settingsScope.bind({ namespace: SETTINGS_NAMESPACE })
121
+ const preferenceScope = await settingsPreferenceScope(ctx)
85
122
  ctx.effect(() => ctx.locale.register(LOCALE_NS, SETTINGS_COPY), 'ptc-plus: settings dictionaries')
86
123
  ctx.effect(installStyles, 'ptc-plus: client styles')
87
124
 
@@ -215,10 +252,12 @@ window.__ModuleLoader__.load({
215
252
  }
216
253
 
217
254
  const subscribeReset = listener => ctx.on('connection/reset', listener)
255
+ // One probe answer serves every session's composer entry for this Client.
256
+ const menuChildren = createMenuChildrenEvidence()
218
257
  const { BindingAuthorButton, BindingReviewDock, BindingCommandCard } = createAuthoringView(React, {
219
258
  ActionButton, IconButton, Menu, Toast, Tooltip, CodeBlock, BindingsDialog, PTCPlusSettingsDialog,
220
259
  useWorkbenchController, useBindingReview, catalogOwner, callUserBindings, subscribeReset,
221
- settingsCardSeat: settingsCard.seat, updateSetting,
260
+ settingsCardSeat: settingsCard.seat, updateSetting, menuChildren,
222
261
  icons: {
223
262
  sparkle: IconSparkle16, chevron: IconChevronDownOutline14,
224
263
  close: IconCloseOutline16, check: IconCheckOutline14,
@@ -274,7 +313,7 @@ window.__ModuleLoader__.load({
274
313
 
275
314
  module.exports = {
276
315
  apply,
277
- inject: ['settingsScope', 'slots', 'locale', 'connection', 'remote'],
316
+ inject: ['slots', 'locale', 'connection', 'remote'],
278
317
  }
279
318
  return module.exports
280
319
  },