@agi-fans/dsh-tui 0.17.0 → 0.19.0

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 (100) hide show
  1. package/lib/CHANGELOG.md +67 -1
  2. package/lib/chrome/box.d.ts +2 -0
  3. package/lib/chrome/box.js +5 -1
  4. package/lib/chrome/box.js.map +1 -1
  5. package/lib/chrome/main-screen-renderer.d.ts +61 -11
  6. package/lib/chrome/main-screen-renderer.js +1674 -71
  7. package/lib/chrome/main-screen-renderer.js.map +1 -1
  8. package/lib/chrome/markdown.js +21 -13
  9. package/lib/chrome/markdown.js.map +1 -1
  10. package/lib/chrome/renderer.d.ts +75 -0
  11. package/lib/chrome/renderer.js.map +1 -1
  12. package/lib/chrome/status-config.d.ts +4 -1
  13. package/lib/chrome/status-config.js.map +1 -1
  14. package/lib/chrome/theme.d.ts +18 -0
  15. package/lib/chrome/theme.js +18 -0
  16. package/lib/chrome/theme.js.map +1 -1
  17. package/lib/chrome/tool-args.d.ts +24 -1
  18. package/lib/chrome/tool-args.js +40 -1
  19. package/lib/chrome/tool-args.js.map +1 -1
  20. package/lib/chrome/tool-renderers.d.ts +11 -0
  21. package/lib/chrome/tool-renderers.js +55 -7
  22. package/lib/chrome/tool-renderers.js.map +1 -1
  23. package/lib/chrome/welcome-tips.js +1 -1
  24. package/lib/chrome/welcome-tips.js.map +1 -1
  25. package/lib/commands/auth.js +4 -2
  26. package/lib/commands/auth.js.map +1 -1
  27. package/lib/commands/jobs.d.ts +2 -2
  28. package/lib/commands/jobs.js +2 -2
  29. package/lib/commands/jobs.js.map +1 -1
  30. package/lib/definition.d.ts +62 -7
  31. package/lib/definition.js.map +1 -1
  32. package/lib/index.d.ts +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/input/keybindings-config.d.ts +1 -1
  36. package/lib/input/keybindings-config.js +2 -1
  37. package/lib/input/keybindings-config.js.map +1 -1
  38. package/lib/input/keys.d.ts +7 -0
  39. package/lib/input/keys.js +11 -4
  40. package/lib/input/keys.js.map +1 -1
  41. package/lib/runtime/provider-local.d.ts +63 -11
  42. package/lib/runtime/provider-local.js +506 -91
  43. package/lib/runtime/provider-local.js.map +1 -1
  44. package/lib/runtime/session-runtime.d.ts +9 -1
  45. package/lib/runtime/session-runtime.js +2 -2
  46. package/lib/runtime/session-runtime.js.map +1 -1
  47. package/lib/runtime/startup-notices.js +6 -9
  48. package/lib/runtime/startup-notices.js.map +1 -1
  49. package/lib/runtime/tool-presentation.js +44 -31
  50. package/lib/runtime/tool-presentation.js.map +1 -1
  51. package/lib/session/feature-toggles.d.ts +100 -0
  52. package/lib/session/feature-toggles.js +170 -0
  53. package/lib/session/feature-toggles.js.map +1 -0
  54. package/lib/session/fold-policy.d.ts +21 -0
  55. package/lib/session/fold-policy.js +15 -0
  56. package/lib/session/fold-policy.js.map +1 -0
  57. package/lib/session/job-notice.d.ts +6 -2
  58. package/lib/session/job-notice.js +44 -3
  59. package/lib/session/job-notice.js.map +1 -1
  60. package/lib/session/session-configuration.d.ts +0 -3
  61. package/lib/session/session-configuration.js +0 -4
  62. package/lib/session/session-configuration.js.map +1 -1
  63. package/lib/session/session-controller.d.ts +6 -4
  64. package/lib/session/session-controller.js +147 -55
  65. package/lib/session/session-controller.js.map +1 -1
  66. package/lib/session/session-library.d.ts +20 -0
  67. package/lib/session/session-library.js +52 -0
  68. package/lib/session/session-library.js.map +1 -1
  69. package/lib/session/subagent-roster.js +3 -3
  70. package/lib/session/subagent-roster.js.map +1 -1
  71. package/lib/session/subagent-tracker.d.ts +2 -9
  72. package/lib/session/subagent-tracker.js +3 -4
  73. package/lib/session/subagent-tracker.js.map +1 -1
  74. package/lib/session/tui-settings.d.ts +46 -18
  75. package/lib/session/tui-settings.js +59 -39
  76. package/lib/session/tui-settings.js.map +1 -1
  77. package/lib/views/at-complete.d.ts +2 -0
  78. package/lib/views/at-complete.js +2 -2
  79. package/lib/views/at-complete.js.map +1 -1
  80. package/lib/views/event-views.d.ts +26 -2
  81. package/lib/views/event-views.js +162 -48
  82. package/lib/views/event-views.js.map +1 -1
  83. package/lib/views/hotkeys.d.ts +2 -0
  84. package/lib/views/hotkeys.js +7 -3
  85. package/lib/views/hotkeys.js.map +1 -1
  86. package/lib/views/settings-list.d.ts +12 -6
  87. package/lib/views/settings-list.js +41 -18
  88. package/lib/views/settings-list.js.map +1 -1
  89. package/lib/views/transcript-export.js +0 -2
  90. package/lib/views/transcript-export.js.map +1 -1
  91. package/lib/views/transcript-render.d.ts +133 -18
  92. package/lib/views/transcript-render.js +1179 -112
  93. package/lib/views/transcript-render.js.map +1 -1
  94. package/lib/views/transcript-types.d.ts +79 -1
  95. package/lib/views/transcript-types.js +11 -0
  96. package/lib/views/transcript-types.js.map +1 -1
  97. package/lib/views/workspace-changes.d.ts +27 -0
  98. package/lib/views/workspace-changes.js +128 -0
  99. package/lib/views/workspace-changes.js.map +1 -0
  100. package/package.json +40 -38
