indusagi-coding-agent 0.1.61 → 0.2.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 (73) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/entry.js +11589 -14719
  3. package/dist/types/boot/contract.d.ts +2 -0
  4. package/dist/types/boot/runners/addon-wiring.d.ts +103 -0
  5. package/dist/types/boot/runners/addon-wiring.test.d.ts +19 -0
  6. package/dist/types/boot/runners/checkpoint.d.ts +133 -0
  7. package/dist/types/boot/runners/checkpoint.test.d.ts +12 -0
  8. package/dist/types/boot/runners/delegate-runner.d.ts +83 -0
  9. package/dist/types/boot/runners/delegate-runner.test.d.ts +13 -0
  10. package/dist/types/boot/runners/memdir.d.ts +103 -0
  11. package/dist/types/boot/runners/memdir.test.d.ts +12 -0
  12. package/dist/types/boot/runners/read-state.d.ts +82 -0
  13. package/dist/types/boot/runners/read-state.test.d.ts +10 -0
  14. package/dist/types/boot/runners/session.d.ts +37 -2
  15. package/dist/types/boot/runners/session.test.d.ts +10 -0
  16. package/dist/types/briefing/context-docs.d.ts +38 -0
  17. package/dist/types/briefing/context-docs.test.d.ts +18 -0
  18. package/dist/types/briefing/index.d.ts +2 -0
  19. package/dist/types/capability-deck/cards/index.d.ts +6 -0
  20. package/dist/types/capability-deck/cards/memory-card.d.ts +9 -10
  21. package/dist/types/capability-deck/cards/plan-file.d.ts +56 -0
  22. package/dist/types/capability-deck/cards/plan-tools.d.ts +97 -0
  23. package/dist/types/capability-deck/cards/plan-tools.test.d.ts +9 -0
  24. package/dist/types/capability-deck/checkpoint.int.test.d.ts +25 -0
  25. package/dist/types/capability-deck/index.d.ts +1 -1
  26. package/dist/types/capability-deck/read-edit-gate.int.test.d.ts +21 -0
  27. package/dist/types/conductor/bash-guard.d.ts +106 -0
  28. package/dist/types/conductor/bash-guard.test.d.ts +17 -0
  29. package/dist/types/conductor/conductor.d.ts +38 -6
  30. package/dist/types/conductor/contract.d.ts +221 -2
  31. package/dist/types/conductor/diagnostics.d.ts +183 -0
  32. package/dist/types/conductor/diagnostics.test.d.ts +10 -0
  33. package/dist/types/conductor/index.d.ts +4 -1
  34. package/dist/types/conductor/permission-gate.integration.test.d.ts +22 -0
  35. package/dist/types/conductor/permission-wiring.test.d.ts +14 -0
  36. package/dist/types/conductor/permissions.d.ts +217 -0
  37. package/dist/types/conductor/permissions.test.d.ts +12 -0
  38. package/dist/types/conductor/plan-mode.integration.test.d.ts +23 -0
  39. package/dist/types/conductor/post-edit-diagnostics.test.d.ts +13 -0
  40. package/dist/types/conductor/transcript-store/serialize.test.d.ts +10 -0
  41. package/dist/types/conductor/transcript-store/store.d.ts +18 -0
  42. package/dist/types/console/components/Banner.d.ts +28 -6
  43. package/dist/types/console/components/Emblem.d.ts +49 -0
  44. package/dist/types/console/components/StatusBar.d.ts +14 -3
  45. package/dist/types/console/components/WorkingIndicator.d.ts +44 -0
  46. package/dist/types/console/components/WorkingIndicator.test.d.ts +9 -0
  47. package/dist/types/console/components/banner-sweep.d.ts +55 -0
  48. package/dist/types/console/components/banner.test.d.ts +9 -0
  49. package/dist/types/console/contract.d.ts +41 -7
  50. package/dist/types/console/input/keymap.d.ts +10 -1
  51. package/dist/types/console/overlays/approval-queue.d.ts +71 -0
  52. package/dist/types/console/overlays/approval.d.ts +104 -0
  53. package/dist/types/console/overlays/approval.test.d.ts +17 -0
  54. package/dist/types/console/overlays/host.d.ts +4 -3
  55. package/dist/types/console/overlays/index.d.ts +2 -0
  56. package/dist/types/console/theme/adapter.d.ts +19 -0
  57. package/dist/types/console/theme/index.d.ts +1 -1
  58. package/dist/types/console/theme/palette.d.ts +25 -0
  59. package/dist/types/console/theme/tokens.d.ts +23 -1
  60. package/dist/types/index.d.ts +1 -1
  61. package/dist/types/launch/contract.d.ts +2 -0
  62. package/dist/types/launch/index.d.ts +1 -1
  63. package/dist/types/launch/oauth.d.ts +13 -0
  64. package/dist/types/settings/contract.d.ts +59 -0
  65. package/dist/types/settings/index.d.ts +2 -2
  66. package/dist/types/window-budget/condenser.d.ts +15 -1
  67. package/dist/types/window-budget/index.d.ts +3 -1
  68. package/dist/types/window-budget/microcompact.d.ts +68 -0
  69. package/dist/types/window-budget/microcompact.test.d.ts +16 -0
  70. package/dist/types/window-budget/rehydrate.d.ts +56 -0
  71. package/dist/types/workspace/brand.d.ts +6 -0
  72. package/dist/types/workspace/index.d.ts +1 -1
  73. package/package.json +2 -2
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Window-budget / rehydrate — re-attach recently-read files after a condense.
3
+ *
4
+ * A full {@link condense} folds the dropped head of the transcript into one
5
+ * summary message. That digest captures *what happened*, but it necessarily
6
+ * loses the verbatim bodies of files the agent had just read — and those bodies
7
+ * are often exactly the working context the next turn needs (the file it was
8
+ * mid-edit on, the config it was reasoning about). Re-reading them costs a tool
9
+ * round-trip and, worse, the model may not realize it needs to.
10
+ *
11
+ * **Post-compact rehydration** softens that cliff: after the slice is dropped,
12
+ * it scans the *dropped* messages for `read` results, takes the most-recent
13
+ * handful that aren't already visible in the kept tail, and re-attaches their
14
+ * bodies as synthetic user messages ("[Restored file after compaction] …") under
15
+ * a token budget. The model keeps its working files without a re-read, while the
16
+ * older surrounding chatter still gets compressed away.
17
+ *
18
+ * Shape note (this rebuild): a read's *body* lives in its own top-level
19
+ * {@link ToolResultMessage} (`role:'toolResult'`), and the read's *path* lives in
20
+ * the owning assistant `toolCall.arguments.path` (the read tool's arg is `path`,
21
+ * not `file_path`). We pair each dropped `read` call with its result by
22
+ * `toolCallId`, dedup against paths still visible in the kept tail, and emit the
23
+ * most-recent survivors under a token cap.
24
+ *
25
+ * Behavior-preserving by construction: returns an empty array whenever there is
26
+ * nothing to restore (no dropped reads, all already visible, or the budget is
27
+ * exhausted), so the caller can splice the result unconditionally.
28
+ */
29
+ import type { AgentMessage } from "./contract.js";
30
+ /** Prefix marking a synthetic message that restores a file body post-compaction. */
31
+ export declare const RESTORED_FILE_PREFIX = "[Restored file after compaction]";
32
+ /**
33
+ * Build the synthetic user messages that re-attach the most-recently-read files
34
+ * dropped by a condense.
35
+ *
36
+ * Scans `dropped` for `read` calls + result bodies, drops any path still visible
37
+ * in `kept`, sorts the survivors most-recent-first, takes up to `maxFiles`, and
38
+ * emits each as a `user` message of the form
39
+ * `"[Restored file after compaction] <path>\n<body>"` — stopping once the running
40
+ * token estimate would exceed `tokenBudget`. The returned messages are ordered
41
+ * oldest-restored-first so they read naturally when spliced after the summary.
42
+ *
43
+ * Returns an **empty array** when nothing is restorable, so the caller can splice
44
+ * the result unconditionally (`[summary, ...restored, ...kept]`).
45
+ *
46
+ * @param dropped the condensed-away head slice (original bodies, pre-summary)
47
+ * @param kept the verbatim tail that survives the condense
48
+ * @param opts.maxFiles cap on restored files (default {@link DEFAULT_MAX_FILES})
49
+ * @param opts.tokenBudget token ceiling for the restored block (default {@link DEFAULT_TOKEN_BUDGET})
50
+ * @param opts.readToolName wire name of the read tool (default `"read"`)
51
+ */
52
+ export declare function rehydrateRecentReads(dropped: AgentMessage[], kept: AgentMessage[], opts?: {
53
+ maxFiles?: number;
54
+ tokenBudget?: number;
55
+ readToolName?: string;
56
+ }): AgentMessage[];
@@ -18,3 +18,9 @@ import type { Brand } from "../boot/contract";
18
18
  * rather than a runtime surprise downstream.
