minicode-ai 0.13.1 → 0.14.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 (82) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +21 -21
  3. package/README.md +4 -0
  4. package/cli/args.ts +50 -2
  5. package/cli/commands/acp.ts +18 -3
  6. package/cli/commands/daemon.ts +114 -19
  7. package/cli/commands/exec.ts +95 -7
  8. package/cli/commands/mcp.ts +66 -5
  9. package/cli/commands/memory.ts +46 -14
  10. package/cli/commands.ts +5 -0
  11. package/cli/index.ts +30 -5
  12. package/cli/setup.ts +365 -24
  13. package/cli/tui.ts +72 -27
  14. package/docs/TERMINAL_CONTRACT.md +91 -24
  15. package/docs/agents.md +2 -2
  16. package/docs/cli.md +1 -0
  17. package/docs/environment.md +1 -0
  18. package/docs/memory-sessions.md +5 -0
  19. package/package.json +2 -1
  20. package/src/app/session.ts +153 -35
  21. package/src/app/tool-layer.ts +67 -61
  22. package/src/daemon/approvals.ts +25 -1
  23. package/src/daemon/client.ts +51 -1
  24. package/src/daemon/control.ts +8 -0
  25. package/src/daemon/protocol.ts +47 -1
  26. package/src/daemon/server.ts +45 -9
  27. package/src/daemon/subscription.ts +25 -1
  28. package/src/daemon/telemetry.ts +4 -0
  29. package/src/hooks/run.ts +5 -1
  30. package/src/mcp/client.ts +349 -90
  31. package/src/mcp/http-transport.ts +7 -0
  32. package/src/mcp/transport.ts +5 -0
  33. package/src/memory/files.ts +69 -3
  34. package/src/memory/vector.ts +556 -160
  35. package/src/policy/approval-binding.ts +199 -0
  36. package/src/policy/context.ts +20 -1
  37. package/src/policy/executor.ts +44 -5
  38. package/src/policy/permission.ts +243 -26
  39. package/src/policy/tool-contract.ts +77 -0
  40. package/src/policy/usage.ts +3 -1
  41. package/src/policy/work-mode.ts +49 -1
  42. package/src/presentation/adapter.ts +157 -7
  43. package/src/presentation/events.ts +173 -1
  44. package/src/presentation/model.ts +37 -0
  45. package/src/presentation/projection.ts +107 -18
  46. package/src/presentation/reducer.ts +134 -10
  47. package/src/sandbox/os.ts +18 -1
  48. package/src/session/persistence.ts +153 -11
  49. package/src/task/store.ts +43 -3
  50. package/src/tools/memory.ts +70 -10
  51. package/src/tools/task.ts +7 -1
  52. package/src/tools/todo.ts +14 -4
  53. package/src/ui/approval/prompt.ts +52 -7
  54. package/src/ui/assistant/simple.ts +160 -57
  55. package/src/ui/contract.ts +46 -0
  56. package/src/ui/footer.ts +14 -5
  57. package/src/ui/i18n/en.ts +9 -0
  58. package/src/ui/i18n/id.ts +9 -0
  59. package/src/ui/render/collapse.ts +24 -52
  60. package/src/ui/render/detail.ts +14 -9
  61. package/src/ui/render/errors.ts +8 -0
  62. package/src/ui/render/reasoning.ts +13 -8
  63. package/src/ui/session-state.ts +243 -0
  64. package/src/ui/tui/app.ts +7 -3
  65. package/src/ui/tui/transcript.ts +271 -30
  66. package/vendor/minicore/src/core/budget.ts +25 -25
  67. package/vendor/minicore/src/core/compact.ts +75 -75
  68. package/vendor/minicore/src/core/errors.ts +59 -59
  69. package/vendor/minicore/src/core/events.ts +73 -73
  70. package/vendor/minicore/src/core/executor.ts +139 -139
  71. package/vendor/minicore/src/core/history.ts +31 -31
  72. package/vendor/minicore/src/core/index.ts +41 -41
  73. package/vendor/minicore/src/core/loop.ts +355 -355
  74. package/vendor/minicore/src/core/permission.ts +22 -22
  75. package/vendor/minicore/src/core/provider.ts +39 -39
  76. package/vendor/minicore/src/core/recovery.ts +35 -35
  77. package/vendor/minicore/src/core/session.ts +327 -327
  78. package/vendor/minicore/src/core/snapshot.ts +146 -146
  79. package/vendor/minicore/src/core/tokens.ts +107 -107
  80. package/vendor/minicore/src/core/tool.ts +115 -115
  81. package/vendor/minicore/src/core/types.ts +50 -50
  82. package/vendor/minicore/src/providers/openai-compat.ts +417 -417
