@toddzheng024/dscode-bundle 0.7.12 → 0.7.13

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 (152) hide show
  1. package/THIRD_PARTY_NOTICES.md +3 -3
  2. package/cordis.patch.yml +1 -1
  3. package/package.json +5 -4
  4. package/plugins/session-metrics/view.mjs +10 -2
  5. package/vendor/tui/lib/app.mjs +6674 -0
  6. package/vendor/tui/lib/approval.mjs +122 -0
  7. package/vendor/tui/lib/attachments.mjs +218 -0
  8. package/vendor/tui/lib/authorization-panel.mjs +242 -0
  9. package/vendor/tui/lib/authorization.mjs +111 -0
  10. package/vendor/tui/lib/commands.mjs +123 -0
  11. package/vendor/tui/lib/dscode/chat.mjs +64 -0
  12. package/vendor/tui/lib/dscode/flags.mjs +32 -0
  13. package/vendor/tui/lib/dscode/model-search.mjs +68 -0
  14. package/vendor/tui/lib/dscode/paste.mjs +87 -0
  15. package/vendor/tui/lib/dscode/telemetry.mjs +82 -0
  16. package/vendor/tui/lib/dscode/welcome.mjs +100 -0
  17. package/vendor/tui/lib/editor-keys.mjs +346 -0
  18. package/vendor/tui/lib/editor.mjs +50 -0
  19. package/vendor/tui/lib/fork.mjs +24 -0
  20. package/vendor/tui/lib/git-workflow.mjs +278 -0
  21. package/vendor/tui/{types/history.d.ts → lib/history.mjs} +69 -26
  22. package/vendor/tui/{types/i18n.d.ts → lib/i18n.mjs} +23 -15
  23. package/vendor/tui/lib/index.mjs +2198 -0
  24. package/vendor/tui/lib/input-split.mjs +170 -0
  25. package/vendor/tui/lib/internals.mjs +90 -0
  26. package/vendor/tui/lib/invariant.mjs +22 -0
  27. package/vendor/tui/lib/kernel-panels.mjs +1265 -0
  28. package/vendor/tui/lib/keyboard.mjs +283 -0
  29. package/vendor/tui/lib/language-panel.mjs +41 -0
  30. package/vendor/tui/lib/locales/en.mjs +495 -0
  31. package/vendor/tui/lib/locales/zh.mjs +495 -0
  32. package/vendor/tui/lib/mentions.mjs +150 -0
  33. package/vendor/tui/lib/model-capabilities.mjs +245 -0
  34. package/vendor/tui/lib/models.mjs +215 -0
  35. package/vendor/tui/{types/panel-accent.d.ts → lib/panel-accent.mjs} +11 -7
  36. package/vendor/tui/lib/permissions.mjs +45 -0
  37. package/vendor/tui/lib/plugin-inventory.mjs +27 -0
  38. package/vendor/tui/lib/presets.mjs +46 -0
  39. package/vendor/tui/lib/provider-settings.mjs +600 -0
  40. package/vendor/tui/lib/questions.mjs +116 -0
  41. package/vendor/tui/lib/rainbow.mjs +181 -0
  42. package/vendor/tui/lib/render/animations.mjs +665 -0
  43. package/vendor/tui/lib/render/editor.mjs +437 -0
  44. package/vendor/tui/lib/render/export.mjs +119 -0
  45. package/vendor/tui/lib/render/fuzzy.mjs +79 -0
  46. package/vendor/tui/lib/render/ime-cursor.mjs +135 -0
  47. package/vendor/tui/lib/render/inspector.mjs +93 -0
  48. package/vendor/tui/lib/render/lines.mjs +538 -0
  49. package/vendor/tui/lib/render/markdown.mjs +592 -0
  50. package/vendor/tui/lib/render/projection.mjs +1862 -0
  51. package/vendor/tui/lib/render/status.mjs +591 -0
  52. package/vendor/tui/lib/render/text.mjs +157 -0
  53. package/vendor/tui/lib/render/tool-detail.mjs +187 -0
  54. package/vendor/tui/lib/render/tool-preview.mjs +79 -0
  55. package/vendor/tui/lib/render/usage.mjs +336 -0
  56. package/vendor/tui/lib/render/width.mjs +191 -0
  57. package/vendor/tui/lib/session-directory.mjs +329 -0
  58. package/vendor/tui/lib/session-query.mjs +184 -0
  59. package/vendor/tui/lib/session-switch.mjs +51 -0
  60. package/vendor/tui/lib/settings-file.mjs +75 -0
  61. package/vendor/tui/lib/skills.mjs +119 -0
  62. package/vendor/tui/lib/startup.mjs +111 -0
  63. package/vendor/tui/lib/store.mjs +129 -0
  64. package/vendor/tui/lib/subagents.mjs +200 -0
  65. package/vendor/tui/lib/terminal-title.mjs +186 -0
  66. package/vendor/tui/lib/theme-panel.mjs +60 -0
  67. package/vendor/tui/lib/theme.mjs +379 -0
  68. package/vendor/tui/lib/update-panel.mjs +239 -0
  69. package/vendor/tui/lib/update.mjs +101 -0
  70. package/vendor/tui/lib/version.mjs +105 -0
  71. package/vendor/tui/lib/whale-glyph.mjs +20 -0
  72. package/vendor/tui/LICENSE +0 -21
  73. package/vendor/tui/devtools-CdTl3MNy.mjs +0 -3643
  74. package/vendor/tui/dscode-email/cli.mjs +0 -32
  75. package/vendor/tui/dscode-email/contacts.mjs +0 -36
  76. package/vendor/tui/dscode-email/gmail-oauth.mjs +0 -69
  77. package/vendor/tui/dscode-email/gmail-store.mjs +0 -2
  78. package/vendor/tui/dscode-email/gmail.mjs +0 -194
  79. package/vendor/tui/dscode-email/imap.mjs +0 -136
  80. package/vendor/tui/dscode-email/inbox.d.mts +0 -25
  81. package/vendor/tui/dscode-email/inbox.mjs +0 -76
  82. package/vendor/tui/dscode-email/smtp.mjs +0 -69
  83. package/vendor/tui/dscode-email/store.mjs +0 -32
  84. package/vendor/tui/dscode-providers/catalog.mjs +0 -136
  85. package/vendor/tui/dscode-providers/effort.mjs +0 -35
  86. package/vendor/tui/dscode-providers/openrouter-account.mjs +0 -171
  87. package/vendor/tui/index.mjs +0 -44441
  88. package/vendor/tui/invariant.mjs +0 -21
  89. package/vendor/tui/rolldown-runtime-CMFfr-1z.mjs +0 -26
  90. package/vendor/tui/session-query.mjs +0 -150
  91. package/vendor/tui/startup.mjs +0 -109
  92. package/vendor/tui/theme-7u5Qo3dF.mjs +0 -1265
  93. package/vendor/tui/types/app.d.ts +0 -348
  94. package/vendor/tui/types/approval.d.ts +0 -59
  95. package/vendor/tui/types/attachments.d.ts +0 -52
  96. package/vendor/tui/types/authorization-panel.d.ts +0 -22
  97. package/vendor/tui/types/authorization.d.ts +0 -36
  98. package/vendor/tui/types/commands.d.ts +0 -52
  99. package/vendor/tui/types/editor-keys.d.ts +0 -105
  100. package/vendor/tui/types/editor.d.ts +0 -6
  101. package/vendor/tui/types/fork.d.ts +0 -8
  102. package/vendor/tui/types/git-workflow.d.ts +0 -121
  103. package/vendor/tui/types/index.d.ts +0 -223
  104. package/vendor/tui/types/input-split.d.ts +0 -54
  105. package/vendor/tui/types/internals.d.ts +0 -26
  106. package/vendor/tui/types/invariant.d.ts +0 -15
  107. package/vendor/tui/types/kernel-panels.d.ts +0 -245
  108. package/vendor/tui/types/keyboard.d.ts +0 -80
  109. package/vendor/tui/types/language-panel.d.ts +0 -12
  110. package/vendor/tui/types/locales/en.d.ts +0 -450
  111. package/vendor/tui/types/locales/zh.d.ts +0 -9
  112. package/vendor/tui/types/mentions.d.ts +0 -85
  113. package/vendor/tui/types/model-capabilities.d.ts +0 -82
  114. package/vendor/tui/types/models.d.ts +0 -133
  115. package/vendor/tui/types/permissions.d.ts +0 -27
  116. package/vendor/tui/types/plugin-inventory.d.ts +0 -11
  117. package/vendor/tui/types/presets.d.ts +0 -22
  118. package/vendor/tui/types/provider-settings.d.ts +0 -239
  119. package/vendor/tui/types/questions.d.ts +0 -54
  120. package/vendor/tui/types/rainbow.d.ts +0 -69
  121. package/vendor/tui/types/render/animations.d.ts +0 -307
  122. package/vendor/tui/types/render/editor.d.ts +0 -163
  123. package/vendor/tui/types/render/export.d.ts +0 -9
  124. package/vendor/tui/types/render/fuzzy.d.ts +0 -21
  125. package/vendor/tui/types/render/ime-cursor.d.ts +0 -60
  126. package/vendor/tui/types/render/inspector.d.ts +0 -62
  127. package/vendor/tui/types/render/lines.d.ts +0 -86
  128. package/vendor/tui/types/render/markdown.d.ts +0 -29
  129. package/vendor/tui/types/render/projection.d.ts +0 -587
  130. package/vendor/tui/types/render/status.d.ts +0 -196
  131. package/vendor/tui/types/render/text.d.ts +0 -64
  132. package/vendor/tui/types/render/tool-detail.d.ts +0 -94
  133. package/vendor/tui/types/render/tool-preview.d.ts +0 -28
  134. package/vendor/tui/types/render/usage.d.ts +0 -113
  135. package/vendor/tui/types/render/width.d.ts +0 -29
  136. package/vendor/tui/types/session-directory.d.ts +0 -190
  137. package/vendor/tui/types/session-query.d.ts +0 -92
  138. package/vendor/tui/types/session-switch.d.ts +0 -17
  139. package/vendor/tui/types/settings-file.d.ts +0 -41
  140. package/vendor/tui/types/skills.d.ts +0 -47
  141. package/vendor/tui/types/startup.d.ts +0 -65
  142. package/vendor/tui/types/store.d.ts +0 -58
  143. package/vendor/tui/types/subagents.d.ts +0 -70
  144. package/vendor/tui/types/terminal-title.d.ts +0 -66
  145. package/vendor/tui/types/theme-panel.d.ts +0 -24
  146. package/vendor/tui/types/theme.d.ts +0 -434
  147. package/vendor/tui/types/update-panel.d.ts +0 -49
  148. package/vendor/tui/types/update.d.ts +0 -75
  149. package/vendor/tui/types/version.d.ts +0 -19
  150. package/vendor/tui/types/whale-glyph.d.ts +0 -6
  151. /package/vendor/tui/{dscode-clipboard-image → lib/dscode/clipboard-image}/clipboard-image.swift +0 -0
  152. /package/vendor/tui/{dscode-clipboard-image → lib/dscode/clipboard-image}/index.mjs +0 -0
