comisai 1.0.19 → 1.0.22

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 (147) hide show
  1. package/dist/cli-entry.js +0 -0
  2. package/node_modules/@comis/agent/dist/context-engine/context-engine.js +43 -2
  3. package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.d.ts +51 -0
  4. package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.js +110 -0
  5. package/node_modules/@comis/agent/dist/context-engine/signature-surrogate-guard.d.ts +54 -0
  6. package/node_modules/@comis/agent/dist/context-engine/signature-surrogate-guard.js +145 -0
  7. package/node_modules/@comis/agent/dist/context-engine/types-core.d.ts +17 -0
  8. package/node_modules/@comis/agent/dist/executor/error-classifier.d.ts +11 -1
  9. package/node_modules/@comis/agent/dist/executor/error-classifier.js +13 -0
  10. package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.d.ts +1 -0
  11. package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.js +55 -0
  12. package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.js +106 -5
  13. package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.js +1 -0
  14. package/node_modules/@comis/agent/dist/executor/pi-executor.d.ts +1 -4
  15. package/node_modules/@comis/agent/dist/executor/replay-drift-detector.d.ts +85 -0
  16. package/node_modules/@comis/agent/dist/executor/replay-drift-detector.js +92 -0
  17. package/node_modules/@comis/agent/dist/executor/signature-block-scrubber.d.ts +34 -0
  18. package/node_modules/@comis/agent/dist/executor/signature-block-scrubber.js +69 -0
  19. package/node_modules/@comis/agent/dist/executor/signed-replay-detector.d.ts +39 -0
  20. package/node_modules/@comis/agent/dist/executor/signed-replay-detector.js +72 -0
  21. package/node_modules/@comis/agent/package.json +1 -1
  22. package/node_modules/@comis/channels/package.json +1 -1
  23. package/node_modules/@comis/cli/dist/cli.js +0 -0
  24. package/node_modules/@comis/cli/package.json +1 -1
  25. package/node_modules/@comis/core/dist/config/git-manager.js +10 -4
  26. package/node_modules/@comis/core/dist/config/index.d.ts +1 -0
  27. package/node_modules/@comis/core/dist/config/index.js +2 -0
  28. package/node_modules/@comis/core/dist/config/managed-sections.d.ts +67 -0
  29. package/node_modules/@comis/core/dist/config/managed-sections.js +124 -0
  30. package/node_modules/@comis/core/dist/config/schema-agent.d.ts +28 -10
  31. package/node_modules/@comis/core/dist/config/schema-agent.js +6 -0
  32. package/node_modules/@comis/core/dist/config/schema-gateway.d.ts +2 -2
  33. package/node_modules/@comis/core/dist/config/schema.d.ts +65 -64
  34. package/node_modules/@comis/core/dist/event-bus/events-messaging.d.ts +16 -0
  35. package/node_modules/@comis/core/dist/exports/config.d.ts +1 -1
  36. package/node_modules/@comis/core/dist/exports/config.js +1 -1
  37. package/node_modules/@comis/core/package.json +1 -1
  38. package/node_modules/@comis/daemon/bundled-skills/skill-creator/scripts/init-skill.py +0 -0
  39. package/node_modules/@comis/daemon/bundled-skills/skill-creator/scripts/validate-skill.py +0 -0
  40. package/node_modules/@comis/daemon/dist/daemon.js +0 -0
  41. package/node_modules/@comis/daemon/dist/rpc/config-handlers.js +20 -7
  42. package/node_modules/@comis/daemon/dist/rpc/session-handlers.js +27 -1
  43. package/node_modules/@comis/daemon/package.json +1 -1
  44. package/node_modules/@comis/gateway/package.json +1 -1
  45. package/node_modules/@comis/infra/package.json +1 -1
  46. package/node_modules/@comis/memory/package.json +1 -1
  47. package/node_modules/@comis/scheduler/package.json +1 -1
  48. package/node_modules/@comis/shared/package.json +1 -1
  49. package/node_modules/@comis/skills/dist/bridge/tool-metadata-registry.js +23 -8
  50. package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.d.ts +1 -1
  51. package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.js +18 -14
  52. package/node_modules/@comis/skills/dist/builtin/platform/unified-session-tool.js +1 -1
  53. package/node_modules/@comis/skills/package.json +1 -1
  54. package/node_modules/@comis/web/package.json +1 -1
  55. package/package.json +24 -26
  56. package/node_modules/@comis/agent/dist/provider/response/strip-minimax-xml.d.ts +0 -9
  57. package/node_modules/@comis/agent/dist/provider/response/strip-minimax-xml.js +0 -17
  58. package/node_modules/@comis/agent/dist/provider/response/strip-model-tokens.d.ts +0 -13
  59. package/node_modules/@comis/agent/dist/provider/response/strip-model-tokens.js +0 -19
  60. package/node_modules/@comis/agent/dist/provider/response/strip-tool-text.d.ts +0 -11
  61. package/node_modules/@comis/agent/dist/provider/response/strip-tool-text.js +0 -32
  62. package/node_modules/@comis/agent/dist/safety/follow-through-detector.d.ts +0 -46
  63. package/node_modules/@comis/agent/dist/safety/follow-through-detector.js +0 -76
  64. package/node_modules/@comis/agent/dist/safety/post-compaction-safety.d.ts +0 -30
  65. package/node_modules/@comis/agent/dist/safety/post-compaction-safety.js +0 -51
  66. package/node_modules/@comis/agent/dist/safety/schema-normalizer.d.ts +0 -37
  67. package/node_modules/@comis/agent/dist/safety/schema-normalizer.js +0 -137
  68. package/node_modules/@comis/agent/dist/safety/schema-pruning.d.ts +0 -50
  69. package/node_modules/@comis/agent/dist/safety/schema-pruning.js +0 -112
  70. package/node_modules/@comis/agent/dist/safety/tool-image-sanitizer.d.ts +0 -43
  71. package/node_modules/@comis/agent/dist/safety/tool-image-sanitizer.js +0 -96
  72. package/node_modules/@comis/agent/dist/safety/tool-sanitizer.d.ts +0 -44
  73. package/node_modules/@comis/agent/dist/safety/tool-sanitizer.js +0 -94
  74. package/node_modules/@comis/channels/dist/shared/thinking-tag-filter.d.ts +0 -28
  75. package/node_modules/@comis/channels/dist/shared/thinking-tag-filter.js +0 -206
  76. package/node_modules/@comis/cli/dist/wizard/config-writer.d.ts +0 -25
  77. package/node_modules/@comis/cli/dist/wizard/config-writer.js +0 -144
  78. package/node_modules/@comis/cli/dist/wizard/flow-types.d.ts +0 -48
  79. package/node_modules/@comis/cli/dist/wizard/flow-types.js +0 -70
  80. package/node_modules/@comis/cli/dist/wizard/manual-flow.d.ts +0 -21
  81. package/node_modules/@comis/cli/dist/wizard/manual-flow.js +0 -345
  82. package/node_modules/@comis/cli/dist/wizard/quickstart-flow.d.ts +0 -21
  83. package/node_modules/@comis/cli/dist/wizard/quickstart-flow.js +0 -116
  84. package/node_modules/@comis/core/dist/config/schema-agent-model.d.ts +0 -135
  85. package/node_modules/@comis/core/dist/config/schema-agent-model.js +0 -114
  86. package/node_modules/@comis/core/dist/config/schema-agent-session.d.ts +0 -177
  87. package/node_modules/@comis/core/dist/config/schema-agent-session.js +0 -116
  88. package/node_modules/@comis/core/dist/config/schema-context-engine.d.ts +0 -92
  89. package/node_modules/@comis/core/dist/config/schema-context-engine.js +0 -92
  90. package/node_modules/@comis/core/dist/config/schema-context-guard.d.ts +0 -34
  91. package/node_modules/@comis/core/dist/config/schema-context-guard.js +0 -32
  92. package/node_modules/@comis/core/dist/config/schema-delivery-mirror.d.ts +0 -27
  93. package/node_modules/@comis/core/dist/config/schema-delivery-mirror.js +0 -26
  94. package/node_modules/@comis/core/dist/config/schema-delivery-queue.d.ts +0 -31
  95. package/node_modules/@comis/core/dist/config/schema-delivery-queue.js +0 -30
  96. package/node_modules/@comis/core/dist/config/schema-delivery-timing.d.ts +0 -41
  97. package/node_modules/@comis/core/dist/config/schema-delivery-timing.js +0 -31
  98. package/node_modules/@comis/core/dist/config/schema-monitoring.d.ts +0 -105
  99. package/node_modules/@comis/core/dist/config/schema-monitoring.js +0 -67
  100. package/node_modules/@comis/core/dist/ports/media-ports.d.ts +0 -278
  101. package/node_modules/@comis/core/dist/ports/media-ports.js +0 -1
  102. package/node_modules/@comis/core/dist/security/input-guard.d.ts +0 -46
  103. package/node_modules/@comis/core/dist/security/input-guard.js +0 -166
  104. package/node_modules/@comis/core/dist/security/scoped-secret-manager.d.ts +0 -38
  105. package/node_modules/@comis/core/dist/security/scoped-secret-manager.js +0 -94
  106. package/node_modules/@comis/daemon/dist/observability/delivery-context.d.ts +0 -37
  107. package/node_modules/@comis/daemon/dist/observability/delivery-context.js +0 -1
  108. package/node_modules/@comis/daemon/dist/observability/log-level-manager.d.ts +0 -23
  109. package/node_modules/@comis/daemon/dist/observability/log-level-manager.js +0 -34
  110. package/node_modules/@comis/daemon/dist/observability/log-transport.d.ts +0 -44
  111. package/node_modules/@comis/daemon/dist/observability/log-transport.js +0 -74
  112. package/node_modules/@comis/daemon/dist/observability/obs-write-buffer.d.ts +0 -53
  113. package/node_modules/@comis/daemon/dist/observability/obs-write-buffer.js +0 -68
  114. package/node_modules/@comis/daemon/dist/observability/types.d.ts +0 -6
  115. package/node_modules/@comis/daemon/dist/observability/types.js +0 -1
  116. package/node_modules/@comis/daemon/dist/wiring/seed-bundled-skills.d.ts +0 -41
  117. package/node_modules/@comis/daemon/dist/wiring/seed-bundled-skills.js +0 -84
  118. package/node_modules/@comis/daemon/dist/wiring/setup-delivery-mirror.d.ts +0 -24
  119. package/node_modules/@comis/daemon/dist/wiring/setup-delivery-mirror.js +0 -88
  120. package/node_modules/@comis/daemon/dist/wiring/setup-delivery-queue.d.ts +0 -31
  121. package/node_modules/@comis/daemon/dist/wiring/setup-delivery-queue.js +0 -132
  122. package/node_modules/@comis/daemon/dist/wiring/setup-monitoring.d.ts +0 -38
  123. package/node_modules/@comis/daemon/dist/wiring/setup-monitoring.js +0 -100
  124. package/node_modules/@comis/daemon/dist/wiring/setup-rpc-bridge.d.ts +0 -34
  125. package/node_modules/@comis/daemon/dist/wiring/setup-rpc-bridge.js +0 -52
  126. package/node_modules/@comis/daemon/dist/wiring/setup-task-extraction.d.ts +0 -41
  127. package/node_modules/@comis/daemon/dist/wiring/setup-task-extraction.js +0 -86
  128. package/node_modules/@comis/memory/dist/embedding-cache.d.ts +0 -36
  129. package/node_modules/@comis/memory/dist/embedding-cache.js +0 -94
  130. package/node_modules/@comis/skills/dist/bridge/tool-output-schemas.d.ts +0 -17
  131. package/node_modules/@comis/skills/dist/bridge/tool-output-schemas.js +0 -125
  132. package/node_modules/@comis/skills/dist/bridge/tool-parallelism-metadata.d.ts +0 -14
  133. package/node_modules/@comis/skills/dist/bridge/tool-parallelism-metadata.js +0 -92
  134. package/node_modules/@comis/skills/dist/bridge/tool-result-caps.d.ts +0 -14
  135. package/node_modules/@comis/skills/dist/bridge/tool-result-caps.js +0 -36
  136. package/node_modules/@comis/skills/dist/bridge/tool-search-hints.d.ts +0 -15
  137. package/node_modules/@comis/skills/dist/bridge/tool-search-hints.js +0 -68
  138. package/node_modules/@comis/skills/dist/bridge/tool-validators.d.ts +0 -11
  139. package/node_modules/@comis/skills/dist/bridge/tool-validators.js +0 -105
  140. package/node_modules/@comis/skills/dist/builtin/file/find-sort-wrapper.d.ts +0 -22
  141. package/node_modules/@comis/skills/dist/builtin/file/find-sort-wrapper.js +0 -95
  142. package/node_modules/@comis/skills/dist/builtin/file/grep-output-mode-wrapper.d.ts +0 -24
  143. package/node_modules/@comis/skills/dist/builtin/file/grep-output-mode-wrapper.js +0 -167
  144. package/node_modules/@comis/skills/dist/builtin/task-plan-tool.d.ts +0 -25
  145. package/node_modules/@comis/skills/dist/builtin/task-plan-tool.js +0 -67
  146. package/node_modules/@comis/skills/dist/integrations/mcp-tool-bridge.d.ts +0 -75
  147. package/node_modules/@comis/skills/dist/integrations/mcp-tool-bridge.js +0 -235
