@astralyn/pi 0.82.4 → 0.82.6

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 (144) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/cli/project-trust.d.ts.map +1 -1
  3. package/dist/cli/project-trust.js +4 -1
  4. package/dist/cli/project-trust.js.map +1 -1
  5. package/dist/core/agent-session.d.ts.map +1 -1
  6. package/dist/core/agent-session.js +2 -2
  7. package/dist/core/agent-session.js.map +1 -1
  8. package/dist/core/bash-executor.d.ts.map +1 -1
  9. package/dist/core/bash-executor.js +4 -22
  10. package/dist/core/bash-executor.js.map +1 -1
  11. package/dist/core/extensions/index.d.ts +2 -2
  12. package/dist/core/extensions/index.d.ts.map +1 -1
  13. package/dist/core/extensions/index.js +1 -1
  14. package/dist/core/extensions/index.js.map +1 -1
  15. package/dist/core/extensions/loader.d.ts +1 -1
  16. package/dist/core/extensions/loader.d.ts.map +1 -1
  17. package/dist/core/extensions/loader.js +2 -3
  18. package/dist/core/extensions/loader.js.map +1 -1
  19. package/dist/core/extensions/types.d.ts +37 -5
  20. package/dist/core/extensions/types.d.ts.map +1 -1
  21. package/dist/core/extensions/types.js +11 -0
  22. package/dist/core/extensions/types.js.map +1 -1
  23. package/dist/core/tools/output-accumulator.d.ts +3 -13
  24. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  25. package/dist/core/tools/output-accumulator.js +6 -36
  26. package/dist/core/tools/output-accumulator.js.map +1 -1
  27. package/dist/extensions/plan/constants.d.ts +11 -2
  28. package/dist/extensions/plan/constants.d.ts.map +1 -1
  29. package/dist/extensions/plan/constants.js +14 -2
  30. package/dist/extensions/plan/constants.js.map +1 -1
  31. package/dist/extensions/plan/index.d.ts +0 -18
  32. package/dist/extensions/plan/index.d.ts.map +1 -1
  33. package/dist/extensions/plan/index.js +35 -3
  34. package/dist/extensions/plan/index.js.map +1 -1
  35. package/dist/extensions/plan/view.d.ts +36 -0
  36. package/dist/extensions/plan/view.d.ts.map +1 -0
  37. package/dist/extensions/plan/view.js +74 -0
  38. package/dist/extensions/plan/view.js.map +1 -0
  39. package/dist/extensions/question/dialog.d.ts +3 -1
  40. package/dist/extensions/question/dialog.d.ts.map +1 -1
  41. package/dist/extensions/question/dialog.js +106 -52
  42. package/dist/extensions/question/dialog.js.map +1 -1
  43. package/dist/extensions/question/index.d.ts.map +1 -1
  44. package/dist/extensions/question/index.js +2 -2
  45. package/dist/extensions/question/index.js.map +1 -1
  46. package/dist/extensions/question/render-cache.d.ts +9 -0
  47. package/dist/extensions/question/render-cache.d.ts.map +1 -1
  48. package/dist/extensions/question/render-cache.js +22 -0
  49. package/dist/extensions/question/render-cache.js.map +1 -1
  50. package/dist/extensions/question/results.d.ts.map +1 -1
  51. package/dist/extensions/question/results.js +6 -1
  52. package/dist/extensions/question/results.js.map +1 -1
  53. package/dist/extensions/question/schema.d.ts +4 -0
  54. package/dist/extensions/question/schema.d.ts.map +1 -1
  55. package/dist/extensions/question/schema.js +19 -28
  56. package/dist/extensions/question/schema.js.map +1 -1
  57. package/dist/extensions/question/types.d.ts +1 -1
  58. package/dist/extensions/question/types.d.ts.map +1 -1
  59. package/dist/extensions/question/types.js.map +1 -1
  60. package/dist/extensions/router/stream.d.ts.map +1 -1
  61. package/dist/extensions/router/stream.js +44 -0
  62. package/dist/extensions/router/stream.js.map +1 -1
  63. package/dist/extensions/subagent/activity.d.ts.map +1 -1
  64. package/dist/extensions/subagent/activity.js +25 -4
  65. package/dist/extensions/subagent/activity.js.map +1 -1
  66. package/dist/extensions/subagent/agents.d.ts.map +1 -1
  67. package/dist/extensions/subagent/agents.js +12 -6
  68. package/dist/extensions/subagent/agents.js.map +1 -1
  69. package/dist/extensions/subagent/constants.d.ts +1 -1
  70. package/dist/extensions/subagent/constants.d.ts.map +1 -1
  71. package/dist/extensions/subagent/constants.js +3 -2
  72. package/dist/extensions/subagent/constants.js.map +1 -1
  73. package/dist/extensions/subagent/index.d.ts.map +1 -1
  74. package/dist/extensions/subagent/index.js +14 -0
  75. package/dist/extensions/subagent/index.js.map +1 -1
  76. package/dist/extensions/subagent/render.d.ts.map +1 -1
  77. package/dist/extensions/subagent/render.js +243 -116
  78. package/dist/extensions/subagent/render.js.map +1 -1
  79. package/dist/extensions/subagent/resolve.d.ts.map +1 -1
  80. package/dist/extensions/subagent/resolve.js +13 -9
  81. package/dist/extensions/subagent/resolve.js.map +1 -1
  82. package/dist/extensions/subagent/runner.d.ts +1 -1
  83. package/dist/extensions/subagent/runner.d.ts.map +1 -1
  84. package/dist/extensions/subagent/runner.js +9 -3
  85. package/dist/extensions/subagent/runner.js.map +1 -1
  86. package/dist/extensions/subagent/schema.d.ts.map +1 -1
  87. package/dist/extensions/subagent/schema.js +4 -4
  88. package/dist/extensions/subagent/schema.js.map +1 -1
  89. package/dist/extensions/subagent/sdk-runner.d.ts.map +1 -1
  90. package/dist/extensions/subagent/sdk-runner.js +5 -0
  91. package/dist/extensions/subagent/sdk-runner.js.map +1 -1
  92. package/dist/extensions/subagent/types.d.ts +7 -0
  93. package/dist/extensions/subagent/types.d.ts.map +1 -1
  94. package/dist/extensions/subagent/types.js.map +1 -1
  95. package/dist/extensions/todo/constants.d.ts +17 -6
  96. package/dist/extensions/todo/constants.d.ts.map +1 -1
  97. package/dist/extensions/todo/constants.js +47 -9
  98. package/dist/extensions/todo/constants.js.map +1 -1
  99. package/dist/extensions/todo/index.d.ts +1 -15
  100. package/dist/extensions/todo/index.d.ts.map +1 -1
  101. package/dist/extensions/todo/index.js +35 -4
  102. package/dist/extensions/todo/index.js.map +1 -1
  103. package/dist/extensions/todo/schema.d.ts +59 -7
  104. package/dist/extensions/todo/schema.d.ts.map +1 -1
  105. package/dist/extensions/todo/schema.js +72 -12
  106. package/dist/extensions/todo/schema.js.map +1 -1
  107. package/dist/extensions/todo/state.d.ts +20 -5
  108. package/dist/extensions/todo/state.d.ts.map +1 -1
  109. package/dist/extensions/todo/state.js +1016 -134
  110. package/dist/extensions/todo/state.js.map +1 -1
  111. package/dist/extensions/todo/view.d.ts +16 -1
  112. package/dist/extensions/todo/view.d.ts.map +1 -1
  113. package/dist/extensions/todo/view.js +293 -7
  114. package/dist/extensions/todo/view.js.map +1 -1
  115. package/dist/modes/interactive/components/extension-selector.d.ts +6 -1
  116. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  117. package/dist/modes/interactive/components/extension-selector.js +14 -6
  118. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  119. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  120. package/dist/modes/interactive/components/tool-execution.js +6 -0
  121. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  122. package/dist/modes/interactive/interactive-mode.d.ts +2 -0
  123. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  124. package/dist/modes/interactive/interactive-mode.js +41 -2
  125. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  126. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  127. package/dist/modes/rpc/rpc-mode.js +8 -1
  128. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  129. package/dist/utils/coalescing-terminal.d.ts +71 -17
  130. package/dist/utils/coalescing-terminal.d.ts.map +1 -1
  131. package/dist/utils/coalescing-terminal.js +136 -31
  132. package/dist/utils/coalescing-terminal.js.map +1 -1
  133. package/docs/bundled/extensions/plan.md +6 -4
  134. package/docs/bundled/extensions/question.md +9 -7
  135. package/docs/bundled/extensions/subagent.md +4 -4
  136. package/docs/bundled/extensions/todo.md +9 -5
  137. package/docs/bundled/tool-presentation.md +1 -1
  138. package/docs/extensions.md +14 -0
  139. package/npm-shrinkwrap.json +2 -2
  140. package/package.json +1 -1
  141. package/dist/utils/output-decoder.d.ts +0 -52
  142. package/dist/utils/output-decoder.d.ts.map +0 -1
  143. package/dist/utils/output-decoder.js +0 -134
  144. package/dist/utils/output-decoder.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,58 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.82.6] - 2026-07-27
