comisai 1.0.11 → 1.0.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.
- package/node_modules/@comis/agent/dist/model/operation-model-defaults.js +1 -0
- package/node_modules/@comis/agent/dist/session/comis-session-manager.js +9 -9
- package/node_modules/@comis/agent/package.json +1 -1
- package/node_modules/@comis/channels/package.json +1 -1
- package/node_modules/@comis/cli/package.json +1 -1
- package/node_modules/@comis/core/dist/event-bus/events-infra.d.ts +2 -0
- package/node_modules/@comis/core/package.json +1 -1
- package/node_modules/@comis/daemon/dist/wiring/setup-channels.js +12 -1
- package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +1 -0
- package/node_modules/@comis/daemon/dist/wiring/setup-schedulers.js +1 -0
- package/node_modules/@comis/daemon/package.json +1 -1
- package/node_modules/@comis/gateway/package.json +1 -1
- package/node_modules/@comis/infra/package.json +1 -1
- package/node_modules/@comis/memory/package.json +1 -1
- package/node_modules/@comis/scheduler/dist/cron/cron-types.d.ts +6 -0
- package/node_modules/@comis/scheduler/dist/cron/cron-types.js +2 -0
- package/node_modules/@comis/scheduler/package.json +1 -1
- package/node_modules/@comis/shared/package.json +1 -1
- package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.d.ts +1 -1
- package/node_modules/@comis/skills/package.json +1 -1
- package/package.json +18 -18
- package/node_modules/@comis/core/dist/approval/approval-gate.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/approval/approval-gate.test.js +0 -1003
- package/node_modules/@comis/core/dist/bootstrap.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/bootstrap.test.js +0 -150
- package/node_modules/@comis/core/dist/config/backup.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/backup.test.js +0 -160
- package/node_modules/@comis/core/dist/config/env-substitution.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/env-substitution.test.js +0 -259
- package/node_modules/@comis/core/dist/config/field-metadata.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/field-metadata.test.js +0 -72
- package/node_modules/@comis/core/dist/config/git-manager.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/git-manager.test.js +0 -1042
- package/node_modules/@comis/core/dist/config/immutable-keys.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/immutable-keys.test.js +0 -283
- package/node_modules/@comis/core/dist/config/include-resolver.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/include-resolver.test.js +0 -292
- package/node_modules/@comis/core/dist/config/layered.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/layered.test.js +0 -211
- package/node_modules/@comis/core/dist/config/loader.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/loader.test.js +0 -300
- package/node_modules/@comis/core/dist/config/migrate.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/migrate.test.js +0 -244
- package/node_modules/@comis/core/dist/config/partial-validator.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/partial-validator.test.js +0 -98
- package/node_modules/@comis/core/dist/config/schema-agent-model.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-agent-model.test.js +0 -279
- package/node_modules/@comis/core/dist/config/schema-agent-session.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-agent-session.test.js +0 -242
- package/node_modules/@comis/core/dist/config/schema-agent.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-agent.test.js +0 -645
- package/node_modules/@comis/core/dist/config/schema-channel.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-channel.test.js +0 -341
- package/node_modules/@comis/core/dist/config/schema-coalescer.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-coalescer.test.js +0 -51
- package/node_modules/@comis/core/dist/config/schema-context-engine.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-context-engine.test.js +0 -797
- package/node_modules/@comis/core/dist/config/schema-context-guard.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-context-guard.test.js +0 -111
- package/node_modules/@comis/core/dist/config/schema-daemon.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-daemon.test.js +0 -107
- package/node_modules/@comis/core/dist/config/schema-delivery-timing.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-delivery-timing.test.js +0 -51
- package/node_modules/@comis/core/dist/config/schema-documentation.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-documentation.test.js +0 -63
- package/node_modules/@comis/core/dist/config/schema-gateway.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-gateway.test.js +0 -219
- package/node_modules/@comis/core/dist/config/schema-gemini-cache.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-gemini-cache.test.js +0 -41
- package/node_modules/@comis/core/dist/config/schema-integrations.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-integrations.test.js +0 -92
- package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.test.js +0 -61
- package/node_modules/@comis/core/dist/config/schema-misc.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-misc.test.js +0 -394
- package/node_modules/@comis/core/dist/config/schema-observability.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-observability.test.js +0 -76
- package/node_modules/@comis/core/dist/config/schema-providers.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-providers.test.js +0 -294
- package/node_modules/@comis/core/dist/config/schema-queue.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-queue.test.js +0 -234
- package/node_modules/@comis/core/dist/config/schema-response-prefix.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-response-prefix.test.js +0 -36
- package/node_modules/@comis/core/dist/config/schema-security.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-security.test.js +0 -54
- package/node_modules/@comis/core/dist/config/schema-sender-trust-display.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-sender-trust-display.test.js +0 -60
- package/node_modules/@comis/core/dist/config/schema-serializer.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-serializer.test.js +0 -73
- package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.test.js +0 -39
- package/node_modules/@comis/core/dist/context/context.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/context/context.test.js +0 -276
- package/node_modules/@comis/core/dist/domain/agent-response.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/domain/agent-response.test.js +0 -159
- package/node_modules/@comis/core/dist/domain/credential-mapping.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/domain/credential-mapping.test.js +0 -135
- package/node_modules/@comis/core/dist/domain/delivery-origin.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/domain/delivery-origin.test.js +0 -68
- package/node_modules/@comis/core/dist/domain/execution-graph.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/domain/execution-graph.test.js +0 -441
- package/node_modules/@comis/core/dist/domain/memory-entry.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/domain/memory-entry.test.js +0 -193
- package/node_modules/@comis/core/dist/domain/normalized-message.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/domain/normalized-message.test.js +0 -255
- package/node_modules/@comis/core/dist/domain/session-key.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/domain/session-key.test.js +0 -291
- package/node_modules/@comis/core/dist/domain/subagent-context-config.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/domain/subagent-context-config.test.js +0 -131
- package/node_modules/@comis/core/dist/domain/subagent-context-types.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/domain/subagent-context-types.test.js +0 -182
- package/node_modules/@comis/core/dist/event-bus/bus.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/event-bus/bus.test.js +0 -152
- package/node_modules/@comis/core/dist/event-bus/events-agent.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/event-bus/events-agent.test.js +0 -409
- package/node_modules/@comis/core/dist/event-bus/events-channel.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/event-bus/events-channel.test.js +0 -240
- package/node_modules/@comis/core/dist/event-bus/events-infra.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/event-bus/events-infra.test.js +0 -416
- package/node_modules/@comis/core/dist/event-bus/events-messaging.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/event-bus/events-messaging.test.js +0 -433
- package/node_modules/@comis/core/dist/event-bus/events.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/event-bus/events.test.js +0 -93
- package/node_modules/@comis/core/dist/hooks/hook-runner-global.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/hooks/hook-runner-global.test.js +0 -29
- package/node_modules/@comis/core/dist/hooks/hook-runner.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/hooks/hook-runner.test.js +0 -490
- package/node_modules/@comis/core/dist/hooks/hook-strategies.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/hooks/hook-strategies.test.js +0 -209
- package/node_modules/@comis/core/dist/hooks/integration.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/hooks/integration.test.js +0 -235
- package/node_modules/@comis/core/dist/hooks/plugin-registry.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/hooks/plugin-registry.test.js +0 -470
- package/node_modules/@comis/core/dist/load-env.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/load-env.test.js +0 -21
- package/node_modules/@comis/core/dist/security/action-classifier.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/action-classifier.test.js +0 -298
- package/node_modules/@comis/core/dist/security/audit-aggregator.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/audit-aggregator.test.js +0 -128
- package/node_modules/@comis/core/dist/security/audit.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/audit.test.js +0 -154
- package/node_modules/@comis/core/dist/security/canary-token.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/canary-token.test.js +0 -45
- package/node_modules/@comis/core/dist/security/config-redaction.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/config-redaction.test.js +0 -107
- package/node_modules/@comis/core/dist/security/external-content.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/external-content.test.js +0 -210
- package/node_modules/@comis/core/dist/security/injection-patterns.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/injection-patterns.test.js +0 -213
- package/node_modules/@comis/core/dist/security/injection-rate-limiter.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/injection-rate-limiter.test.js +0 -194
- package/node_modules/@comis/core/dist/security/input-guard.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/input-guard.test.js +0 -215
- package/node_modules/@comis/core/dist/security/input-security-guard.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/input-security-guard.test.js +0 -215
- package/node_modules/@comis/core/dist/security/input-validator.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/input-validator.test.js +0 -133
- package/node_modules/@comis/core/dist/security/log-sanitizer.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/log-sanitizer.test.js +0 -260
- package/node_modules/@comis/core/dist/security/memory-write-validator.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/memory-write-validator.test.js +0 -62
- package/node_modules/@comis/core/dist/security/output-guard.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/output-guard.test.js +0 -397
- package/node_modules/@comis/core/dist/security/safe-path.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/safe-path.test.js +0 -95
- package/node_modules/@comis/core/dist/security/scoped-secret-manager.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/scoped-secret-manager.test.js +0 -231
- package/node_modules/@comis/core/dist/security/secret-access.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/secret-access.test.js +0 -41
- package/node_modules/@comis/core/dist/security/secret-crypto.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/secret-crypto.test.js +0 -113
- package/node_modules/@comis/core/dist/security/secret-manager.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/secret-manager.test.js +0 -394
- package/node_modules/@comis/core/dist/security/secret-ref-resolver.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/secret-ref-resolver.test.js +0 -268
- package/node_modules/@comis/core/dist/security/secrets-audit.test.d.ts +0 -10
- package/node_modules/@comis/core/dist/security/secrets-audit.test.js +0 -295
- package/node_modules/@comis/core/dist/security/ssrf-guard.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/ssrf-guard.test.js +0 -127
- package/node_modules/@comis/core/dist/security/token-generator.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/security/token-generator.test.js +0 -35
- package/node_modules/@comis/core/dist/tool-metadata.test.d.ts +0 -1
- package/node_modules/@comis/core/dist/tool-metadata.test.js +0 -112
- package/node_modules/@comis/memory/dist/compaction.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/compaction.test.js +0 -298
- package/node_modules/@comis/memory/dist/context-schema.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/context-schema.test.js +0 -246
- package/node_modules/@comis/memory/dist/context-store.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/context-store.test.js +0 -708
- package/node_modules/@comis/memory/dist/credential-mapping-schema.test.d.ts +0 -7
- package/node_modules/@comis/memory/dist/credential-mapping-schema.test.js +0 -73
- package/node_modules/@comis/memory/dist/credential-mapping-store.test.d.ts +0 -8
- package/node_modules/@comis/memory/dist/credential-mapping-store.test.js +0 -340
- package/node_modules/@comis/memory/dist/delivery-mirror-adapter.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/delivery-mirror-adapter.test.js +0 -165
- package/node_modules/@comis/memory/dist/delivery-queue-adapter.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/delivery-queue-adapter.test.js +0 -263
- package/node_modules/@comis/memory/dist/embedding-batch-indexer.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/embedding-batch-indexer.test.js +0 -202
- package/node_modules/@comis/memory/dist/embedding-cache-lru.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/embedding-cache-lru.test.js +0 -241
- package/node_modules/@comis/memory/dist/embedding-cache-sqlite.test.d.ts +0 -8
- package/node_modules/@comis/memory/dist/embedding-cache-sqlite.test.js +0 -678
- package/node_modules/@comis/memory/dist/embedding-cache.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/embedding-cache.test.js +0 -213
- package/node_modules/@comis/memory/dist/embedding-fingerprint.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/embedding-fingerprint.test.js +0 -87
- package/node_modules/@comis/memory/dist/embedding-hash.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/embedding-hash.test.js +0 -31
- package/node_modules/@comis/memory/dist/embedding-integration.test.d.ts +0 -8
- package/node_modules/@comis/memory/dist/embedding-integration.test.js +0 -232
- package/node_modules/@comis/memory/dist/embedding-provider-factory.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/embedding-provider-factory.test.js +0 -176
- package/node_modules/@comis/memory/dist/embedding-provider-local.test.d.ts +0 -8
- package/node_modules/@comis/memory/dist/embedding-provider-local.test.js +0 -76
- package/node_modules/@comis/memory/dist/embedding-provider-openai.test.d.ts +0 -8
- package/node_modules/@comis/memory/dist/embedding-provider-openai.test.js +0 -100
- package/node_modules/@comis/memory/dist/embedding-queue.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/embedding-queue.test.js +0 -236
- package/node_modules/@comis/memory/dist/hybrid-search.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/hybrid-search.test.js +0 -476
- package/node_modules/@comis/memory/dist/identity-link-store.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/identity-link-store.test.js +0 -88
- package/node_modules/@comis/memory/dist/memory-api.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/memory-api.test.js +0 -495
- package/node_modules/@comis/memory/dist/memory-concurrency.test.d.ts +0 -20
- package/node_modules/@comis/memory/dist/memory-concurrency.test.js +0 -222
- package/node_modules/@comis/memory/dist/named-graph-store.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/named-graph-store.test.js +0 -227
- package/node_modules/@comis/memory/dist/observability-store.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/observability-store.test.js +0 -704
- package/node_modules/@comis/memory/dist/row-mapper.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/row-mapper.test.js +0 -409
- package/node_modules/@comis/memory/dist/schema.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/schema.test.js +0 -240
- package/node_modules/@comis/memory/dist/secret-store-schema.test.d.ts +0 -7
- package/node_modules/@comis/memory/dist/secret-store-schema.test.js +0 -90
- package/node_modules/@comis/memory/dist/session-store.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/session-store.test.js +0 -262
- package/node_modules/@comis/memory/dist/setup-secrets.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/setup-secrets.test.js +0 -140
- package/node_modules/@comis/memory/dist/sqlite-memory-adapter.test.d.ts +0 -1
- package/node_modules/@comis/memory/dist/sqlite-memory-adapter.test.js +0 -888
- package/node_modules/@comis/memory/dist/sqlite-secret-store.test.d.ts +0 -8
- package/node_modules/@comis/memory/dist/sqlite-secret-store.test.js +0 -245
- package/node_modules/@comis/shared/dist/abort.test.d.ts +0 -1
- package/node_modules/@comis/shared/dist/abort.test.js +0 -71
- package/node_modules/@comis/shared/dist/result.test.d.ts +0 -1
- package/node_modules/@comis/shared/dist/result.test.js +0 -178
- package/node_modules/@comis/shared/dist/suppress-error.test.d.ts +0 -1
- package/node_modules/@comis/shared/dist/suppress-error.test.js +0 -50
- package/node_modules/@comis/shared/dist/timeout.test.d.ts +0 -1
- package/node_modules/@comis/shared/dist/timeout.test.js +0 -75
- package/node_modules/@comis/shared/dist/ttl-cache.test.d.ts +0 -1
- package/node_modules/@comis/shared/dist/ttl-cache.test.js +0 -81
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { SessionResetPolicySchema, ResetPolicyOverrideSchema, DmScopeConfigSchema, PruningConfigSchema, SessionCompactionConfigSchema, } from "./schema-agent.js";
|
|
3
|
-
describe("SessionResetPolicySchema", () => {
|
|
4
|
-
it("parses valid reset policy", () => {
|
|
5
|
-
const result = SessionResetPolicySchema.safeParse({
|
|
6
|
-
mode: "hybrid",
|
|
7
|
-
dailyResetHour: 6,
|
|
8
|
-
dailyResetTimezone: "America/New_York",
|
|
9
|
-
idleTimeoutMs: 7_200_000,
|
|
10
|
-
sweepIntervalMs: 60_000,
|
|
11
|
-
resetTriggers: ["/reset", "/new"],
|
|
12
|
-
});
|
|
13
|
-
expect(result.success).toBe(true);
|
|
14
|
-
if (result.success) {
|
|
15
|
-
expect(result.data.mode).toBe("hybrid");
|
|
16
|
-
expect(result.data.dailyResetHour).toBe(6);
|
|
17
|
-
expect(result.data.dailyResetTimezone).toBe("America/New_York");
|
|
18
|
-
expect(result.data.idleTimeoutMs).toBe(7_200_000);
|
|
19
|
-
expect(result.data.resetTriggers).toEqual(["/reset", "/new"]);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
it("applies defaults for empty object", () => {
|
|
23
|
-
const result = SessionResetPolicySchema.parse({});
|
|
24
|
-
expect(result.mode).toBe("none");
|
|
25
|
-
expect(result.dailyResetHour).toBe(4);
|
|
26
|
-
expect(result.dailyResetTimezone).toBe("");
|
|
27
|
-
expect(result.idleTimeoutMs).toBe(14_400_000);
|
|
28
|
-
expect(result.sweepIntervalMs).toBe(300_000);
|
|
29
|
-
expect(result.resetTriggers).toEqual([]);
|
|
30
|
-
expect(result.perType).toEqual({});
|
|
31
|
-
});
|
|
32
|
-
it("rejects invalid enum values for mode", () => {
|
|
33
|
-
const result = SessionResetPolicySchema.safeParse({ mode: "weekly" });
|
|
34
|
-
expect(result.success).toBe(false);
|
|
35
|
-
});
|
|
36
|
-
it("rejects dailyResetHour out of range (24)", () => {
|
|
37
|
-
const result = SessionResetPolicySchema.safeParse({ dailyResetHour: 24 });
|
|
38
|
-
expect(result.success).toBe(false);
|
|
39
|
-
});
|
|
40
|
-
it("rejects negative dailyResetHour", () => {
|
|
41
|
-
const result = SessionResetPolicySchema.safeParse({ dailyResetHour: -1 });
|
|
42
|
-
expect(result.success).toBe(false);
|
|
43
|
-
});
|
|
44
|
-
it("rejects zero idleTimeoutMs", () => {
|
|
45
|
-
const result = SessionResetPolicySchema.safeParse({ idleTimeoutMs: 0 });
|
|
46
|
-
expect(result.success).toBe(false);
|
|
47
|
-
});
|
|
48
|
-
it("accepts perType overrides", () => {
|
|
49
|
-
const result = SessionResetPolicySchema.safeParse({
|
|
50
|
-
perType: {
|
|
51
|
-
dm: { mode: "idle", idleTimeoutMs: 3_600_000 },
|
|
52
|
-
group: { mode: "daily", dailyResetHour: 3 },
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
expect(result.success).toBe(true);
|
|
56
|
-
if (result.success) {
|
|
57
|
-
expect(result.data.perType.dm?.mode).toBe("idle");
|
|
58
|
-
expect(result.data.perType.group?.dailyResetHour).toBe(3);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
describe("ResetPolicyOverrideSchema", () => {
|
|
63
|
-
it("parses valid override configuration", () => {
|
|
64
|
-
const result = ResetPolicyOverrideSchema.safeParse({
|
|
65
|
-
mode: "daily",
|
|
66
|
-
dailyResetHour: 8,
|
|
67
|
-
dailyResetTimezone: "UTC",
|
|
68
|
-
idleTimeoutMs: 1_800_000,
|
|
69
|
-
});
|
|
70
|
-
expect(result.success).toBe(true);
|
|
71
|
-
if (result.success) {
|
|
72
|
-
expect(result.data.mode).toBe("daily");
|
|
73
|
-
expect(result.data.dailyResetHour).toBe(8);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
it("accepts empty object (all fields optional)", () => {
|
|
77
|
-
const result = ResetPolicyOverrideSchema.safeParse({});
|
|
78
|
-
expect(result.success).toBe(true);
|
|
79
|
-
if (result.success) {
|
|
80
|
-
expect(result.data.mode).toBeUndefined();
|
|
81
|
-
expect(result.data.dailyResetHour).toBeUndefined();
|
|
82
|
-
expect(result.data.dailyResetTimezone).toBeUndefined();
|
|
83
|
-
expect(result.data.idleTimeoutMs).toBeUndefined();
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
it("rejects invalid mode enum", () => {
|
|
87
|
-
const result = ResetPolicyOverrideSchema.safeParse({ mode: "weekly" });
|
|
88
|
-
expect(result.success).toBe(false);
|
|
89
|
-
});
|
|
90
|
-
it("rejects dailyResetHour > 23", () => {
|
|
91
|
-
const result = ResetPolicyOverrideSchema.safeParse({ dailyResetHour: 25 });
|
|
92
|
-
expect(result.success).toBe(false);
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
describe("DmScopeConfigSchema", () => {
|
|
96
|
-
it("parses valid DM scope config", () => {
|
|
97
|
-
const result = DmScopeConfigSchema.safeParse({
|
|
98
|
-
mode: "per-peer",
|
|
99
|
-
agentPrefix: true,
|
|
100
|
-
threadIsolation: true,
|
|
101
|
-
});
|
|
102
|
-
expect(result.success).toBe(true);
|
|
103
|
-
if (result.success) {
|
|
104
|
-
expect(result.data.mode).toBe("per-peer");
|
|
105
|
-
expect(result.data.agentPrefix).toBe(true);
|
|
106
|
-
expect(result.data.threadIsolation).toBe(true);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
it("applies defaults for empty object", () => {
|
|
110
|
-
const result = DmScopeConfigSchema.parse({});
|
|
111
|
-
expect(result.mode).toBe("per-channel-peer");
|
|
112
|
-
expect(result.agentPrefix).toBe(false);
|
|
113
|
-
expect(result.threadIsolation).toBe(true);
|
|
114
|
-
});
|
|
115
|
-
it("rejects invalid mode enum", () => {
|
|
116
|
-
const result = DmScopeConfigSchema.safeParse({ mode: "global" });
|
|
117
|
-
expect(result.success).toBe(false);
|
|
118
|
-
});
|
|
119
|
-
it("accepts per-account-channel-peer mode", () => {
|
|
120
|
-
const result = DmScopeConfigSchema.safeParse({ mode: "per-account-channel-peer" });
|
|
121
|
-
expect(result.success).toBe(true);
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
describe("PruningConfigSchema", () => {
|
|
125
|
-
it("parses valid pruning config", () => {
|
|
126
|
-
const result = PruningConfigSchema.safeParse({
|
|
127
|
-
enabled: true,
|
|
128
|
-
softTrimThresholdChars: 10_000,
|
|
129
|
-
hardClearThresholdChars: 50_000,
|
|
130
|
-
preserveHeadChars: 1_000,
|
|
131
|
-
preserveTailChars: 1_000,
|
|
132
|
-
pruneableTools: ["bash"],
|
|
133
|
-
protectedTools: ["file_read"],
|
|
134
|
-
protectImageBlocks: false,
|
|
135
|
-
preserveRecentCount: 4,
|
|
136
|
-
});
|
|
137
|
-
expect(result.success).toBe(true);
|
|
138
|
-
if (result.success) {
|
|
139
|
-
expect(result.data.softTrimThresholdChars).toBe(10_000);
|
|
140
|
-
expect(result.data.protectImageBlocks).toBe(false);
|
|
141
|
-
expect(result.data.pruneableTools).toEqual(["bash"]);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
it("applies defaults for empty object", () => {
|
|
145
|
-
const result = PruningConfigSchema.parse({});
|
|
146
|
-
expect(result.enabled).toBe(true);
|
|
147
|
-
expect(result.softTrimThresholdChars).toBe(8_000);
|
|
148
|
-
expect(result.hardClearThresholdChars).toBe(30_000);
|
|
149
|
-
expect(result.preserveHeadChars).toBe(500);
|
|
150
|
-
expect(result.preserveTailChars).toBe(500);
|
|
151
|
-
expect(result.pruneableTools).toEqual([]);
|
|
152
|
-
expect(result.protectedTools).toEqual([]);
|
|
153
|
-
expect(result.protectImageBlocks).toBe(true);
|
|
154
|
-
expect(result.preserveRecentCount).toBe(6);
|
|
155
|
-
});
|
|
156
|
-
it("rejects negative softTrimThresholdChars", () => {
|
|
157
|
-
const result = PruningConfigSchema.safeParse({ softTrimThresholdChars: -1 });
|
|
158
|
-
expect(result.success).toBe(false);
|
|
159
|
-
});
|
|
160
|
-
it("rejects zero hardClearThresholdChars", () => {
|
|
161
|
-
const result = PruningConfigSchema.safeParse({ hardClearThresholdChars: 0 });
|
|
162
|
-
expect(result.success).toBe(false);
|
|
163
|
-
});
|
|
164
|
-
it("allows zero for preserveHeadChars (nonnegative)", () => {
|
|
165
|
-
const result = PruningConfigSchema.safeParse({ preserveHeadChars: 0 });
|
|
166
|
-
expect(result.success).toBe(true);
|
|
167
|
-
if (result.success) {
|
|
168
|
-
expect(result.data.preserveHeadChars).toBe(0);
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
describe("SessionCompactionConfigSchema", () => {
|
|
173
|
-
it("parses valid compaction config", () => {
|
|
174
|
-
const result = SessionCompactionConfigSchema.safeParse({
|
|
175
|
-
softThresholdRatio: 0.6,
|
|
176
|
-
hardThresholdRatio: 0.85,
|
|
177
|
-
flushModel: "claude-haiku-3",
|
|
178
|
-
chunkMaxChars: 40_000,
|
|
179
|
-
chunkOverlapMessages: 3,
|
|
180
|
-
chunkMergeSummaries: false,
|
|
181
|
-
reserveTokens: 4096,
|
|
182
|
-
keepRecentTokens: 8192,
|
|
183
|
-
});
|
|
184
|
-
expect(result.success).toBe(true);
|
|
185
|
-
if (result.success) {
|
|
186
|
-
expect(result.data.softThresholdRatio).toBe(0.6);
|
|
187
|
-
expect(result.data.hardThresholdRatio).toBe(0.85);
|
|
188
|
-
expect(result.data.flushModel).toBe("claude-haiku-3");
|
|
189
|
-
expect(result.data.chunkMergeSummaries).toBe(false);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
it("applies defaults for empty object", () => {
|
|
193
|
-
const result = SessionCompactionConfigSchema.parse({});
|
|
194
|
-
expect(result.softThresholdRatio).toBe(0.75);
|
|
195
|
-
expect(result.hardThresholdRatio).toBe(0.90);
|
|
196
|
-
expect(result.flushModel).toBeUndefined();
|
|
197
|
-
expect(result.chunkMaxChars).toBe(50_000);
|
|
198
|
-
expect(result.chunkOverlapMessages).toBe(2);
|
|
199
|
-
expect(result.chunkMergeSummaries).toBe(true);
|
|
200
|
-
expect(result.reserveTokens).toBe(16384);
|
|
201
|
-
expect(result.keepRecentTokens).toBe(32768);
|
|
202
|
-
});
|
|
203
|
-
it("rejects softThresholdRatio > 1", () => {
|
|
204
|
-
const result = SessionCompactionConfigSchema.safeParse({ softThresholdRatio: 1.5 });
|
|
205
|
-
expect(result.success).toBe(false);
|
|
206
|
-
});
|
|
207
|
-
it("rejects negative hardThresholdRatio", () => {
|
|
208
|
-
const result = SessionCompactionConfigSchema.safeParse({ hardThresholdRatio: -0.1 });
|
|
209
|
-
expect(result.success).toBe(false);
|
|
210
|
-
});
|
|
211
|
-
it("rejects zero reserveTokens", () => {
|
|
212
|
-
const result = SessionCompactionConfigSchema.safeParse({ reserveTokens: 0 });
|
|
213
|
-
expect(result.success).toBe(false);
|
|
214
|
-
});
|
|
215
|
-
it("round-trip: parse then re-parse produces identical result", () => {
|
|
216
|
-
const first = SessionCompactionConfigSchema.parse({
|
|
217
|
-
softThresholdRatio: 0.5,
|
|
218
|
-
chunkMaxChars: 25_000,
|
|
219
|
-
});
|
|
220
|
-
const second = SessionCompactionConfigSchema.parse(first);
|
|
221
|
-
expect(second).toEqual(first);
|
|
222
|
-
});
|
|
223
|
-
it("defaults postCompactionSections to ['Session Startup', 'Red Lines']", () => {
|
|
224
|
-
const result = SessionCompactionConfigSchema.parse({});
|
|
225
|
-
expect(result.postCompactionSections).toEqual(["Session Startup", "Red Lines"]);
|
|
226
|
-
});
|
|
227
|
-
it("accepts custom postCompactionSections array", () => {
|
|
228
|
-
const result = SessionCompactionConfigSchema.parse({
|
|
229
|
-
postCompactionSections: ["Custom Section", "Another"],
|
|
230
|
-
});
|
|
231
|
-
expect(result.postCompactionSections).toEqual(["Custom Section", "Another"]);
|
|
232
|
-
});
|
|
233
|
-
it("parses without postCompactionSections field (gets default)", () => {
|
|
234
|
-
const result = SessionCompactionConfigSchema.safeParse({
|
|
235
|
-
softThresholdRatio: 0.8,
|
|
236
|
-
});
|
|
237
|
-
expect(result.success).toBe(true);
|
|
238
|
-
if (result.success) {
|
|
239
|
-
expect(result.data.postCompactionSections).toEqual(["Session Startup", "Red Lines"]);
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|