19
19
  */
20
20
  export declare const BRAND: Brand;
21
+ /**
22
+ * The product version — printed by `--version` and shown on the startup banner.
23
+ * Single source of truth: bump this one line per release. Co-located with the
24
+ * brand so `boot` reads it without importing the index barrel.
25
+ */
26
+ export declare const VERSION = "0.2.0";
@@ -5,7 +5,7 @@
5
5
  * record, and the runtime/packaging detection. Boot stages depend on this
6
6
  * module rather than reaching into the individual files.
7
7
  */
8
- export { BRAND } from "./brand";
8
+ export { BRAND, VERSION } from "./brand";
9
9
  export { createWorkspace, ensureDirs, type WorkspaceOverrides, } from "./locator";
10
10
  export { isPackagedBinary, resolvePackageRoot, detectPackagingFromModuleUrl, type Packaging, } from "./runtime-detect";
11
11
  export type { Brand, Workspace } from "../boot/contract";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indusagi-coding-agent",
3
- "version": "0.1.61",
3
+ "version": "0.2.0",
4
4
  "description": "Indusagi coding agent — a terminal-first AI coding agent, built from scratch on the indusagi framework.",
5
5
  "author": "Varun Israni",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "@sinclair/typebox": "^0.34.49",
47
47
  "chalk": "^5.6.2",
48
48
  "highlight.js": "^11.11.1",
49
- "indusagi": "^0.12.33",
49
+ "indusagi": "^0.13.0",
50
50
  "ink": "^5.2.1",
51
51
  "jiti": "^2.7.0",
52
52
  "marked": "^18.0.4",