@@ -1,7 +1,10 @@
1
1
  /** Harness ToolDefinition presentation bridge for live events and replay. */
2
2
  export const name = 'omdsh-tool-presentation';
3
3
  export const inject = ['tools'];
4
+ /** Decode a `tool/call` argument string; PTC dispatch events already carry a value. */
4
5
  function parsedArguments(raw) {
6
+ if (typeof raw !== 'string')
7
+ return raw;
5
8
  try {
6
9
  return JSON.parse(raw);
7
10
  }
@@ -31,43 +34,28 @@ class HarnessToolPresentation {
31
34
  }
32
35
  return this.#event(agent, event, undefined);
33
36
  }
34
- #event(agent, event, callIndex) {
35
- if (event.type === 'tool/call') {
36
- const definition = this.#ctx.tools.get(event.data.name, agent);
37
- if (definition?.presentCall === undefined)
38
- return undefined;
39
- try {
40
- const call = definition.presentCall(parsedArguments(event.data.arguments));
41
- return call === undefined ? undefined : { call };
42
- }
43
- catch {
44
- return undefined;
45
- }
46
- }
47
- if (event.type !== 'tool/result')
48
- return undefined;
49
- const callId = event.data.message.source.callId;
50
- const callEvent = callIndex?.get(callId)
51
- ?? this.#liveCalls.get(agent.session)?.get(callId)
52
- ?? agent.session.snapshotEvents().findLast(candidate => candidate.type === 'tool/call' && candidate.data.callId === callId);
53
- if (callEvent?.type !== 'tool/call')
37
+ #presentCall(agent, name, args) {
38
+ const definition = this.#ctx.tools.get(name, agent);
39
+ if (definition?.presentCall === undefined)
54
40
  return undefined;
55
- const definition = this.#ctx.tools.get(callEvent.data.name, agent);
56
- const args = parsedArguments(callEvent.data.arguments);
57
- let call;
58
- let result;
59
41
  try {
60
- call = definition?.presentCall?.(args);
42
+ return definition.presentCall(args);
61
43
  }
62
44
  catch {
63
- call = undefined;
45
+ return undefined;
64
46
  }
47
+ }
48
+ /** Resolve the call and result cards for one settled invocation. */
49
+ #present(agent, name, rawArgs, content, isError, meta) {
50
+ const args = parsedArguments(rawArgs);
51
+ const call = this.#presentCall(agent, name, args);
52
+ let result;
65
53
  try {
66
- const block = event.data.message.content[0];
67
- result = definition?.presentResult?.(args, {
68
- content: block.content,
69
- isError: block.isError === true,
70
- ...(event.data.meta === undefined ? {} : { meta: event.data.meta }),
54
+ result = this.#ctx.tools.get(name, agent)?.presentResult?.(args, {
55
+ // The harness freezes message content; `ToolResult` declares a mutable array.
56
+ content: [...content],
57
+ isError,
58
+ ...(meta === undefined ? {} : { meta }),
71
59
  });
72
60
  }
73
61
  catch {
@@ -78,6 +66,31 @@ class HarnessToolPresentation {
78
66
  ...(result === undefined ? {} : { result }),
79
67
  };
80
68
  }