@@ -1,92 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Context engine configuration schema.
4
- *
5
- * Controls the context engine operating in either **pipeline** mode
6
- * (sequential layer composition: thinking cleaner, history window,
7
- * dead content evictor, observation masker, LLM compaction, rehydration)
8
- * or **DAG** mode (graph-based context management with leaf/condensed
9
- * nodes, incremental recall, and annotation-driven eviction).
10
- *
11
- * All fields have sensible defaults so an empty `{}` is always valid.
12
- * The flat schema validates all fields regardless of the active `version`
13
- * to prevent invalid saved configurations.
14
- *
15
- * Only top-level settings are exposed to users; internal budget
16
- * components (safety margin, output reserve, rot buffer) are
17
- * controlled by constants in @comis/agent.
18
- *
19
- * @module
20
- */
21
- /** Context engine configuration (per-agent). */
22
- export const ContextEngineConfigSchema = z.strictObject({
23
- // --- Core ---
24
- /** Master toggle for the context engine pipeline (enabled by default). */
25
- enabled: z.boolean().default(true),
26
- /** Operating mode: "pipeline" for sequential layer composition, "dag" for graph-based context management. */
27
- version: z.enum(["pipeline", "dag"]).default("pipeline"),
28
- // --- Shared (both modes) ---
29
- /** Number of recent assistant turns that retain thinking blocks (older turns get stripped). */
30
- thinkingKeepTurns: z.number().int().min(1).max(50).default(10),
31
- /** Model for LLM compaction in "provider:modelId" format. Defaults to Haiku for cost efficiency. Empty string falls through to session model. */
32
- compactionModel: z.string().default("anthropic:claude-haiku-4-5-20250929"),
33
- /** Minimum age (in tool result positions) before content is eligible for dead content eviction. */
34
- evictionMinAge: z.number().int().min(3).max(50).default(15),
35
- // --- Pipeline mode ---
36
- /** Number of recent user turns to keep in context (default 15). */
37
- historyTurns: z.number().int().min(3).max(100).default(15),
38
- /** Per-agent or per-channel-type turn count overrides (e.g., { dm: 10, "trader-1": 30 }). */
39
- historyTurnOverrides: z.record(z.string(), z.number().int().min(1).max(100)).optional(),
40
- /** Number of most recent tool uses that retain full content (older ones are masked). */
41
- observationKeepWindow: z.number().int().min(1).max(50).default(25),
42
- /** Character threshold before observation masking activates (below this, masking is skipped). */
43
- observationTriggerChars: z.number().int().min(50_000).max(1_000_000).default(120_000),
44
- /** Character threshold below which observation masking deactivates (CACHE-14 hysteresis). */
45
- observationDeactivationChars: z.number().int().min(20_000).max(500_000).default(80_000),
46
- /** Keep window for ephemeral-tier tools (web_search, brave_search, web_fetch, link_reader, fetch_url). Shorter than observationKeepWindow. Default: 10. */
47
- ephemeralKeepWindow: z.number().int().min(1).max(50).default(10),
48
- /** Turns to wait before re-triggering LLM compaction after a successful compaction. */
49
- compactionCooldownTurns: z.number().int().min(1).max(50).default(5),
50
- /** Output escalation configuration: auto-retry with higher output budget on max_tokens truncation (CTX-04). */
51
- outputEscalation: z.strictObject({
52
- /** Master toggle for output escalation. When false, max_tokens truncation is not retried. */
53
- enabled: z.boolean().default(true),
54
- /** Escalated max output tokens for the retry attempt. Must be between 4096 and 128000. */
55
- escalatedMaxTokens: z.number().int().min(4096).max(128_000).default(32_768),
56
- }).default({ enabled: true, escalatedMaxTokens: 32_768 }),
57
- // --- DAG mode ---
58
- /** Number of most recent turns always included verbatim in DAG context. */
59
- freshTailTurns: z.number().int().min(1).max(50).default(8),
60
- /** Context utilization fraction that triggers DAG compaction (0.1 to 0.95). */
61
- contextThreshold: z.number().min(0.1).max(0.95).default(0.75),
62
- /** Minimum fan-out for leaf nodes in the DAG. */
63
- leafMinFanout: z.number().int().min(2).max(20).default(8),
64
- /** Minimum fan-out for condensed (non-leaf) nodes in the DAG. */
65
- condensedMinFanout: z.number().int().min(2).max(20).default(4),
66
- /** Hard minimum fan-out for condensed nodes (lowest allowed). */
67
- condensedMinFanoutHard: z.number().int().min(2).max(10).default(2),
68
- /** Maximum depth for incremental DAG rebuilds (-1 = full rebuild). */
69
- incrementalMaxDepth: z.number().int().min(-1).max(10).default(0),
70
- /** Token budget for leaf node chunks in the DAG. */
71
- leafChunkTokens: z.number().int().min(1000).max(100_000).default(20_000),
72
- /** Target token size for leaf node summaries. */
73
- leafTargetTokens: z.number().int().min(96).max(5_000).default(1_200),
74
- /** Target token size for condensed node summaries. */
75
- condensedTargetTokens: z.number().int().min(256).max(10_000).default(2_000),
76
- /** Maximum tokens for expanded context retrieval. */
77
- maxExpandTokens: z.number().int().min(500).max(50_000).default(4_000),
78
- /** Maximum recall operations per day per agent. */
79
- maxRecallsPerDay: z.number().int().min(1).max(100).default(10),
80
- /** Timeout for recall operations in milliseconds. */
81
- recallTimeoutMs: z.number().int().min(10_000).max(600_000).default(120_000),
82
- /** Token threshold above which a file is considered "large" for DAG processing. */
83
- largeFileTokenThreshold: z.number().int().min(1000).max(200_000).default(25_000),
84
- /** Number of most recent annotations retained in DAG mode (analogous to observationKeepWindow). */
85
- annotationKeepWindow: z.number().int().min(1).max(50).default(15),
86
- /** Character threshold before annotation eviction activates in DAG mode. */
87
- annotationTriggerChars: z.number().int().min(10_000).max(1_000_000).default(200_000),
88
- /** Optional model override for DAG summary generation in "provider:modelId" format. */
89
- summaryModel: z.string().optional(),
90
- /** Optional provider override for DAG summary generation. */
91
- summaryProvider: z.string().optional(),
92
- });
@@ -1,34 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Context guard configuration schemas.
4
- *
5
- * ContextPruningConfigSchema -- progressive context pruning layer settings
6
- * (soft-trim at ratio threshold, hard-clear at higher ratio).
7
- *
8
- * SourceGateConfigSchema -- HTTP source gate layer settings
9
- * (byte cap and hidden HTML stripping).
10
- */
11
- /** Progressive context pruning configuration (per-agent). */
12
- export declare const ContextPruningConfigSchema: z.ZodObject<{
13
- /** Master toggle for progressive context pruning */
14
- enabled: z.ZodDefault<z.ZodBoolean>;
15
- /** Context ratio at which soft-trim begins (head+tail preservation) */
16
- softTrimRatio: z.ZodDefault<z.ZodNumber>;
17
- /** Context ratio at which hard-clear begins (full placeholder replacement) */
18
- hardClearRatio: z.ZodDefault<z.ZodNumber>;
19
- /** Number of recent assistant messages to protect from pruning */
20
- keepLastAssistants: z.ZodDefault<z.ZodNumber>;
21
- /** Minimum tool result size in characters eligible for soft-trim */
22
- minPrunableToolChars: z.ZodDefault<z.ZodNumber>;
23
- /** Tool names never pruned (strings in config, converted to RegExp patterns at runtime by consumer) */
24
- protectedTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
25
- }, z.core.$strict>;
26
- /** Source gate configuration for HTTP response size and sanitization (per-agent). */
27
- export declare const SourceGateConfigSchema: z.ZodObject<{
28
- /** Default byte cap for HTTP responses (matches DEFAULT_SOURCE_PROFILES.web_fetch.maxResponseBytes) */
29
- maxResponseBytes: z.ZodDefault<z.ZodNumber>;
30
- /** Whether to strip hidden HTML before extraction */
31
- stripHiddenHtml: z.ZodDefault<z.ZodBoolean>;
32
- }, z.core.$strict>;
33
- export type ContextPruningConfig = z.infer<typeof ContextPruningConfigSchema>;
34
- export type SourceGateConfig = z.infer<typeof SourceGateConfigSchema>;
@@ -1,32 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Context guard configuration schemas.
4
- *
5
- * ContextPruningConfigSchema -- progressive context pruning layer settings
6
- * (soft-trim at ratio threshold, hard-clear at higher ratio).
7
- *
8
- * SourceGateConfigSchema -- HTTP source gate layer settings
9
- * (byte cap and hidden HTML stripping).
10
- */
11
- /** Progressive context pruning configuration (per-agent). */
12
- export const ContextPruningConfigSchema = z.strictObject({
13
- /** Master toggle for progressive context pruning */
14
- enabled: z.boolean().default(true),
15
- /** Context ratio at which soft-trim begins (head+tail preservation) */
16
- softTrimRatio: z.number().min(0).max(1).default(0.3),
17
- /** Context ratio at which hard-clear begins (full placeholder replacement) */
18
- hardClearRatio: z.number().min(0).max(1).default(0.5),
19
- /** Number of recent assistant messages to protect from pruning */
20
- keepLastAssistants: z.number().int().nonnegative().default(3),
21
- /** Minimum tool result size in characters eligible for soft-trim */
22
- minPrunableToolChars: z.number().int().positive().default(4000),
23
- /** Tool names never pruned (strings in config, converted to RegExp patterns at runtime by consumer) */
24
- protectedTools: z.array(z.string()).default(["memory_search", "memory_get", "memory_store", "file_read"]),
25
- }).refine((data) => data.softTrimRatio < data.hardClearRatio, { message: "softTrimRatio must be less than hardClearRatio" });
26
- /** Source gate configuration for HTTP response size and sanitization (per-agent). */
27
- export const SourceGateConfigSchema = z.strictObject({
28
- /** Default byte cap for HTTP responses (matches DEFAULT_SOURCE_PROFILES.web_fetch.maxResponseBytes) */
29
- maxResponseBytes: z.number().int().positive().default(2_000_000),
30
- /** Whether to strip hidden HTML before extraction */
31
- stripHiddenHtml: z.boolean().default(true),
32
- });
@@ -1,27 +0,0 @@
1
- /**
2
- * Delivery mirror configuration schema.
3
- *
4
- * Defines settings for the session mirroring persistence layer:
5
- * enable/disable, retention, pruning, and injection limits.
6
- *
7
- * Phase 502: Session Mirroring.
8
- */
9
- import { z } from "zod";
10
- /**
11
- * DeliveryMirrorConfigSchema -- validated configuration for the delivery mirror.
12
- *
13
- * All fields have sensible defaults so an empty object produces a valid config.
14
- */
15
- export declare const DeliveryMirrorConfigSchema: z.ZodObject<{
16
- /** Whether the delivery mirror is enabled. When false, no entries are recorded. */
17
- enabled: z.ZodDefault<z.ZodBoolean>;
18
- /** Maximum age in milliseconds before mirror entries are pruned (24 hours). */
19
- retentionMs: z.ZodDefault<z.ZodNumber>;
20
- /** Interval in milliseconds between automatic prune sweeps (5 minutes). */
21
- pruneIntervalMs: z.ZodDefault<z.ZodNumber>;
22
- /** Maximum number of mirror entries injected per prompt turn. */
23
- maxEntriesPerInjection: z.ZodDefault<z.ZodNumber>;
24
- /** Maximum total characters of mirror text injected per prompt turn. */
25
- maxCharsPerInjection: z.ZodDefault<z.ZodNumber>;
26
- }, z.core.$strict>;
27
- export type DeliveryMirrorConfig = z.infer<typeof DeliveryMirrorConfigSchema>;
@@ -1,26 +0,0 @@
1
- /**
2
- * Delivery mirror configuration schema.
3
- *
4
- * Defines settings for the session mirroring persistence layer:
5
- * enable/disable, retention, pruning, and injection limits.
6
- *
7
- * Phase 502: Session Mirroring.
8
- */
9
- import { z } from "zod";
10
- /**
11
- * DeliveryMirrorConfigSchema -- validated configuration for the delivery mirror.
12
- *
13
- * All fields have sensible defaults so an empty object produces a valid config.
14
- */
15
- export const DeliveryMirrorConfigSchema = z.strictObject({
16
- /** Whether the delivery mirror is enabled. When false, no entries are recorded. */
17
- enabled: z.boolean().default(true),
18
- /** Maximum age in milliseconds before mirror entries are pruned (24 hours). */
19
- retentionMs: z.number().int().positive().default(86_400_000),
20
- /** Interval in milliseconds between automatic prune sweeps (5 minutes). */
21
- pruneIntervalMs: z.number().int().positive().default(300_000),
22
- /** Maximum number of mirror entries injected per prompt turn. */
23
- maxEntriesPerInjection: z.number().int().positive().default(10),
24
- /** Maximum total characters of mirror text injected per prompt turn. */
25
- maxCharsPerInjection: z.number().int().positive().default(4000),
26
- });
@@ -1,31 +0,0 @@
1
- /**
2
- * Delivery queue configuration schema.
3
- *
4
- * Defines settings for the crash-safe outbound delivery queue:
5
- * enable/disable, depth limits, retry policy, drain behavior, and pruning.
6
- *
7
- * Phase 499: Crash-Safe Delivery Queue.
8
- */
9
- import { z } from "zod";
10
- /**
11
- * DeliveryQueueConfigSchema -- validated configuration for the delivery queue.
12
- *
13
- * All fields have sensible defaults so an empty object produces a valid config.
14
- */
15
- export declare const DeliveryQueueConfigSchema: z.ZodObject<{
16
- /** Whether the delivery queue is enabled. When false, messages bypass persistence. */
17
- enabled: z.ZodDefault<z.ZodBoolean>;
18
- /** Maximum number of entries allowed in the queue. Enqueue rejects when full. */
19
- maxQueueDepth: z.ZodDefault<z.ZodNumber>;
20
- /** Default maximum delivery attempts before marking an entry as failed. */
21
- defaultMaxAttempts: z.ZodDefault<z.ZodNumber>;
22
- /** Default time-to-live in milliseconds before an entry expires (1 hour). */
23
- defaultExpireMs: z.ZodDefault<z.ZodNumber>;
24
- /** Whether to drain pending entries on daemon startup (crash recovery). */
25
- drainOnStartup: z.ZodDefault<z.ZodBoolean>;
26
- /** Maximum time in milliseconds allowed for startup drain before continuing. */
27
- drainBudgetMs: z.ZodDefault<z.ZodNumber>;
28
- /** Interval in milliseconds between automatic prune sweeps for expired entries. */
29
- pruneIntervalMs: z.ZodDefault<z.ZodNumber>;
30
- }, z.core.$strict>;
31
- export type DeliveryQueueConfig = z.infer<typeof DeliveryQueueConfigSchema>;
@@ -1,30 +0,0 @@
1
- /**
2
- * Delivery queue configuration schema.
3
- *
4
- * Defines settings for the crash-safe outbound delivery queue:
5
- * enable/disable, depth limits, retry policy, drain behavior, and pruning.
6
- *
7
- * Phase 499: Crash-Safe Delivery Queue.
8
- */
9
- import { z } from "zod";
10
- /**
11
- * DeliveryQueueConfigSchema -- validated configuration for the delivery queue.
12
- *
13
- * All fields have sensible defaults so an empty object produces a valid config.
14
- */
15
- export const DeliveryQueueConfigSchema = z.strictObject({
16
- /** Whether the delivery queue is enabled. When false, messages bypass persistence. */
17
- enabled: z.boolean().default(true),
18
- /** Maximum number of entries allowed in the queue. Enqueue rejects when full. */
19
- maxQueueDepth: z.number().int().positive().default(10_000),
20
- /** Default maximum delivery attempts before marking an entry as failed. */
21
- defaultMaxAttempts: z.number().int().positive().default(5),
22
- /** Default time-to-live in milliseconds before an entry expires (1 hour). */
23
- defaultExpireMs: z.number().int().positive().default(3_600_000),
24
- /** Whether to drain pending entries on daemon startup (crash recovery). */
25
- drainOnStartup: z.boolean().default(true),
26
- /** Maximum time in milliseconds allowed for startup drain before continuing. */
27
- drainBudgetMs: z.number().int().positive().default(60_000),
28
- /** Interval in milliseconds between automatic prune sweeps for expired entries. */
29
- pruneIntervalMs: z.number().int().positive().default(300_000),
30
- });
@@ -1,41 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Delivery timing mode determines how inter-block delays are calculated.
4
- *
5
- * - `off`: No delay between blocks (instant delivery)
6
- * - `natural`: Human-like typing delay based on block length
7
- * - `custom`: Fixed delay range (minMs..maxMs + jitter)
8
- * - `adaptive`: Adjusts delay based on conversation pace and block complexity
9
- */
10
- export declare const DeliveryTimingModeSchema: z.ZodDefault<z.ZodEnum<{
11
- off: "off";
12
- custom: "custom";
13
- natural: "natural";
14
- adaptive: "adaptive";
15
- }>>;
16
- /**
17
- * Delivery timing configuration schema.
18
- *
19
- * Controls the pacing of block-by-block message delivery to simulate
20
- * natural typing rhythm. Applies after the coalescer flushes a block
21
- * and before the channel adapter sends it.
22
- */
23
- export declare const DeliveryTimingConfigSchema: z.ZodObject<{
24
- /** Timing mode: off, natural, custom, or adaptive */
25
- mode: z.ZodDefault<z.ZodEnum<{
26
- off: "off";
27
- custom: "custom";
28
- natural: "natural";
29
- adaptive: "adaptive";
30
- }>>;
31
- /** Minimum delay (ms) between block deliveries */
32
- minMs: z.ZodDefault<z.ZodNumber>;
33
- /** Maximum delay (ms) between block deliveries */
34
- maxMs: z.ZodDefault<z.ZodNumber>;
35
- /** Random jitter (ms) added to each delay for natural feel */
36
- jitterMs: z.ZodDefault<z.ZodNumber>;
37
- /** Extra delay (ms) before delivering the first block of a response */
38
- firstBlockDelayMs: z.ZodDefault<z.ZodNumber>;
39
- }, z.core.$strict>;
40
- export type DeliveryTimingConfig = z.infer<typeof DeliveryTimingConfigSchema>;
41
- export type DeliveryTimingMode = z.infer<typeof DeliveryTimingModeSchema>;
@@ -1,31 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Delivery timing mode determines how inter-block delays are calculated.
4
- *
5
- * - `off`: No delay between blocks (instant delivery)
6
- * - `natural`: Human-like typing delay based on block length
7
- * - `custom`: Fixed delay range (minMs..maxMs + jitter)
8
- * - `adaptive`: Adjusts delay based on conversation pace and block complexity
9
- */
10
- export const DeliveryTimingModeSchema = z
11
- .enum(["off", "natural", "custom", "adaptive"])
12
- .default("natural");
13
- /**
14
- * Delivery timing configuration schema.
15
- *
16
- * Controls the pacing of block-by-block message delivery to simulate
17
- * natural typing rhythm. Applies after the coalescer flushes a block
18
- * and before the channel adapter sends it.
19
- */
20
- export const DeliveryTimingConfigSchema = z.strictObject({
21
- /** Timing mode: off, natural, custom, or adaptive */
22
- mode: DeliveryTimingModeSchema,
23
- /** Minimum delay (ms) between block deliveries */
24
- minMs: z.number().int().nonnegative().default(800),
25
- /** Maximum delay (ms) between block deliveries */
26
- maxMs: z.number().int().nonnegative().default(2500),
27
- /** Random jitter (ms) added to each delay for natural feel */
28
- jitterMs: z.number().int().nonnegative().default(200),
29
- /** Extra delay (ms) before delivering the first block of a response */
30
- firstBlockDelayMs: z.number().int().nonnegative().default(0),
31
- });
@@ -1,105 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Monitoring configuration schemas.
4
- *
5
- * Defines thresholds and settings for system monitoring heartbeat sources:
6
- * disk space, CPU/memory resources, systemd services, security updates,
7
- * and git repository watching.
8
- *
9
- * MON-01: Disk space monitoring
10
- * MON-02: Resource utilization monitoring
11
- * MON-03: Service health monitoring
12
- * MON-04: Security update and git repo monitoring
13
- */
14
- declare const DiskMonitorSchema: z.ZodObject<{
15
- /** Whether disk space monitoring is enabled. */
16
- enabled: z.ZodDefault<z.ZodBoolean>;
17
- /** Filesystem paths to monitor. */
18
- paths: z.ZodDefault<z.ZodArray<z.ZodString>>;
19
- /** Alert when usage exceeds this percentage. */
20
- thresholdPercent: z.ZodDefault<z.ZodNumber>;
21
- }, z.core.$strict>;
22
- declare const ResourceMonitorSchema: z.ZodObject<{
23
- /** Whether CPU/memory monitoring is enabled. */
24
- enabled: z.ZodDefault<z.ZodBoolean>;
25
- /** Alert when CPU usage exceeds this percentage. */
26
- cpuThresholdPercent: z.ZodDefault<z.ZodNumber>;
27
- /** Alert when memory usage exceeds this percentage. */
28
- memoryThresholdPercent: z.ZodDefault<z.ZodNumber>;
29
- }, z.core.$strict>;
30
- declare const SystemdMonitorSchema: z.ZodObject<{
31
- /** Whether systemd service monitoring is enabled. */
32
- enabled: z.ZodDefault<z.ZodBoolean>;
33
- /** Specific services to monitor (empty = check all failed). */
34
- services: z.ZodDefault<z.ZodArray<z.ZodString>>;
35
- }, z.core.$strict>;
36
- declare const SecurityUpdateMonitorSchema: z.ZodObject<{
37
- /** Whether security update monitoring is enabled. */
38
- enabled: z.ZodDefault<z.ZodBoolean>;
39
- /** Only check for security updates (not all updates). */
40
- securityOnly: z.ZodDefault<z.ZodBoolean>;
41
- }, z.core.$strict>;
42
- declare const GitMonitorSchema: z.ZodObject<{
43
- /** Whether git repository monitoring is enabled (default: off). */
44
- enabled: z.ZodDefault<z.ZodBoolean>;
45
- /** Absolute paths to git repositories to monitor. */
46
- repositories: z.ZodDefault<z.ZodArray<z.ZodString>>;
47
- /** Check remote for unpushed commits. */
48
- checkRemote: z.ZodDefault<z.ZodBoolean>;
49
- }, z.core.$strict>;
50
- /**
51
- * Root monitoring configuration schema.
52
- *
53
- * Each sub-section has sensible defaults so an empty object
54
- * produces a valid MonitoringConfig.
55
- */
56
- export declare const MonitoringConfigSchema: z.ZodObject<{
57
- /** Disk space monitoring. */
58
- disk: z.ZodDefault<z.ZodObject<{
59
- /** Whether disk space monitoring is enabled. */
60
- enabled: z.ZodDefault<z.ZodBoolean>;
61
- /** Filesystem paths to monitor. */
62
- paths: z.ZodDefault<z.ZodArray<z.ZodString>>;
63
- /** Alert when usage exceeds this percentage. */
64
- thresholdPercent: z.ZodDefault<z.ZodNumber>;
65
- }, z.core.$strict>>;
66
- /** CPU and memory monitoring. */
67
- resources: z.ZodDefault<z.ZodObject<{
68
- /** Whether CPU/memory monitoring is enabled. */
69
- enabled: z.ZodDefault<z.ZodBoolean>;
70
- /** Alert when CPU usage exceeds this percentage. */
71
- cpuThresholdPercent: z.ZodDefault<z.ZodNumber>;
72
- /** Alert when memory usage exceeds this percentage. */
73
- memoryThresholdPercent: z.ZodDefault<z.ZodNumber>;
74
- }, z.core.$strict>>;
75
- /** systemd service health monitoring. */
76
- systemd: z.ZodDefault<z.ZodObject<{
77
- /** Whether systemd service monitoring is enabled. */
78
- enabled: z.ZodDefault<z.ZodBoolean>;
79
- /** Specific services to monitor (empty = check all failed). */
80
- services: z.ZodDefault<z.ZodArray<z.ZodString>>;
81
- }, z.core.$strict>>;
82
- /** Security update monitoring. */
83
- securityUpdates: z.ZodDefault<z.ZodObject<{
84
- /** Whether security update monitoring is enabled. */
85
- enabled: z.ZodDefault<z.ZodBoolean>;
86
- /** Only check for security updates (not all updates). */
87
- securityOnly: z.ZodDefault<z.ZodBoolean>;
88
- }, z.core.$strict>>;
89
- /** Git repository monitoring. */
90
- git: z.ZodDefault<z.ZodObject<{
91
- /** Whether git repository monitoring is enabled (default: off). */
92
- enabled: z.ZodDefault<z.ZodBoolean>;
93
- /** Absolute paths to git repositories to monitor. */
94
- repositories: z.ZodDefault<z.ZodArray<z.ZodString>>;
95
- /** Check remote for unpushed commits. */
96
- checkRemote: z.ZodDefault<z.ZodBoolean>;
97
- }, z.core.$strict>>;
98
- }, z.core.$strict>;
99
- export type MonitoringConfig = z.infer<typeof MonitoringConfigSchema>;
100
- export type DiskMonitorConfig = z.infer<typeof DiskMonitorSchema>;
101
- export type ResourceMonitorConfig = z.infer<typeof ResourceMonitorSchema>;
102
- export type SystemdMonitorConfig = z.infer<typeof SystemdMonitorSchema>;
103
- export type SecurityUpdateMonitorConfig = z.infer<typeof SecurityUpdateMonitorSchema>;
104
- export type GitMonitorConfig = z.infer<typeof GitMonitorSchema>;
105
- export {};
@@ -1,67 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Monitoring configuration schemas.
4
- *
5
- * Defines thresholds and settings for system monitoring heartbeat sources:
6
- * disk space, CPU/memory resources, systemd services, security updates,
7
- * and git repository watching.
8
- *
9
- * MON-01: Disk space monitoring
10
- * MON-02: Resource utilization monitoring
11
- * MON-03: Service health monitoring
12
- * MON-04: Security update and git repo monitoring
13
- */
14
- const DiskMonitorSchema = z.strictObject({
15
- /** Whether disk space monitoring is enabled. */
16
- enabled: z.boolean().default(true),
17
- /** Filesystem paths to monitor. */
18
- paths: z.array(z.string()).default(["/"]),
19
- /** Alert when usage exceeds this percentage. */
20
- thresholdPercent: z.number().min(0).max(100).default(90),
21
- });
22
- const ResourceMonitorSchema = z.strictObject({
23
- /** Whether CPU/memory monitoring is enabled. */
24
- enabled: z.boolean().default(true),
25
- /** Alert when CPU usage exceeds this percentage. */
26
- cpuThresholdPercent: z.number().min(0).max(100).default(85),
27
- /** Alert when memory usage exceeds this percentage. */
28
- memoryThresholdPercent: z.number().min(0).max(100).default(90),
29
- });
30
- const SystemdMonitorSchema = z.strictObject({
31
- /** Whether systemd service monitoring is enabled. */
32
- enabled: z.boolean().default(true),
33
- /** Specific services to monitor (empty = check all failed). */
34
- services: z.array(z.string()).default([]),
35
- });
36
- const SecurityUpdateMonitorSchema = z.strictObject({
37
- /** Whether security update monitoring is enabled. */
38
- enabled: z.boolean().default(true),
39
- /** Only check for security updates (not all updates). */
40
- securityOnly: z.boolean().default(true),
41
- });
42
- const GitMonitorSchema = z.strictObject({
43
- /** Whether git repository monitoring is enabled (default: off). */
44
- enabled: z.boolean().default(false),
45
- /** Absolute paths to git repositories to monitor. */
46
- repositories: z.array(z.string()).default([]),
47
- /** Check remote for unpushed commits. */
48
- checkRemote: z.boolean().default(true),
49
- });
50
- /**
51
- * Root monitoring configuration schema.
52
- *
53
- * Each sub-section has sensible defaults so an empty object
54
- * produces a valid MonitoringConfig.
55
- */
56
- export const MonitoringConfigSchema = z.strictObject({
57
- /** Disk space monitoring. */
58
- disk: DiskMonitorSchema.default(() => DiskMonitorSchema.parse({})),
59
- /** CPU and memory monitoring. */
60
- resources: ResourceMonitorSchema.default(() => ResourceMonitorSchema.parse({})),
61
- /** systemd service health monitoring. */
62
- systemd: SystemdMonitorSchema.default(() => SystemdMonitorSchema.parse({})),
63
- /** Security update monitoring. */
64
- securityUpdates: SecurityUpdateMonitorSchema.default(() => SecurityUpdateMonitorSchema.parse({})),
65
- /** Git repository monitoring. */
66
- git: GitMonitorSchema.default(() => GitMonitorSchema.parse({})),
67
- });