@@ -0,0 +1,45 @@
1
+ /** Permission-preset policy for pending and active TUI sessions. */
2
+ /** Read the optional Harness service without importing its runtime package. */
3
+ export function permissionPresetsFrom(ctx) {
4
+ return ctx.get('permissionPresets');
5
+ }
6
+ /** Effective label for either an active session or the not-yet-created first one. */
7
+ export function effectivePermission(service, session, pending) {
8
+ return session === undefined ? pending ?? service.defaultPreset : service.current(session);
9
+ }
10
+ /** Validate a preset and write it only when a durable session already exists. */
11
+ export function selectPermission(service, session, preset) {
12
+ service.resolve(preset);
13
+ if (session !== undefined)
14
+ service.set(session, preset);
15
+ return preset;
16
+ }
17
+ /** Cycle table order from the active, pending, or configured-default value. */
18
+ export function cyclePermission(service, session, pending) {
19
+ if (service.names.length === 0)
20
+ return '';
21
+ const at = service.names.indexOf(effectivePermission(service, session, pending));
22
+ const next = service.names[(at + 1) % service.names.length] ?? '';
23
+ return next === '' ? '' : selectPermission(service, session, next);
24
+ }
25
+ /** Materialize a pre-session choice after Harness creates the first session. */
26
+ export function applyPendingPermission(service, session, pending) {
27
+ if (pending !== undefined && effectivePermission(service, session, undefined) !== pending) {
28
+ selectPermission(service, session, pending);
29
+ }
30
+ }
31
+ /**
32
+ * List every switchable preset for the /permission panel, table order kept.
33
+ * Description lookup failures degrade to an undocumented row, never a failed
34
+ * panel load — `optionOf` rejects names its table no longer knows.
35
+ */
36
+ export function listPermissionRows(service) {
37
+ return service.names.map((id) => {
38
+ try {
39
+ return { id, description: service.optionOf(id)?.description };
40
+ }
41
+ catch {
42
+ return { id };
43
+ }
44
+ });
45
+ }
@@ -0,0 +1,27 @@
1
+ /** Read-only projection of Cordis Loader entries for /plugin. */
2
+ const PHASES = {
3
+ 0: 'pending',
4
+ 1: 'loading',
5
+ 2: 'active',
6
+ 3: 'failed',
7
+ 4: null,
8
+ 5: 'unloading',
9
+ };
10
+ /** Snapshot the live Loader; group-only rows are composition containers, not plugins. */
11
+ export function listPluginRows(ctx) {
12
+ const loader = ctx.get('loader');
13
+ if (loader === undefined)
14
+ return [];
15
+ const rows = [];
16
+ for (const entry of loader.entries()) {
17
+ if (entry.options.group === true)
18
+ continue;
19
+ rows.push({
20
+ entryId: entry.id,
21
+ moduleName: entry.options.name,
22
+ enabled: !entry.disabled,
23
+ phase: entry.fiber === undefined ? null : PHASES[entry.fiber.state] ?? null,
24
+ });
25
+ }
26
+ return rows;
27
+ }
@@ -0,0 +1,46 @@
1
+ /** Agent-preset policy kept independent from the Ink surface. */
2
+ /** Read an optional Cordis service without requiring its package at build time. */
3
+ export function agentPresetsFrom(ctx) {
4
+ return ctx.get('agentPresets');
5
+ }
6
+ /** A preset may change only before the first durable turn begins. */
7
+ export function isBlankSession(events) {
8
+ return !events.some(event => event.type === 'turn/start');
9
+ }
10
+ /** Upstream renamed the shipped `code` preset to `ptc` in 0.1.2-rc.1; sessions
11
+ * and CLI choices recorded before the rename keep resolving through this map. */
12
+ const LEGACY_PRESET_IDS = { code: 'ptc' };
13
+ export function normalizePresetId(id) {
14
+ return id === undefined ? undefined : LEGACY_PRESET_IDS[id] ?? id;
15
+ }
16
+ /** Latest logged selection wins; legacy sessions deliberately fall back to standard. */
17
+ export function resolvePreset(session) {
18
+ const events = session.snapshotEvents();
19
+ for (let index = events.length - 1; index >= 0; index -= 1) {
20
+ const event = events[index];
21
+ if (event.type === 'agent-preset/selected' && event.data?.agentPreset !== undefined) {
22
+ return normalizePresetId(event.data.agentPreset);
23
+ }
24
+ }
25
+ return normalizePresetId(session.header.agentPreset) ?? 'standard';
26
+ }
27
+ /** Resolve a pre-session choice, or recompose an active blank Agent. */
28
+ export async function selectPreset(service, agent, presetId) {
29
+ presetId = normalizePresetId(presetId);
30
+ if (agent !== undefined)
31
+ return switchPreset(service, agent, presetId);
32
+ const preset = await service.resolve(presetId);
33
+ if (preset.broken !== undefined)
34
+ throw new Error(preset.broken);
35
+ return preset;
36
+ }
37
+ /** Recompose atomically from the caller's perspective, logging only success. */
38
+ export async function switchPreset(service, agent, presetId) {
39
+ if (!isBlankSession(agent.session.snapshotEvents())) {
40
+ throw new Error('mode is locked after the first turn; use /new <mode>');
41
+ }
42
+ const preset = await service.recompose(agent.ctx, presetId);
43
+ const writable = agent.session;
44
+ writable.append('agent-preset/selected', { agentPreset: preset.id });
45
+ return preset;
46
+ }