6
+
7
+ ### Added
8
+
9
+ - The bundled `todo` tool now supports atomic `create_many` planning batches (up to 20 tasks) with stable batch keys and intra-batch dependencies, paged/searchable/unblocked `list` queries, and bounded nested JSON metadata. Task snapshots are schema-versioned and defensively replayed, so malformed latest history falls back to the last valid snapshot. `clear` now requires `confirm: true` plus the current `expectedCount`; an active task that gains an unresolved dependency automatically returns to `pending`.
10
+
11
+ - Select dialogs can now carry a second layer of information: `ctx.ui.select()` accepts `{ label, description }` options, rendering the description as a muted line under the label so the action and its trade-off can be scanned separately, and takes `subtitle` (a muted line under the title, for context that is not itself a choice) and `cancelHint` (wording for the dismiss hint, for dialogs where `Esc` is not destructive). Plain `string[]` options still work, and `select()` still resolves to the chosen label. RPC clients receive labels only, so the wire protocol is unchanged. See [extensions](docs/extensions.md).
12
+
13
+ ### Changed
14
+
15
+ - Returned bash output decoding to the reviewed upstream UTF-8-only streaming `TextDecoder`, removing the distribution-specific OEM-code-page fallback and per-line buffering. Legacy Windows console programs that emit non-UTF-8 bytes now follow upstream behavior and may render replacement characters.
16
+
17
+ - Collapsed `todo` groups now summarize completed operations — created IDs, status updates, list counts, deletion, and clearing — instead of hiding their results; failed rows include a sanitized 120-character reason, and `ctrl+o` still reveals full calls and results. See [todo](docs/bundled/extensions/todo.md).
18
+
19
+ - Redesigned the `exit_plan` approval dialog and tool row. The three choices now separate the decision from its trade-off (`Start executing` / *keep full context*) instead of burying it in a parenthetical, the dialog subtitle reports current context usage — the fact the compact-or-not decision actually turns on — and the dismiss hint reads "keep planning" rather than "cancel", matching what `Esc` has always done. The tool row no longer echoes the plan: a collapsed call shows `exit_plan <title>` (plan body on `ctrl+o`) instead of the whole markdown document escaped onto one line, and the result shows where the plan landed plus what happens next, instead of the mode-precedence text written for the model. See [plan](docs/bundled/extensions/plan.md).
20
+ - The plan-mode footer marker now reads `Plan Mode` in the theme's accent color rather than a `plan` tag in warning yellow — plan mode is a working mode, not a warning state.
21
+ - Consecutive `todo` calls now collapse into one grouped run like `read`/`find`'s `explore` group, and each call renders as a single headline (`todo create <subject>`, `todo update #2 in_progress`) instead of a raw argument dump. `ctrl+o` expands the group back to full calls, where the headline is followed by the parameters the result never echoes (`description`, `activeForm`, dependency edges). See [tool presentation](docs/bundled/tool-presentation.md).
22
+ - Redesigned the subagent transcript around a deep-trimmed collapsed card and a report-cover-sheet expanded view. Collapsed: a running single delegation folds to at most three lines — the intent line now carries tool uses, the `ctx:` watermark, cost, and elapsed time — and a settled card ends with one `tok · tool uses · ctx · $ · duration` metrics line; parallel batches drop the cross-run activity digest, gain stable dim ordinals on run rows (matching the expanded section numbers, immune to active-first reordering), and settle to a `tok · $ · duration` footer. Live lines never quote token totals, which are cache-inflated mid-run. Expanded (`ctrl+o`): each run renders a status line (`✓ Completed · model · thinking`), a metrics line, a fixed two-line `Prompt` preview with honest continuation notes (`… continues, N more lines · capped at 1KB`), an `Activity · last n of N` digest whose successful rows are quiet one-liners (glyphs only for failures and the in-flight row, durations only at ten seconds or longer), a `Working` tail of the last three live lines while streaming, and the full `Report` (or `Error`, with `Report · partial` for salvaged output) rendered as Markdown — replacing the full prompt echo, the glyphed activity dump, and the trailing metadata line. See [subagent](docs/bundled/extensions/subagent.md).
23
+ - The subagent tool now accepts an absolute task `cwd` that stays inside the parent working directory — models routinely echo the parent cwd back verbatim — instead of failing the task over path style; escapes are still rejected.
24
+
25
+ ### Fixed
26
+
27
+ - Fixed the `router` relay rejecting multi-turn GPT conversations on Codex-adapted gateways with `input[i].status: unknown_parameter`. pi-ai replays history per the OpenAI Platform schema — assistant messages carry a hardcoded `status: "completed"`, reasoning items are replayed verbatim from `output_item.done` (which includes `status`), and `output_text` blocks carry `annotations: []` — but Codex CLI's `ResponseItem` serialization emits none of these, so gateways that validate against the Codex schema 400. The relay payload reshape now strips `status` from exactly the item types whose Codex serialization has no such field (`message`, `reasoning`, `function_call`, `function_call_output`, `custom_tool_call_output` — it is required on `local_shell_call`/`tool_search_output` and optional elsewhere, so those keep it), drops `annotations` from `output_text` content, and deletes the pi-specific `prompt_cache_options` request field alongside the other Platform-only fields.
28
+ - Fixed the subagent live tail freezing into a lone `…` once a worker streamed more than 1KB of text: bounded details now keep the newest `liveText` via tail-bounding instead of head-bounding, and the renderer skips truncation-notice lines outright, in both the collapsed tail line and the expanded `Working` section.
29
+ - Fixed the expanded parallel batch trailer quoting the cache-inflated aggregate token total while runs were still in flight; the trailer now omits `tok` until the batch settles, matching every other live line.
30
+ - Fixed the subagent card sitting empty while first-use model-runtime creation or task resolution stalled: the tool now paints `Initializing…` before its first await.
31
+ - Transcript excerpt scrubbing now also covers `boundText`'s minimal `[Output truncated.]` notice, and a worker running with `thinking: off` no longer renders a bare `off` segment in expanded batch metrics.
32
+
33
+ ## [0.82.5] - 2026-07-26
34
+
35
+ ### Added
36
+
37
+ - Added digit quick-select to the `question` tool dialog: pressing `1`–`9` jumps to the numbered option — selecting it in single-select, toggling it in multi-select — and the custom-answer row's number opens its input. See [question](docs/bundled/extensions/question.md).
38
+ - Added reverse dependency edges to the `todo` tool: `addBlocks`/`removeBlocks` on `update` let one call mark the tasks that must wait for the current one, with the same existence, tombstone, and cycle validation as `addBlockedBy`. See [todo](docs/bundled/extensions/todo.md).
39
+
40
+ ### Changed
41
+
42
+ - Gave the built-in `explorer` subagent profile read-only shell access: `bash` joins its toolset for inspection commands (`git log`/`blame`/`diff`, `wc`, `head`), with the system prompt pinning it to read-only use — no redirect (`>`, `>>`) or heredoc writes, no temp files, no git commands that write (add, commit, checkout, restore, stash, clean), no installs, no network. Explorer also skips loading `AGENTS.md`/`CLAUDE.md` project instructions, which read-only exploration doesn't need — the parent interprets its results. See [subagent](docs/bundled/extensions/subagent.md).
43
+ - Rewrote the subagent tool's model-facing guidance. The description now leads with why to delegate — keeping intermediate tool output (file dumps, search results) out of the parent's context — states explicitly that reports are not shown to the user and must be relayed, names the task and concurrency limits (8 per call, 5 concurrent), advises direct tools for directed lookups and delegation for investigations that would clearly take more than ~3 searches, distinguishes lookup briefings (hand over the exact command) from investigation briefings (hand over the question), suggests bounding answer length, and carries an example explorer briefing. The `general` profile description now states when to choose it over `explorer`, workers are told only their final message is returned and to quote code only when the exact text is load-bearing, and the briefing `prompt` limit rose from 20,000 to 50,000 characters to leave room for pasted context. See [subagent](docs/bundled/extensions/subagent.md).
44
+ - Tightened `question` tool validation: option previews on multi-select questions are now rejected with an explicit `preview_multiselect` error instead of being silently dropped, reserved-label and duplicate checks compare case-insensitively and ignore surrounding whitespace, the unused `Next` label is no longer reserved, and length/count checks that duplicated the JSON schema (already enforced before the tool executes) were removed. Preview markdown rendering is also memoized, so editor keystrokes no longer re-parse previews.
45
+ - Tightened `todo` tool validation and model-facing output: parameters that do not apply to the chosen action are rejected with guidance instead of being silently ignored (`blockedBy` on `update` now points at `addBlockedBy`/`removeBlockedBy`), `create` requires a `description` stating what done means, id parameters must be positive integers at the schema level, an empty string clears `description`/`activeForm`/`owner`, a deletion cannot be combined with other edits and reports which pending dependents became fully unblocked, `list` lines show only unresolved blockers plus the task's owner, and the truncation notice no longer suggests a status filter that is already applied. The tool description was restructured into sectioned guidance (when to use, status workflow, examples) with explicit blocked-task handling: create a task for the blocker and link it with `addBlockedBy` instead of faking completion. See [todo](docs/bundled/extensions/todo.md).
46
+
47
+ ### Fixed
48
+
49
+ - Fixed a parallel subagent batch being reported as a failed tool call when only some of its tasks failed. The result is now an error only when no task completed; partial batches surface per-task status in the report sections instead of pushing the parent to retry work that already succeeded.
50
+ - Fixed the `todo` extension's stale-context guard being unreachable: lifecycle replay accessed `ctx.sessionManager` before entering its try block, so the error it meant to swallow after a session replacement raced ahead of the guard. The condition is now detected with the new `isStaleExtensionContextError` predicate (exported alongside `STALE_EXTENSION_CONTEXT_MESSAGE` from the extension API) instead of message-text matching.
51
+ - Fixed the `question` tool ignoring turn aborts: the dialog now closes when the tool call is cancelled and resolves with the answers given so far, instead of lingering until the next interaction.
52
+ - Fixed cancelling the `question` dialog discarding answers already given; the model-facing result now lists them as partial answers, matching the `Chat about this` flow.
53
+ - Fixed `question` dialog interaction papercuts: `Tab` on an unselected single-select option no longer silently commits it when the note editor is cancelled (`Esc` restores the previous selection), and Enter on the `Type something.` row of a multi-select question opens the custom-answer input instead of warning that nothing is selected.
54
+ - Fixed tool output expanded with `ctrl+o` losing its top lines (for example an expanded subagent card's header, task, and activity sections) when the expansion pushed the transcript past the screen height. The scrollback-preserving full-redraw rewrite introduced in 0.82.4 repainted only the bottom screenful, so lines newly pushed above the viewport were never written anywhere.
55
+ - Scoped the 0.82.4 scrollback-preserving redraw rewrite to the window where it matters: from `agent_start` until the user's next input after the run settles, so streaming markdown reflow can no longer yank a scrolled-up reader while text is arriving — including the run's trailing reflow frames. Within that window, redraws that grow the transcript repaint the visible rows in place and scroll the extra lines in at the bottom row, pushing exactly the right rows — already bearing the new content — into scrollback, and explicit toggles (`ctrl+o`/`ctrl+t`) exempt their own frame. Everywhere else — idle sessions, toggles, mode switches — full redraws keep upstream's wipe-and-replay, leaving scrollback as the clean current transcript with no stale seams or per-toggle residue.
56
+
5
57
  ## [0.82.4] - 2026-07-26
6
58
 
7
59
  ### Added
@@ -1 +1 @@
1
- {"version":3,"file":"project-trust.d.ts","sourceRoot":"","sources":["../../src/cli/project-trust.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,eAAe,CAAC;IACjC,KAAK,EAAE,OAAO,CAAC;CACf,GAAG,mBAAmB,CAkDtB","sourcesContent":["import chalk from \"chalk\";\nimport type { ProjectTrustContext } from \"../core/extensions/types.ts\";\nimport type { AppMode } from \"../core/project-trust.ts\";\nimport type { SettingsManager } from \"../core/settings-manager.ts\";\nimport { showStartupInput, showStartupSelector } from \"./startup-ui.ts\";\n\nexport function createProjectTrustContext(options: {\n\tcwd: string;\n\tmode: AppMode;\n\tsettingsManager: SettingsManager;\n\thasUI: boolean;\n}): ProjectTrustContext {\n\treturn {\n\t\tcwd: options.cwd,\n\t\tmode: options.mode === \"interactive\" ? \"tui\" : options.mode,\n\t\thasUI: options.hasUI,\n\t\tui: {\n\t\t\tselect: async (title, selectOptions) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn showStartupSelector(\n\t\t\t\t\toptions.settingsManager,\n\t\t\t\t\ttitle,\n\t\t\t\t\tselectOptions.map((option) => ({ label: option, value: option })),\n\t\t\t\t);\n\t\t\t},\n\t\t\tconfirm: async (title, message) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t(await showStartupSelector(options.settingsManager, `${title}\\n${message}`, [\n\t\t\t\t\t\t{ label: \"Yes\", value: true },\n\t\t\t\t\t\t{ label: \"No\", value: false },\n\t\t\t\t\t])) ?? false\n\t\t\t\t);\n\t\t\t},\n\t\t\tinput: async (title, placeholder) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn showStartupInput(options.settingsManager, title, placeholder);\n\t\t\t},\n\t\t\tnotify: (message, type = \"info\") => {\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\tconst color = type === \"error\" ? chalk.red : type === \"warning\" ? chalk.yellow : chalk.cyan;\n\t\t\t\t\tconsole.error(color(message));\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t};\n}\n"]}
1
+ {"version":3,"file":"project-trust.d.ts","sourceRoot":"","sources":["../../src/cli/project-trust.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,eAAe,CAAC;IACjC,KAAK,EAAE,OAAO,CAAC;CACf,GAAG,mBAAmB,CAqDtB","sourcesContent":["import chalk from \"chalk\";\nimport type { ProjectTrustContext } from \"../core/extensions/types.ts\";\nimport type { AppMode } from \"../core/project-trust.ts\";\nimport type { SettingsManager } from \"../core/settings-manager.ts\";\nimport { showStartupInput, showStartupSelector } from \"./startup-ui.ts\";\n\nexport function createProjectTrustContext(options: {\n\tcwd: string;\n\tmode: AppMode;\n\tsettingsManager: SettingsManager;\n\thasUI: boolean;\n}): ProjectTrustContext {\n\treturn {\n\t\tcwd: options.cwd,\n\t\tmode: options.mode === \"interactive\" ? \"tui\" : options.mode,\n\t\thasUI: options.hasUI,\n\t\tui: {\n\t\t\tselect: async (title, selectOptions) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn showStartupSelector(\n\t\t\t\t\toptions.settingsManager,\n\t\t\t\t\ttitle,\n\t\t\t\t\tselectOptions.map((option) => {\n\t\t\t\t\t\tconst label = typeof option === \"string\" ? option : option.label;\n\t\t\t\t\t\treturn { label, value: label };\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t\t\tconfirm: async (title, message) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t(await showStartupSelector(options.settingsManager, `${title}\\n${message}`, [\n\t\t\t\t\t\t{ label: \"Yes\", value: true },\n\t\t\t\t\t\t{ label: \"No\", value: false },\n\t\t\t\t\t])) ?? false\n\t\t\t\t);\n\t\t\t},\n\t\t\tinput: async (title, placeholder) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn showStartupInput(options.settingsManager, title, placeholder);\n\t\t\t},\n\t\t\tnotify: (message, type = \"info\") => {\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\tconst color = type === \"error\" ? chalk.red : type === \"warning\" ? chalk.yellow : chalk.cyan;\n\t\t\t\t\tconsole.error(color(message));\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t};\n}\n"]}
@@ -13,7 +13,10 @@ export function createProjectTrustContext(options) {
13
13
  if (options.mode !== "interactive") {
14
14
  return undefined;
15
15
  }
16
- return showStartupSelector(options.settingsManager, title, selectOptions.map((option) => ({ label: option, value: option })));
16
+ return showStartupSelector(options.settingsManager, title, selectOptions.map((option) => {
17
+ const label = typeof option === "string" ? option : option.label;
18
+ return { label, value: label };
19
+ }));
17
20
  },
18
21
  confirm: async (title, message) => {
19
22
  if (!options.hasUI) {
@@ -1 +1 @@
1
- {"version":3,"file":"project-trust.js","sourceRoot":"","sources":["../../src/cli/project-trust.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,gBAAgB,EAAE,m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,CAAC,IAAI,KAAK,CACZ,CAAC;YAAA,CACF;YACD,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC;gBACpC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;oBACpB,OAAO,SAAS,CAAC;gBAClB,CAAC;gBACD,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;oBACpC,OAAO,SAAS,CAAC;gBAClB,CAAC;gBACD,OAAO,gBAAgB,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;YAAA,CACrE;YACD,MAAM,EAAE,CAAC,OAAO,EAAE,IAAI,GAAG,MAAM,EAAE,EAAE,CAAC;gBACnC,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;oBACpC,MAAM,KAAK,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;oBAC5F,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC/B,CAAC;YAAA,CACD;SACD;KACD,CAAC;AAAA,CACF","sourcesContent":["import chalk from \"chalk\";\nimport type { ProjectTrustContext } from \"../core/extensions/types.ts\";\nimport type { AppMode } from \"../core/project-trust.ts\";\nimport type { SettingsManager } from \"../core/settings-manager.ts\";\nimport { showStartupInput, showStartupSelector } from \"./startup-ui.ts\";\n\nexport function createProjectTrustContext(options: {\n\tcwd: string;\n\tmode: AppMode;\n\tsettingsManager: SettingsManager;\n\thasUI: boolean;\n}): ProjectTrustContext {\n\treturn {\n\t\tcwd: options.cwd,\n\t\tmode: options.mode === \"interactive\" ? \"tui\" : options.mode,\n\t\thasUI: options.hasUI,\n\t\tui: {\n\t\t\tselect: async (title, selectOptions) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn showStartupSelector(\n\t\t\t\t\toptions.settingsManager,\n\t\t\t\t\ttitle,\n\t\t\t\t\tselectOptions.map((option) => ({ label: option, value: option })),\n\t\t\t\t);\n\t\t\t},\n\t\t\tconfirm: async (title, message) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t(await showStartupSelector(options.settingsManager, `${title}\\n${message}`, [\n\t\t\t\t\t\t{ label: \"Yes\", value: true },\n\t\t\t\t\t\t{ label: \"No\", value: false },\n\t\t\t\t\t])) ?? false\n\t\t\t\t);\n\t\t\t},\n\t\t\tinput: async (title, placeholder) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn showStartupInput(options.settingsManager, title, placeholder);\n\t\t\t},\n\t\t\tnotify: (message, type = \"info\") => {\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\tconst color = type === \"error\" ? chalk.red : type === \"warning\" ? chalk.yellow : chalk.cyan;\n\t\t\t\t\tconsole.error(color(message));\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t};\n}\n"]}
1
+ {"version":3,"file":"project-trust.js","sourceRoot":"","sources":["../../src/cli/project-trust.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,UAAU,yBAAyB,CAAC,OAKzC,EAAuB;IACvB,OAAO;QACN,GA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,KAAK,EAAE;iBAC7B,CAAC,CAAC,IAAI,KAAK,CACZ,CAAC;YAAA,CACF;YACD,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC;gBACpC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;oBACpB,OAAO,SAAS,CAAC;gBAClB,CAAC;gBACD,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;oBACpC,OAAO,SAAS,CAAC;gBAClB,CAAC;gBACD,OAAO,gBAAgB,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;YAAA,CACrE;YACD,MAAM,EAAE,CAAC,OAAO,EAAE,IAAI,GAAG,MAAM,EAAE,EAAE,CAAC;gBACnC,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;oBACpC,MAAM,KAAK,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;oBAC5F,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC/B,CAAC;YAAA,CACD;SACD;KACD,CAAC;AAAA,CACF","sourcesContent":["import chalk from \"chalk\";\nimport type { ProjectTrustContext } from \"../core/extensions/types.ts\";\nimport type { AppMode } from \"../core/project-trust.ts\";\nimport type { SettingsManager } from \"../core/settings-manager.ts\";\nimport { showStartupInput, showStartupSelector } from \"./startup-ui.ts\";\n\nexport function createProjectTrustContext(options: {\n\tcwd: string;\n\tmode: AppMode;\n\tsettingsManager: SettingsManager;\n\thasUI: boolean;\n}): ProjectTrustContext {\n\treturn {\n\t\tcwd: options.cwd,\n\t\tmode: options.mode === \"interactive\" ? \"tui\" : options.mode,\n\t\thasUI: options.hasUI,\n\t\tui: {\n\t\t\tselect: async (title, selectOptions) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn showStartupSelector(\n\t\t\t\t\toptions.settingsManager,\n\t\t\t\t\ttitle,\n\t\t\t\t\tselectOptions.map((option) => {\n\t\t\t\t\t\tconst label = typeof option === \"string\" ? option : option.label;\n\t\t\t\t\t\treturn { label, value: label };\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t\t\tconfirm: async (title, message) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t(await showStartupSelector(options.settingsManager, `${title}\\n${message}`, [\n\t\t\t\t\t\t{ label: \"Yes\", value: true },\n\t\t\t\t\t\t{ label: \"No\", value: false },\n\t\t\t\t\t])) ?? false\n\t\t\t\t);\n\t\t\t},\n\t\t\tinput: async (title, placeholder) => {\n\t\t\t\tif (!options.hasUI) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn showStartupInput(options.settingsManager, title, placeholder);\n\t\t\t},\n\t\t\tnotify: (message, type = \"info\") => {\n\t\t\t\tif (options.mode !== \"interactive\") {\n\t\t\t\t\tconst color = type === \"error\" ? chalk.red : type === \"warning\" ? chalk.yellow : chalk.cyan;\n\t\t\t\t\tconsole.error(color(message));\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t};\n}\n"]}