69
+ #event(agent, event, callIndex) {
70
+ // A PTC sub-dispatch carries the tool name and its normalized arguments on
71
+ // both halves of the pair, so it resolves a card without a call index — the
72
+ // same cards a native call of the same tool would get.
73
+ if (event.type === 'tool/ptc-dispatch-start') {
74
+ const call = this.#presentCall(agent, event.data.name, event.data.arguments);
75
+ return call === undefined ? undefined : { call };
76
+ }
77
+ if (event.type === 'tool/ptc-dispatch') {
78
+ return this.#present(agent, event.data.name, event.data.arguments, event.data.content, event.data.isError, undefined);
79
+ }
80
+ if (event.type === 'tool/call') {
81
+ const call = this.#presentCall(agent, event.data.name, parsedArguments(event.data.arguments));
82
+ return call === undefined ? undefined : { call };
83
+ }
84
+ if (event.type !== 'tool/result')
85
+ return undefined;
86
+ const callId = event.data.message.source.callId;
87
+ const callEvent = callIndex?.get(callId)
88
+ ?? this.#liveCalls.get(agent.session)?.get(callId)
89
+ ?? agent.session.snapshotEvents().findLast(candidate => candidate.type === 'tool/call' && candidate.data.callId === callId);
90
+ if (callEvent?.type !== 'tool/call')
91
+ return undefined;
92
+ return this.#present(agent, callEvent.data.name, callEvent.data.arguments, event.data.message.content, event.data.message.isError === true, event.data.meta);
93
+ }
81
94
  session(agent, events) {
82
95
  // One pass builds a callId index instead of the per-result backwards
83
96
  // log scan, keeping replay linear in the event count.
@@ -1 +1 @@
1
- {"version":3,"file":"tool-presentation.js","sourceRoot":"","sources":["../../src/runtime/tool-presentation.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAQ7E,MAAM,CAAC,MAAM,IAAI,GAAG,yBAAyB,CAAA;AAC7C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,CAAA;AAc/B,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAA;IACZ,CAAC;AACH,CAAC;AAED,MAAM,uBAAuB;IAClB,IAAI,CAAS;IACtB;;;;OAIG;IACM,UAAU,GAAG,IAAI,OAAO,EAAsC,CAAA;IAEvE,YAAY,GAAY;QACtB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,KAAY,EAAE,KAAmB;QACrC,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YAC/B,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAC9C,IAAI,KAAK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CAAC;QACD,OAAO,aAAa,CAAA;IACtB,CAAC;CACF;AAED,+DAA+D;AAC/D,MAAM,UAAU,4BAA4B,CAAC,GAAY;IACvD,OAAO,IAAI,uBAAuB,CAAC,GAAG,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,4BAA4B,CAAC,GAAG,CAAC,CAAC,CAAA;AACvE,CAAC"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Optional product features and the Profile-patch block that turns them off.
3
+ *
4
+ * A feature is a composition row a deployment may not want: it costs context,
5
+ * runtime, or transcript noise. The row's `disabled` field is a Loader option
6
+ * rather than plugin config, so the settings service cannot write it — the
7
+ * Loader does read a Profile patch's `disabled`, and that patch is the
8
+ * documented, user-authored surface for exactly this.
9
+ *
10
+ * The writes therefore maintain one clearly delimited block in the Profile
11
+ * patch and touch nothing else in the file, so hand-written rows, `!!js`
12
+ * expressions, and comments all survive a toggle. Toggling takes effect on the
13
+ * next launch: the Harness reads the patch once while composing the tree.
14
+ * @module @agi-fans/dsh-tui
15
+ */
16
+ /** One optional product feature, addressed by the row id it disables. */
17
+ export interface FeatureToggle {
18
+ /** Composition row id; the key a Profile patch keys its override by. */
19
+ id: string;
20
+ /** Short row label for the settings overlay. */
21
+ label: string;
22
+ /** What the feature does, and what turning it off costs. */
23
+ description: string;
24
+ /** Whether the shipped composition mounts it. */
25
+ enabledByDefault: boolean;
26
+ }
27
+ /**
28
+ * Features this build can turn off.
29
+ *
30
+ * Rows that make the agent non-functional (`tool-fs`, `tool-bash`, `todo`), rows
31
+ * that back a command (`session-query` backs `/sessions`, `workspace` backs
32
+ * `@` mentions), and rows that are already conditional at no cost
33
+ * (`mcp-resources` appears only with a connected MCP server) are deliberately
34
+ * absent. `tool-web` is absent for a different reason: `web_search` and
35
+ * `web_fetch` share one row, so no row-level toggle can express "search off,
36
+ * fetch on".
37
+ */
38
+ export declare const FEATURE_TOGGLES: readonly FeatureToggle[];
39
+ /** Opening delimiter of the block this module owns. */
40
+ export declare const FEATURE_BLOCK_BEGIN = "# >>> omdsh feature toggles >>>";
41
+ /** Closing delimiter of the block this module owns. */
42
+ export declare const FEATURE_BLOCK_END = "# <<< omdsh feature toggles <<<";
43
+ /** Current on/off state of every feature, keyed by row id. */
44
+ export type FeatureStates = Readonly<Record<string, boolean>>;
45
+ /** The shipped composition's state, before any Profile patch override. */
46
+ export declare function defaultFeatureStates(features?: readonly FeatureToggle[]): Record<string, boolean>;
47
+ /**
48
+ * Apply the `disabled` rows a Profile patch declares on top of the defaults.
49
+ *
50
+ * Only rows this build knows a feature for are read: a patch may disable any
51
+ * row for its own reasons, and an unknown id is not a feature toggle.
52
+ *
53
+ * @param states - the shipped defaults.
54
+ * @param disabled - row ids the patch marks `disabled: true`.
55
+ * @returns a new state map with those features off.
56
+ */
57
+ export declare function applyDisabledRows(states: Record<string, boolean>, disabled: readonly string[]): Record<string, boolean>;
58
+ /**
59
+ * Row ids that must be disabled to make `states` true, ignoring rows already
60
+ * off in the shipped composition.
61
+ *
62
+ * @param states - desired feature state.
63
+ * @returns the row ids a patch has to mark `disabled: true`.
64
+ */
65
+ export declare function rowsToDisable(states: FeatureStates): string[];
66
+ /**
67
+ * Render the managed block for the features that are off.
68
+ *
69
+ * The block is written unconditionally so it always states the full set the
70
+ * build manages; re-enabling a feature is removing its row from here.
71
+ *
72
+ * @param states - desired feature state.
73
+ * @returns the block text, including a trailing newline.
74
+ */
75
+ export declare function renderFeatureBlock(states: FeatureStates): string;
76
+ /**
77
+ * Replace the managed block, leaving every other byte of the patch untouched.
78
+ *
79
+ * A patch that carries no block is simply appended to, so a file the user has
80
+ * been editing by hand keeps its formatting, comments, and `!!js` expressions.
81
+ *
82
+ * @param text - current patch file contents.
83
+ * @param block - the block to install.
84
+ * @returns the new patch file contents.
85
+ */
86
+ export declare function replaceFeatureBlock(text: string, block: string): string;
87
+ /**
88
+ * Read the feature state a patch file currently declares.
89
+ *
90
+ * Only the managed block is parsed, by row id, so a hand-written
91
+ * `disabled: true` elsewhere in the file is left for the composition to honour
92
+ * and is not double-counted as a feature toggle.
93
+ *
94
+ * @param text - patch file contents.
95
+ * @param features - known features; defaults to the shipped registry.
96
+ * @returns the state the block declares over the shipped defaults.
97
+ */
98
+ export declare function featureStatesFromPatch(text: string, features?: readonly FeatureToggle[]): Record<string, boolean>;
99
+ /** Absolute path of the Profile patch this build edits. */
100
+ export declare function featurePatchPath(dshHome: string): string;
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Optional product features and the Profile-patch block that turns them off.
3
+ *
4
+ * A feature is a composition row a deployment may not want: it costs context,
5
+ * runtime, or transcript noise. The row's `disabled` field is a Loader option
6
+ * rather than plugin config, so the settings service cannot write it — the
7
+ * Loader does read a Profile patch's `disabled`, and that patch is the
8
+ * documented, user-authored surface for exactly this.
9
+ *
10
+ * The writes therefore maintain one clearly delimited block in the Profile
11
+ * patch and touch nothing else in the file, so hand-written rows, `!!js`
12
+ * expressions, and comments all survive a toggle. Toggling takes effect on the
13
+ * next launch: the Harness reads the patch once while composing the tree.
14
+ * @module @agi-fans/dsh-tui
15
+ */
16
+ import { join } from 'node:path';
17
+ /**
18
+ * Features this build can turn off.
19
+ *
20
+ * Rows that make the agent non-functional (`tool-fs`, `tool-bash`, `todo`), rows
21
+ * that back a command (`session-query` backs `/sessions`, `workspace` backs
22
+ * `@` mentions), and rows that are already conditional at no cost
23
+ * (`mcp-resources` appears only with a connected MCP server) are deliberately
24
+ * absent. `tool-web` is absent for a different reason: `web_search` and
25
+ * `web_fetch` share one row, so no row-level toggle can express "search off,
26
+ * fetch on".
27
+ */
28
+ export const FEATURE_TOGGLES = [
29
+ {
30
+ id: 'workspace-changes',
31
+ label: 'Changed-file summary',
32
+ description: 'End every turn with the files it changed and their line counts. Off skips two Git snapshots per turn and the transcript row.',
33
+ enabledByDefault: true,
34
+ },
35
+ {
36
+ id: 'tool-session-query',
37
+ label: 'Session history tools',
38
+ description: 'Five tools that let the model search, trace and read its own earlier sessions. Off removes five tool schemas from every request.',
39
+ enabledByDefault: true,
40
+ },
41
+ {
42
+ id: 'tool-ralph',
43
+ label: 'Ralph loop',
44
+ description: 'Let the model re-run a task until it reports completion. Off by default because the tool is a self-report, not an evaluation.',
45
+ enabledByDefault: false,
46
+ },
47
+ {
48
+ id: 'repeat-tool-reminder',
49
+ label: 'Repeat-tool reminder',
50
+ description: 'Nudge the model out of identical tool-call loops. Off removes the advisory text those nudges add to the context.',
51
+ enabledByDefault: true,
52
+ },
53
+ ];
54
+ /** Opening delimiter of the block this module owns. */
55
+ export const FEATURE_BLOCK_BEGIN = '# >>> omdsh feature toggles >>>';
56
+ /** Closing delimiter of the block this module owns. */
57
+ export const FEATURE_BLOCK_END = '# <<< omdsh feature toggles <<<';
58
+ /** The shipped composition's state, before any Profile patch override. */
59
+ export function defaultFeatureStates(features = FEATURE_TOGGLES) {
60
+ return Object.fromEntries(features.map(feature => [feature.id, feature.enabledByDefault]));
61
+ }
62
+ /**
63
+ * Apply the `disabled` rows a Profile patch declares on top of the defaults.
64
+ *
65
+ * Only rows this build knows a feature for are read: a patch may disable any
66
+ * row for its own reasons, and an unknown id is not a feature toggle.
67
+ *
68
+ * @param states - the shipped defaults.
69
+ * @param disabled - row ids the patch marks `disabled: true`.
70
+ * @returns a new state map with those features off.
71
+ */
72
+ export function applyDisabledRows(states, disabled) {
73
+ const known = new Set(FEATURE_TOGGLES.map(feature => feature.id));
74
+ const next = { ...states };
75
+ for (const id of disabled)
76
+ if (known.has(id))
77
+ next[id] = false;
78
+ return next;
79
+ }
80
+ /**
81
+ * Row ids that must be disabled to make `states` true, ignoring rows already
82
+ * off in the shipped composition.
83
+ *
84
+ * @param states - desired feature state.
85
+ * @returns the row ids a patch has to mark `disabled: true`.
86
+ */
87
+ export function rowsToDisable(states) {
88
+ return FEATURE_TOGGLES
89
+ .filter(feature => feature.enabledByDefault && states[feature.id] === false)
90
+ .map(feature => feature.id);
91
+ }
92
+ /**
93
+ * Render the managed block for the features that are off.
94
+ *
95
+ * The block is written unconditionally so it always states the full set the
96
+ * build manages; re-enabling a feature is removing its row from here.
97
+ *
98
+ * @param states - desired feature state.
99
+ * @returns the block text, including a trailing newline.
100
+ */
101
+ export function renderFeatureBlock(states) {
102
+ const off = FEATURE_TOGGLES
103
+ .filter(feature => feature.enabledByDefault && states[feature.id] === false)
104
+ .map(feature => feature.id);
105
+ const lines = [FEATURE_BLOCK_BEGIN];
106
+ for (const id of off)
107
+ lines.push(`- id: ${id}`, ' disabled: true');
108
+ lines.push(FEATURE_BLOCK_END, '');
109
+ return lines.join('\n');
110
+ }
111
+ /**
112
+ * Replace the managed block, leaving every other byte of the patch untouched.
113
+ *
114
+ * A patch that carries no block is simply appended to, so a file the user has
115
+ * been editing by hand keeps its formatting, comments, and `!!js` expressions.
116
+ *
117
+ * @param text - current patch file contents.
118
+ * @param block - the block to install.
119
+ * @returns the new patch file contents.
120
+ */
121
+ export function replaceFeatureBlock(text, block) {
122
+ const begin = text.indexOf(FEATURE_BLOCK_BEGIN);
123
+ const end = text.indexOf(FEATURE_BLOCK_END);
124
+ if (begin < 0 || end < 0 || end < begin) {
125
+ const head = text.trimEnd();
126
+ return head === '' ? block : `${head}\n\n${block}`;
127
+ }
128
+ const before = text.slice(0, begin).trimEnd();
129
+ const after = text.slice(end + FEATURE_BLOCK_END.length).replace(/^\n+/, '');
130
+ const head = before === '' ? '' : `${before}\n\n`;
131
+ const tail = after.trim() === '' ? '' : `\n${after}`;
132
+ return `${head}${block.trimEnd()}${tail}\n`;
133
+ }
134
+ /**
135
+ * Read the feature state a patch file currently declares.
136
+ *
137
+ * Only the managed block is parsed, by row id, so a hand-written
138
+ * `disabled: true` elsewhere in the file is left for the composition to honour
139
+ * and is not double-counted as a feature toggle.
140
+ *
141
+ * @param text - patch file contents.
142
+ * @param features - known features; defaults to the shipped registry.
143
+ * @returns the state the block declares over the shipped defaults.
144
+ */
145
+ export function featureStatesFromPatch(text, features = FEATURE_TOGGLES) {
146
+ const begin = text.indexOf(FEATURE_BLOCK_BEGIN);
147
+ const end = text.indexOf(FEATURE_BLOCK_END);
148
+ const states = Object.fromEntries(features.map(f => [f.id, f.enabledByDefault]));
149
+ if (begin < 0 || end < 0 || end < begin)
150
+ return states;
151
+ let current;
152
+ for (const raw of text.slice(begin, end).split('\n')) {
153
+ const id = raw.match(/^\s*-\s*id:\s*(\S+)\s*$/u);
154
+ if (id !== null) {
155
+ current = id[1];
156
+ continue;
157
+ }
158
+ if (/^\s*disabled:\s*true\s*$/u.test(raw) && current !== undefined) {
159
+ if (Object.hasOwn(states, current))
160
+ states[current] = false;
161
+ current = undefined;
162
+ }
163
+ }
164
+ return states;
165
+ }
166
+ /** Absolute path of the Profile patch this build edits. */
167
+ export function featurePatchPath(dshHome) {
168
+ return join(dshHome, 'profiles', 'omdsh', 'cordis.patch.yml');
169
+ }
170
+ //# sourceMappingURL=feature-toggles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-toggles.js","sourceRoot":"","sources":["../../src/session/feature-toggles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAchC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD;QACE,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,8HAA8H;QAC3I,gBAAgB,EAAE,IAAI;KACvB;IACD;QACE,EAAE,EAAE,oBAAoB;QACxB,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,kIAAkI;QAC/I,gBAAgB,EAAE,IAAI;KACvB;IACD;QACE,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,+HAA+H;QAC5I,gBAAgB,EAAE,KAAK;KACxB;IACD;QACE,EAAE,EAAE,sBAAsB;QAC1B,KAAK,EAAE,sBAAsB;QAC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,CAAC,MAAM,EAAE,OAAO,CAAC;gBAAE,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;YAC3D,OAAO,GAAG,SAAS,CAAA;QACrB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAA;AAC/D,CAAC"}
@@ -0,0 +1,21 @@
1
+ /** Compatibility for stored transcript preferences from earlier versions. */
2
+ export declare const FOLD_DENSITIES: readonly ["compact", "standard", "detailed", "verbose"];
3
+ export type FoldDensity = typeof FOLD_DENSITIES[number];
4
+ /** @deprecated Turns now use one presentation policy. */
5
+ export interface FoldPolicy {
6
+ groups: boolean;
7
+ tools: boolean;
8
+ reasoning: boolean;
9
+ detail: boolean;
10
+ subject: boolean;
11
+ }
12
+ export declare const DEFAULT_FOLD_DENSITY: FoldDensity;
13
+ /** All legacy values resolve to the current turn presentation. */
14
+ export declare function foldPolicy(_density: FoldDensity): FoldPolicy;
15
+ export declare function isFoldDensity(value: string): value is FoldDensity;
16
+ /** Old preferences remain readable but no longer select a different layout. */
17
+ export declare function resolveFoldDensity(_prefs: {
18
+ foldDensity?: FoldDensity;
19
+ expandTools?: boolean;
20
+ }): FoldDensity;
21
+ export declare function foldPolicyKey(_policy: FoldPolicy): string;
@@ -0,0 +1,15 @@
1
+ /** Compatibility for stored transcript preferences from earlier versions. */
2
+ export const FOLD_DENSITIES = ['compact', 'standard', 'detailed', 'verbose'];
3
+ export const DEFAULT_FOLD_DENSITY = 'standard';
4
+ const TURN_POLICY = { groups: true, tools: true, reasoning: false, detail: false, subject: true };
5
+ /** All legacy values resolve to the current turn presentation. */
6
+ export function foldPolicy(_density) { return TURN_POLICY; }
7
+ export function isFoldDensity(value) {
8
+ return FOLD_DENSITIES.includes(value);
9
+ }
10
+ /** Old preferences remain readable but no longer select a different layout. */
11
+ export function resolveFoldDensity(_prefs) {
12
+ return DEFAULT_FOLD_DENSITY;
13
+ }
14
+ export function foldPolicyKey(_policy) { return 'turn'; }
15
+ //# sourceMappingURL=fold-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fold-policy.js","sourceRoot":"","sources":["../../src/session/fold-policy.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,CAAU,CAAA;AAYrF,MAAM,CAAC,MAAM,oBAAoB,GAAgB,UAAU,CAAA;AAC3D,MAAM,WAAW,GAAe,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAE7G,kEAAkE;AAClE,MAAM,UAAU,UAAU,CAAC,QAAqB,IAAgB,OAAO,WAAW,CAAA,CAAC,CAAC;AAEpF,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAQ,cAAoC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC9D,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAAC,MAA4D;IAC7F,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAmB,IAAY,OAAO,MAAM,CAAA,CAAC,CAAC"}
@@ -4,7 +4,11 @@
4
4
  * @module @agi-fans/dsh-tui/job-notice
5
5
  */
6
6
  import type { Agent } from '@deepseek-ai/dsh-agent';
7
- import type { JobKind, JobStatus } from '@deepseek-ai/dsh-jobs';
7
+ import type { JobStatus, JobView } from '@deepseek-ai/dsh-jobs';
8
+ import type { TuiNoticeOptions } from '../definition.ts';
9
+ import type { TranscriptState } from '../views/transcript-types.ts';
10
+ /** Merge only an identified job or an unambiguous command still awaiting its result. */
11
+ export declare function mergeJobSettlement(state: TranscriptState, job: NonNullable<TuiNoticeOptions['job']>): TranscriptState | undefined;
8
12
  /** Past- or present-tense word for one lifecycle status. */
9
13
  export declare const JOB_STATUS_WORD: Record<JobStatus, string>;
10
14
  /** One human-facing completion line for a background job. */
@@ -20,7 +24,7 @@ export declare function formatJobNotice(snapshot: {
20
24
  * owned by another session is not this terminal's business.
21
25
  */
22
26
  export declare function jobNoticeFor(snapshot: {
23
- readonly kind: JobKind;
27
+ readonly kind: JobView['kind'];
24
28
  readonly id: string;
25
29
  readonly label: string;
26
30
  readonly status: JobStatus;
@@ -3,6 +3,45 @@
3
3
  * notice, so one job reads the same in both surfaces.
4
4
  * @module @agi-fans/dsh-tui/job-notice
5
5
  */
6
+ import { toolArgsObject } from "../chrome/tool-args.js";
7
+ import { truncateToWidth, visibleWidth } from "../chrome/width.js";
8
+ /** Merge only an identified job or an unambiguous command still awaiting its result. */
9
+ export function mergeJobSettlement(state, job) {
10
+ const identified = [];
11
+ const pending = [];
12
+ state.blocks.forEach((block, index) => {
13
+ if (block.kind !== 'tool')
14
+ return;
15
+ if (!/^(bash|shell|pwsh|exec)$/u.test(block.name) && block.presentation?.call?.card !== 'terminal')
16
+ return;
17
+ const explicitId = /^started background job (\S+)\s*$/u.exec(block.output)?.[1]
18
+ ?? /\[still running after \d+ms; moved to background job ([^\s\]]+)\]/u.exec(block.output)?.[1];
19
+ const id = block.job?.id ?? explicitId;
20
+ if (id !== undefined) {
21
+ if (id === job.id)
22
+ identified.push(index);
23
+ return;
24
+ }
25
+ const args = toolArgsObject(block.args);
26
+ if (block.status === 'running' && block.startedAt !== undefined && block.startedAt <= job.startedAt
27
+ && typeof args?.['command'] === 'string' && args['command'] === job.label)
28
+ pending.push(index);
29
+ });
30
+ const matches = identified.length > 0 ? identified : pending;
31
+ if (matches.length !== 1)
32
+ return undefined;
33
+ const index = matches[0];
34
+ const block = state.blocks[index];
35
+ if (block.kind !== 'tool')
36
+ return undefined;
37
+ const blocks = [...state.blocks];
38
+ blocks[index] = {
39
+ ...block,
40
+ status: job.status === 'completed' && block.status !== 'error' ? 'ok' : 'error',
41
+ job: { id: job.id, status: job.status, detail: job.detail?.trim() || JOB_STATUS_WORD[job.status] },
42
+ };
43
+ return { ...state, blocks };
44
+ }
6
45
  /** Past- or present-tense word for one lifecycle status. */
7
46
  export const JOB_STATUS_WORD = {
8
47
  running: 'running',
@@ -13,9 +52,11 @@ export const JOB_STATUS_WORD = {
13
52
  };
14
53
  /** One human-facing completion line for a background job. */
15
54
  export function formatJobNotice(snapshot) {
16
- const label = snapshot.label.trim();
17
- const detail = snapshot.detail === undefined ? '' : snapshot.detail.trim();
18
- return `Background job ${snapshot.id} ${JOB_STATUS_WORD[snapshot.status]}`
55
+ const head = `Background job ${snapshot.id} ${JOB_STATUS_WORD[snapshot.status]}`;
56
+ const detail = truncateToWidth(snapshot.detail?.trim().split('\n')[0] ?? '', 28);
57
+ const room = Math.max(0, 76 - visibleWidth(head) - (detail === '' ? 0 : visibleWidth(detail) + 3) - 3);
58
+ const label = room < 8 ? '' : truncateToWidth(snapshot.label.trim().split('\n')[0] ?? '', room);
59
+ return head
19
60
  + (label === '' ? '' : ` · ${label}`)
20
61
  + (detail === '' ? '' : ` · ${detail}`);
21
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"job-notice.js","sourceRoot":"","sources":["../../src/session/job-notice.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAA8B;IACxD,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,QAAQ;CACjB,CAAA;AAED,6DAA6D;AAC7D,MAAM,UAAU,eAAe,CAAC,QAK/B;IACC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,KA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,CAAC,CAAA;IACtG,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAA;IAC/F,OAAO,IAAI;UACP,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC;UACnC,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC,CAAA;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC1B,QAA+I,EAC/I,KAAwB,EACxB,MAAyB;IAEzB,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,SAAS,CAAA;IAClD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,SAAS,CAAA;IAC7D,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAA;AAClC,CAAC"}
@@ -1,8 +1,5 @@
1
1
  /** Agent-preset configuration and composition guards for one session. */
2
2
  import { type Session } from '@deepseek-ai/dsh-session';
3
- import type { ToolPresentationMode } from '@deepseek-ai/dsh-tools';
4
- /** PTC uses Code presentation; every other preset exposes native functions. */
5
- export declare function toolPresentationForPreset(agentPreset: string): ToolPresentationMode;
6
3
  /** Agent composition may change only before any model-visible history exists. */
7
4
  export declare function isBlankSession(session: Session): boolean;
8
5
  export declare function formatAgentPreset(id: string): string;
@@ -8,10 +8,6 @@ function registerLegacyOmdshSessionEvents() {
8
8
  KNOWN_SESSION_EVENT_TYPES.add('omdsh/tools-selected');
9
9
  }
10
10
  registerLegacyOmdshSessionEvents();
11
- /** PTC uses Code presentation; every other preset exposes native functions. */
12
- export function toolPresentationForPreset(agentPreset) {
13
- return agentPreset === 'code' ? 'ptc' : 'native';
14
- }
15
11
  /** Agent composition may change only before any model-visible history exists. */
16
12
  export function isBlankSession(session) {
17
13
  if (session.deriveMessages().length > 0)
@@ -1 +1 @@
1
- {"version":3,"file":"session-configuration.js","sourceRoot":"","sources":["../../src/session/session-configuration.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,yBAAyB,EAAgB,MAAM,0BAA0B,CAAA;AAGlF;;;GAGG;AACH,SAAS,gCAAgC;IACtC,yBAAyC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;AACxE,CAAC;AAED,gCAAgC,EAAE,CAAA;AAElC,+EAA+E;AAC/E,MAAM,UAAU,yBAAyB,CAAC,WAAmB;IAC3D,OAAO,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAA;AAClD,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACrD,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,gBAAgB;WACzE,KAAK,CAAC,IAAI,KAAK,iBAAiB;WAChC,KAAK,CAAC,IAAI,KAAK,YAAY;WAC3B,KAAK,CAAC,IAAI,KAAK,YAAY;WAC3B,KAAK,CAAC,IAAI,KAAK,mBAAmB;WAClC,KAAK,CAAC,IAAI,KAAK,WAAW;WAC1B,KAAK,CAAC,IAAI,KAAK,aAAa,CAAC,CAAA;AACpC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAU;IAC1C,IAAI,EAAE,KAAK,UAAU;QAAE,OAAO,UAAU,CAAA;IACxC,IAAI,EAAE,KAAK,MAAM;QAAE,OAAO,KAAK,CAAA;IAC/B,IAAI,EAAE,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IACtC,IAAI,EAAE,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAA;IACpC,OAAO,EAAE,CAAA;AACX,CAAC"}
1
+ {"version":3,"file":"session-configuration.js","sourceRoot":"","sources":["../../src/session/session-configuration.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,yBAAyB,EAAgB,MAAM,0BAA0B,CAAA;AAElF;;;GAGG;AACH,SAAS,gCAAgC;IACtC,yBAAyC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;AACxE,CAAC;AAED,gCAAgC,EAAE,CAAA;AAElC,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACrD,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,gBAAgB;WACzE,KAAK,CAAC,IAAI,KAAK,iBAAiB;WAChC,KAAK,CAAC,IAAI,KAAK,YAAY;WAC3B,KAAK,CAAC,IAAI,KAAK,YAAY;WAC3B,KAAK,CAAC,IAAI,KAAK,mBAAmB;WAClC,KAAK,CAAC,IAAI,KAAK,WAAW;WAC1B,KAAK,CAAC,IAAI,KAAK,aAAa,CAAC,CAAA;AACpC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAU;IAC1C,IAAI,EAAE,KAAK,UAAU;QAAE,OAAO,UAAU,CAAA;IACxC,IAAI,EAAE,KAAK,MAAM;QAAE,OAAO,KAAK,CAAA;IAC/B,IAAI,EAAE,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IACtC,IAAI,EAAE,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAA;IACpC,OAAO,EAAE,CAAA;AACX,CAAC"}
@@ -8,11 +8,11 @@
8
8
  */
9
9
  import type { Context } from '@deepseek-ai/cordis';
10
10
  import { type Agent, type ModelSelection } from '@deepseek-ai/dsh-agent';
11
- import type { AgentPreset } from '@deepseek-ai/dsh-agent-presets';
11
+ import type { AgentPreset } from '@deepseek-ai/dsh-agent-preset-registry';
12
12
  import { type LlmResolvedModelInfo, type UserMessage } from '@deepseek-ai/dsh-llm';
13
13
  import type { ImageAttachmentRef, SaveImageAttachment, StoredImageAttachment } from '@deepseek-ai/dsh-attachment';
14
14
  import type { CommandSubmitAttachment } from '@deepseek-ai/dsh-commands';
15
- import type { PermissionSelect } from '@deepseek-ai/dsh-permission-presets/types';
15
+ import type { PermissionSelection } from '@deepseek-ai/dsh-permission-presets/types';
16
16
  import type { PlanProjection } from '@deepseek-ai/dsh-plan-mode/types';
17
17
  import { type SkillSummary } from '@deepseek-ai/dsh-skill';
18
18
  import type { SessionStatsProjection } from '@deepseek-ai/dsh-session-stats/types';
@@ -28,7 +28,7 @@ export interface TuiStatsProjection {
28
28
  contextPressure?: ContextPressureProjection;
29
29
  contextBreakdown?: ContextBreakdownProjection;
30
30
  plan?: PlanProjection;
31
- permissions?: PermissionSelect;
31
+ permissions?: PermissionSelection;
32
32
  goal?: GoalProjection | null;
33
33
  /** Last logged sandbox-mode override, or null before one; outranks the preset while set. */
34
34
  sandboxMode?: 'read-only' | 'workspace-write' | 'danger-full-access' | null;
@@ -101,7 +101,9 @@ export declare function restoreSubmissionMessage(message: UserMessage, attachmen
101
101
  /** Own one switchable top-level Agent and project it onto a TuiService. */
102
102
  export declare class SessionRuntime {
103
103
  #private;
104
- constructor(ctx: Context, tui: TuiService);
104
+ constructor(ctx: Context, tui: TuiService, options?: {
105
+ stateDir?: string;
106
+ });
105
107
  get agent(): Agent | undefined;
106
108
  /**
107
109
  * Interrupt the visible continuable child when one is inspected.