@@ -1,42 +1,42 @@
1
- // MiniCore — public surface. Everything the kernel exposes intentionally.
2
- // Providers, tools, memory, UI, and storage live outside this file.
3
-
4
- export type { Message, UserMessage, AssistantMessage, ToolResult, ToolCall, Content, ContentPart } from "./types.ts";
5
- export { AgentError, ProviderError, abortError } from "./errors.ts";
6
- export type { AgentErrorKind, ProviderErrorCategory, RecoveryAction } from "./errors.ts";
7
- export type { ModelProvider, StreamRequest, ProviderEvent, FinishReason } from "./provider.ts";
8
- export type { Tool, ToolSchema, JSONSchema, ToolContext, ToolRegistry, ArgsResult } from "./tool.ts";
9
- export { validateArgs, createToolRegistry } from "./tool.ts";
10
- export type { ToolExecutor, ExecutorDeps } from "./executor.ts";
11
- export { runCall, sequentialExecutor } from "./executor.ts";
12
- export type { PermissionHandler, Decision } from "./permission.ts";
13
- export type { TokenEstimator } from "./tokens.ts";
14
- export {
15
- defaultTokenEstimator,
16
- estimateImageTokens,
17
- estimateMessage,
18
- estimateMessages,
19
- estimateTools,
20
- estimateSystem,
21
- estimateSessionContext,
22
- contentToText,
23
- DEFAULT_CHARS_PER_TOKEN,
24
- } from "./tokens.ts";
25
- export type { BudgetPolicy, BudgetState, PressureLevel } from "./budget.ts";
26
- export { defaultBudgetPolicy } from "./budget.ts";
27
- export type { CompactionStrategy } from "./compact.ts";
28
- export { mechanicalCompaction } from "./compact.ts";
29
- export type { RecoveryPolicy } from "./recovery.ts";
30
- export { defaultRecoveryPolicy, maxProviderRetries } from "./recovery.ts";
31
- export type { AgentEvent, AgentEventType, EventBus, EventBusOptions } from "./events.ts";
32
- export { createEventBus } from "./events.ts";
33
- export { ContextStore } from "./history.ts";
34
- export type { Session, SessionConfig, SessionState, TurnResult, Step, Execution } from "./session.ts";
35
- export {
36
- createSession,
37
- DEFAULT_MAX_STEPS,
38
- DEFAULT_CONTEXT_WINDOW_TOKENS,
39
- DEFAULT_TOOL_RESULT_MAX_TOKENS,
40
- DEFAULT_KEEP_RECENT_TURNS,
41
- DEFAULT_TIMEOUT_MS,
1
+ // MiniCore — public surface. Everything the kernel exposes intentionally.
2
+ // Providers, tools, memory, UI, and storage live outside this file.
3
+
4
+ export type { Message, UserMessage, AssistantMessage, ToolResult, ToolCall, Content, ContentPart } from "./types.ts";
5
+ export { AgentError, ProviderError, abortError } from "./errors.ts";
6
+ export type { AgentErrorKind, ProviderErrorCategory, RecoveryAction } from "./errors.ts";
7
+ export type { ModelProvider, StreamRequest, ProviderEvent, FinishReason } from "./provider.ts";
8
+ export type { Tool, ToolSchema, JSONSchema, ToolContext, ToolRegistry, ArgsResult } from "./tool.ts";
9
+ export { validateArgs, createToolRegistry } from "./tool.ts";
10
+ export type { ToolExecutor, ExecutorDeps } from "./executor.ts";
11
+ export { runCall, sequentialExecutor } from "./executor.ts";
12
+ export type { PermissionHandler, Decision } from "./permission.ts";
13
+ export type { TokenEstimator } from "./tokens.ts";
14
+ export {
15
+ defaultTokenEstimator,
16
+ estimateImageTokens,
17
+ estimateMessage,
18
+ estimateMessages,
19
+ estimateTools,
20
+ estimateSystem,
21
+ estimateSessionContext,
22
+ contentToText,
23
+ DEFAULT_CHARS_PER_TOKEN,
24
+ } from "./tokens.ts";
25
+ export type { BudgetPolicy, BudgetState, PressureLevel } from "./budget.ts";
26
+ export { defaultBudgetPolicy } from "./budget.ts";
27
+ export type { CompactionStrategy } from "./compact.ts";
28
+ export { mechanicalCompaction } from "./compact.ts";
29
+ export type { RecoveryPolicy } from "./recovery.ts";
30
+ export { defaultRecoveryPolicy, maxProviderRetries } from "./recovery.ts";
31
+ export type { AgentEvent, AgentEventType, EventBus, EventBusOptions } from "./events.ts";
32
+ export { createEventBus } from "./events.ts";
33
+ export { ContextStore } from "./history.ts";
34
+ export type { Session, SessionConfig, SessionState, TurnResult, Step, Execution } from "./session.ts";
35
+ export {
36
+ createSession,
37
+ DEFAULT_MAX_STEPS,
38
+ DEFAULT_CONTEXT_WINDOW_TOKENS,
39
+ DEFAULT_TOOL_RESULT_MAX_TOKENS,
40
+ DEFAULT_KEEP_RECENT_TURNS,
41
+ DEFAULT_TIMEOUT_MS,
42
42
  } from "./session.ts";