@cortexkit/opencode-magic-context 0.26.0 → 0.27.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.
- package/README.md +14 -12
- package/dist/agents/dreamer.d.ts +19 -0
- package/dist/agents/dreamer.d.ts.map +1 -1
- package/dist/agents/hidden-agent-registrations.d.ts +67 -0
- package/dist/agents/hidden-agent-registrations.d.ts.map +1 -0
- package/dist/agents/historian.d.ts +1 -0
- package/dist/agents/historian.d.ts.map +1 -1
- package/dist/agents/permissions.d.ts +15 -44
- package/dist/agents/permissions.d.ts.map +1 -1
- package/dist/agents/smart-note-compiler.d.ts +2 -0
- package/dist/agents/smart-note-compiler.d.ts.map +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/migrate-config-location.d.ts +89 -0
- package/dist/config/migrate-config-location.d.ts.map +1 -0
- package/dist/config/migrate-dreamer-v2.d.ts +37 -0
- package/dist/config/migrate-dreamer-v2.d.ts.map +1 -0
- package/dist/config/migrate-experimental.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +3 -0
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/prune-config-leaf.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +584 -60
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +9 -3
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify-prompt.d.ts +50 -0
- package/dist/features/magic-context/dreamer/classify-prompt.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/classify.d.ts +22 -0
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/cron.d.ts +72 -0
- package/dist/features/magic-context/dreamer/cron.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts +30 -0
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/index.d.ts +1 -3
- package/dist/features/magic-context/dreamer/index.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/lease.d.ts +44 -6
- package/dist/features/magic-context/dreamer/lease.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/maintain-docs-protected-enforcement.d.ts +13 -0
- package/dist/features/magic-context/dreamer/maintain-docs-protected-enforcement.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts +36 -0
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts +22 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/open-opencode-db.d.ts +7 -0
- package/dist/features/magic-context/dreamer/open-opencode-db.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/primer-seed.d.ts +25 -0
- package/dist/features/magic-context/dreamer/primer-seed.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/promote-primers.d.ts +21 -0
- package/dist/features/magic-context/dreamer/promote-primers.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/protected-regions.d.ts +19 -0
- package/dist/features/magic-context/dreamer/protected-regions.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts +30 -0
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/retrospective-learnings.d.ts +47 -0
- package/dist/features/magic-context/dreamer/retrospective-learnings.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts +48 -0
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts +81 -0
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +8 -0
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts +82 -0
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-config.d.ts +28 -0
- package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts +49 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-gates.d.ts +29 -0
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-prompts.d.ts +37 -6
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +48 -0
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +88 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify-gate.d.ts +43 -0
- package/dist/features/magic-context/dreamer/verify-gate.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts +41 -0
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify.d.ts +43 -0
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -0
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts +2 -0
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/storage-git-commit-embeddings.d.ts +4 -4
- package/dist/features/magic-context/git-commits/storage-git-commit-embeddings.d.ts.map +1 -1
- package/dist/features/magic-context/index.d.ts +1 -0
- package/dist/features/magic-context/index.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-cache.d.ts +2 -2
- package/dist/features/magic-context/memory/embedding-cache.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts +12 -5
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts +2 -2
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/index.d.ts +4 -1
- package/dist/features/magic-context/memory/index.d.ts.map +1 -1
- package/dist/features/magic-context/memory/memory-migration.d.ts +1 -0
- package/dist/features/magic-context/memory/memory-migration.d.ts.map +1 -1
- package/dist/features/magic-context/memory/promotion.d.ts +16 -4
- package/dist/features/magic-context/memory/promotion.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts +2 -2
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-verifications.d.ts +31 -0
- package/dist/features/magic-context/memory/storage-memory-verifications.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory.d.ts +12 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/memory/types.d.ts +4 -0
- package/dist/features/magic-context/memory/types.d.ts.map +1 -1
- package/dist/features/magic-context/memory/verification-paths.d.ts +32 -0
- package/dist/features/magic-context/memory/verification-paths.d.ts.map +1 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/primer-clustering.d.ts +29 -0
- package/dist/features/magic-context/primer-clustering.d.ts.map +1 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts +25 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +12 -2
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/capabilities.d.ts +31 -0
- package/dist/features/magic-context/smart-notes/capabilities.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/compiler-prompt.d.ts +2 -0
- package/dist/features/magic-context/smart-notes/compiler-prompt.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/compiler.d.ts +52 -0
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/index.d.ts +10 -0
- package/dist/features/magic-context/smart-notes/index.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/runner.d.ts +18 -0
- package/dist/features/magic-context/smart-notes/runner.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts +22 -0
- package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/schedule.d.ts +9 -0
- package/dist/features/magic-context/smart-notes/schedule.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/ssrf-guard.d.ts +49 -0
- package/dist/features/magic-context/smart-notes/ssrf-guard.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/storage.d.ts +27 -0
- package/dist/features/magic-context/smart-notes/storage.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/types.d.ts +63 -0
- package/dist/features/magic-context/smart-notes/types.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +5 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +8 -4
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +3 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-notes.d.ts +15 -0
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
- package/dist/features/magic-context/storage-primers.d.ts +85 -0
- package/dist/features/magic-context/storage-primers.d.ts.map +1 -0
- package/dist/features/magic-context/storage-tags.d.ts +20 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +2 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +6 -0
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/tool-owner-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +10 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/features/magic-context/types.d.ts +2 -0
- package/dist/features/magic-context/types.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts +5 -0
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +18 -0
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
- package/dist/features/magic-context/v22-deferred-backfill.d.ts.map +1 -1
- package/dist/hooks/auto-update-checker/semver.d.ts +9 -0
- package/dist/hooks/auto-update-checker/semver.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +8 -15
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-parser.d.ts +9 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts +4 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +8 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts +2 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +1 -0
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +0 -3
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts +2 -0
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +17 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +8 -5
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +0 -2
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17028 -4059
- package/dist/plugin/dream-timer.d.ts +17 -9
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/embedding-bootstrap-helpers.d.ts +1 -1
- package/dist/plugin/embedding-bootstrap-helpers.d.ts.map +1 -1
- package/dist/plugin/embedding-bootstrap.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +211 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/instance-disposal.d.ts +2 -0
- package/dist/plugin/instance-disposal.d.ts.map +1 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/shared/announcement.d.ts +1 -1
- package/dist/shared/announcement.d.ts.map +1 -1
- package/dist/shared/data-path.d.ts +26 -7
- package/dist/shared/data-path.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts +48 -2
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/redaction.d.ts +7 -0
- package/dist/shared/redaction.d.ts.map +1 -0
- package/dist/shared/resolve-fallbacks.d.ts +12 -0
- package/dist/shared/resolve-fallbacks.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +2 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/subagent-runner.d.ts +12 -3
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/shared/tui-config.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/types.d.ts.map +1 -1
- package/dist/tools/ctx-memory/verification-recording.d.ts +8 -0
- package/dist/tools/ctx-memory/verification-recording.d.ts.map +1 -0
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/types.d.ts +1 -1
- package/dist/tools/ctx-search/types.d.ts.map +1 -1
- package/dist/tui/data/context-db.d.ts +2 -0
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/shared/announcement.test.ts +20 -0
- package/src/shared/announcement.ts +19 -7
- package/src/shared/data-path.test.ts +70 -6
- package/src/shared/data-path.ts +50 -8
- package/src/shared/model-suggestion-retry.test.ts +79 -2
- package/src/shared/model-suggestion-retry.ts +181 -3
- package/src/shared/redaction.test.ts +48 -0
- package/src/shared/redaction.ts +240 -0
- package/src/shared/resolve-fallbacks.ts +14 -0
- package/src/shared/rpc-server.ts +24 -0
- package/src/shared/rpc-types.ts +2 -0
- package/src/shared/subagent-runner.ts +12 -3
- package/src/shared/tui-config.test.ts +63 -0
- package/src/shared/tui-config.ts +67 -39
- package/src/tui/data/context-db.ts +12 -0
- package/src/tui/index.tsx +87 -17
- package/src/tui/slots/sidebar-content.tsx +4 -0
- package/dist/features/magic-context/dreamer/queue.d.ts +0 -55
- package/dist/features/magic-context/dreamer/queue.d.ts.map +0 -1
- package/dist/features/magic-context/dreamer/runner.d.ts +0 -92
- package/dist/features/magic-context/dreamer/runner.d.ts.map +0 -1
- package/dist/features/magic-context/dreamer/scheduler.d.ts +0 -29
- package/dist/features/magic-context/dreamer/scheduler.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/aft-availability.d.ts +0 -11
- package/dist/features/magic-context/key-files/aft-availability.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/identify-key-files.d.ts +0 -84
- package/dist/features/magic-context/key-files/identify-key-files.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/project-key-files.d.ts +0 -42
- package/dist/features/magic-context/key-files/project-key-files.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/read-history.d.ts +0 -26
- package/dist/features/magic-context/key-files/read-history.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/read-stats.d.ts +0 -18
- package/dist/features/magic-context/key-files/read-stats.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/storage-key-files.d.ts +0 -20
- package/dist/features/magic-context/key-files/storage-key-files.d.ts.map +0 -1
- package/dist/hooks/magic-context/key-files-block.d.ts +0 -27
- package/dist/hooks/magic-context/key-files-block.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magic-context.d.ts","sourceRoot":"","sources":["../../../src/config/schema/magic-context.ts"],"names":[],"mappings":"AAAA,OA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
|
|
@@ -28,19 +28,21 @@
|
|
|
28
28
|
*/
|
|
29
29
|
export declare function generateMessageId(timestampMs: number, counter?: bigint): string;
|
|
30
30
|
export declare function generatePartId(timestampMs: number, counter?: bigint): string;
|
|
31
|
+
export declare function getOpenCodeDbPath(): string;
|
|
31
32
|
export declare function closeCompactionMarkerDb(): void;
|
|
32
|
-
interface BoundaryUserMessage {
|
|
33
|
+
export interface BoundaryUserMessage {
|
|
33
34
|
id: string;
|
|
34
35
|
timeCreated: number;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
|
-
* Find the nearest user message at or before the given
|
|
38
|
+
* Find the nearest user message at or before the given end message id.
|
|
38
39
|
* The boundary must be a user message for filterCompacted to work.
|
|
39
40
|
*
|
|
40
41
|
* Filters out compaction summary messages (summary=true, finish="stop")
|
|
41
42
|
* so ordinals stay consistent with readRawSessionMessagesFromDb.
|
|
42
43
|
*/
|
|
43
|
-
export declare function findBoundaryUserMessage(sessionId: string,
|
|
44
|
+
export declare function findBoundaryUserMessage(sessionId: string, endMessageId: string): BoundaryUserMessage | null;
|
|
45
|
+
export declare function compareOpenCodeMessagesByCanonicalOrder(sessionId: string, leftMessageId: string, rightMessageId: string): number | null;
|
|
44
46
|
/**
|
|
45
47
|
* Check whether an OpenCode message ID still exists for a given session.
|
|
46
48
|
*
|
|
@@ -72,10 +74,14 @@ export interface InjectCompactionMarkerArgs {
|
|
|
72
74
|
sessionId: string;
|
|
73
75
|
/** Raw ordinal of the last compartmentalized message */
|
|
74
76
|
endOrdinal: number;
|
|
77
|
+
/** OpenCode message id of the last compartmentalized message */
|
|
78
|
+
endMessageId: string;
|
|
75
79
|
/** Summary text for the compaction summary message (static placeholder) */
|
|
76
80
|
summaryText: string;
|
|
77
81
|
/** Working directory for the session */
|
|
78
82
|
directory: string;
|
|
83
|
+
/** Boundary resolved before removing the old marker (prevents null-boundary cache busts). */
|
|
84
|
+
resolvedBoundary?: BoundaryUserMessage;
|
|
79
85
|
}
|
|
80
86
|
/**
|
|
81
87
|
* Inject a compaction marker into OpenCode's DB.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction-marker.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAgCH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAE3E;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAExE;
|
|
1
|
+
{"version":3,"file":"compaction-marker.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAgCH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAE3E;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAExE;AAID,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAkGD,wBAAgB,uBAAuB,IAAI,IAAI,CAY9C;AAID,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACvB;AA6BD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACrB,mBAAmB,GAAG,IAAI,CAoC5B;AAED,wBAAgB,uCAAuC,CACnD,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,GACvB,MAAM,GAAG,IAAI,CASf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAClB;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAMvB;AAID,UAAU,qBAAqB;IAC3B,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;CACzB;AAID,MAAM,WAAW,0BAA0B;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,6FAA6F;IAC7F,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,0BAA0B,GACjC,qBAAqB,GAAG,IAAI,CAyF9B;AAID;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAgB5E"}
|
|
@@ -78,7 +78,7 @@ export declare function chunkEmbeddingWindowsAreCurrent(db: Database, compartmen
|
|
|
78
78
|
export declare function replaceCompartmentChunkEmbeddings(db: Database, rows: readonly SaveCompartmentChunkEmbeddingInput[]): void;
|
|
79
79
|
export declare function getDistinctChunkEmbeddingModelIds(db: Database, projectPath: string): Set<string | null>;
|
|
80
80
|
export declare function clearChunkEmbeddingsForProject(db: Database, projectPath: string, modelId?: string): number;
|
|
81
|
-
export declare function loadCompartmentChunkEmbeddingsForSearch(db: Database, sessionId: string, projectPath: string, modelId
|
|
81
|
+
export declare function loadCompartmentChunkEmbeddingsForSearch(db: Database, sessionId: string, projectPath: string, modelId: string): StoredCompartmentChunkEmbedding[];
|
|
82
82
|
export declare function loadUnembeddedCompartmentChunkCandidates(db: Database, projectPath: string, modelId: string, limit: number): CompartmentChunkBackfillCandidate[];
|
|
83
83
|
/** Session-scoped variant of {@link loadUnembeddedCompartmentChunkCandidates}.
|
|
84
84
|
* Used by the on-demand `/ctx-embed-history` command, which backfills ONE
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compartment-chunk-embedding.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compartment-chunk-embedding.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,qBAAqB,CAAC;AAEpF,eAAO,MAAM,0CAA0C,MAAM,CAAC;AAE9D;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAwC7C,MAAM,WAAW,iCAAiC;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,+BAA+B;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,kCAAkC;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"compartment-chunk-embedding.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compartment-chunk-embedding.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,qBAAqB,CAAC;AAEpF,eAAO,MAAM,0CAA0C,MAAM,CAAC;AAE9D;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAwC7C,MAAM,WAAW,iCAAiC;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,+BAA+B;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WA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
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* classify-memories prompt + manifest parser (non-agentic single-shot transform).
|
|
3
|
+
*
|
|
4
|
+
* classify scores each memory's importance (1-100), scope, and shareability from
|
|
5
|
+
* the memory TEXT alone (no code inspection). The reworked task is a PURE
|
|
6
|
+
* transform: the host renders one prompt, the zero-tool dreamer-classifier agent
|
|
7
|
+
* emits ONE XML manifest, and the host batch-applies the columns via
|
|
8
|
+
* setMemoryClassification (cache-neutral). No per-memory tool calls.
|
|
9
|
+
*
|
|
10
|
+
* Importance/scope/shareability GUIDANCE is the harness-validated text (DS4F:
|
|
11
|
+
* 229 importances assigned, correct discrimination, 4/4 private controls held).
|
|
12
|
+
*/
|
|
13
|
+
export interface ClassifyPromptMemory {
|
|
14
|
+
id: number;
|
|
15
|
+
category: string;
|
|
16
|
+
content: string;
|
|
17
|
+
importance: number;
|
|
18
|
+
scope: "project" | "ecosystem" | "universe";
|
|
19
|
+
shareable: number | boolean;
|
|
20
|
+
}
|
|
21
|
+
/** A few already-classified memories shown as scoring ANCHORS in Stage 3 (large
|
|
22
|
+
* pools), so the model calibrates the new/changed memories against the existing
|
|
23
|
+
* distribution instead of re-scoring in a vacuum. */
|
|
24
|
+
export interface ClassifyAnchorMemory {
|
|
25
|
+
id: number;
|
|
26
|
+
category: string;
|
|
27
|
+
content: string;
|
|
28
|
+
importance: number;
|
|
29
|
+
}
|
|
30
|
+
export declare const CLASSIFY_SYSTEM_PROMPT = "You are a memory classifier for the magic-context system. You classify project memories by metadata only. You do NOT rewrite, merge, archive, verify, or create memories, and you do NOT read code \u2014 you judge each memory from its own text.\n\n### How to score importance (1-100)\nImportance decides which memories survive when the injected memory block is over budget: high scores stay in context, low scores drop first. So the score is only useful if it **discriminates** \u2014 if most memories land in the same band, you have not classified them, you have just labelled them.\n\nUse judgment, not a formula. Blend:\n- **Durability / decay-rate value:** Will this fact still matter weeks from now, across sessions?\n- **Operational impact:** Would missing this fact cause wrong code, wasted time, broken workflows, or violated constraints?\n\nMost memories are ordinary working facts \u2014 they belong in the middle, not the top. Reserve the high band for the genuinely load-bearing handful a teammate would be sunk without; push routine observations, one-off details, and now-obvious facts down. A \"real, true fact\" is not automatically important \u2014 truth is not importance.\n\nRough anchors (not quotas \u2014 spread naturally within them): transient/obvious observations 1-30, ordinary helpful project facts 40-65, load-bearing rules/architecture/constraints 70-100. A constraint that is a genuine must/never/always rule the project actively depends on floors around 60; but not every memory in a category is load-bearing \u2014 a niche, dated, or narrowly-scoped external quirk can sit lower even if it is a \"constraint\". Score the fact, not the label. If you assigned most of the pool to one band, re-read and differentiate.\n\n### Scope\n- `project` \u2014 only meaningful inside this repository/product (default when uncertain).\n- `ecosystem` \u2014 useful to sibling projects in the same stack, harness, provider, or company ecosystem.\n- `universe` \u2014 broadly true outside this codebase (protocol/platform/API facts), still written as a concise memory.\n\n### Shareability\nShareability is about EXPOSURE, not scope: **would a teammate working on THIS SAME project benefit from seeing this memory, and is it free of anything personal, local, or sensitive?** If yes, set `shareable=\"true\"`. This is the COMMON case \u2014 most project knowledge is exactly what you'd hand a new teammate: architecture, design rules, conventions, constraints, file locations, hard-won gotchas. Mark those shareable even though they are specific to this repo's internals.\n\nKeep `shareable=\"false\"` only for what is tied to the USER or their machine rather than the project: personal/absolute paths, usernames, local or private endpoints (e.g. localhost), credentials/secrets/tokens, customer data, machine-specific config, and personal working-style preferences. A fact's scope does NOT decide shareability. The host also fails closed and forces secret/credential/personal-path text to private regardless.\n\nOutput ONE XML manifest at the very end and NOTHING else \u2014 no narration, no per-memory commentary, no reasoning:\n<classify>\n<memory id=\"N\" importance=\"75\" scope=\"project\" shareable=\"true\"/>\n<memory id=\"M\" importance=\"20\" scope=\"universe\" shareable=\"false\"/>\n</classify>\n\nRules:\n- Every memory in the pool below MUST appear exactly once.\n- importance is an integer 1-100; scope is one of project|ecosystem|universe; shareable is true|false.";
|
|
31
|
+
/**
|
|
32
|
+
* Build the classify prompt for a batch. `anchors` (optional) are existing
|
|
33
|
+
* classified memories shown for distribution calibration in large pools; they
|
|
34
|
+
* are NOT scored and must NOT appear in the manifest.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildClassifyPrompt(args: {
|
|
37
|
+
projectPath: string;
|
|
38
|
+
memories: ClassifyPromptMemory[];
|
|
39
|
+
anchors?: ClassifyAnchorMemory[];
|
|
40
|
+
}): string;
|
|
41
|
+
export interface ParsedClassification {
|
|
42
|
+
id: number;
|
|
43
|
+
importance?: number;
|
|
44
|
+
scope?: "project" | "ecosystem" | "universe";
|
|
45
|
+
shareable?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** Parse the agent's `<classify>` manifest. Tolerant of attribute order; a
|
|
48
|
+
* memory missing a valid attribute simply omits that field (host skips it). */
|
|
49
|
+
export declare function parseClassifyManifest(text: string): ParsedClassification[];
|
|
50
|
+
//# sourceMappingURL=classify-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify-prompt.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/classify-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC5C,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED;;sDAEsD;AACtD,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACtB;AAiCD,eAAO,MAAM,sBAAsB,w6GAIhB,CAAC;AAsBpB;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACpC,GAAG,MAAM,CAST;AAED,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAID;gFACgF;AAChF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAAE,CA8B1E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PluginContext } from "../../../plugin/types";
|
|
2
|
+
import type { Database } from "../../../shared/sqlite";
|
|
3
|
+
export interface ClassifyArgs {
|
|
4
|
+
db: Database;
|
|
5
|
+
client: PluginContext["client"];
|
|
6
|
+
projectIdentity: string;
|
|
7
|
+
parentSessionId: string | undefined;
|
|
8
|
+
sessionDirectory: string;
|
|
9
|
+
holderId: string;
|
|
10
|
+
leaseKey: string;
|
|
11
|
+
deadline: number;
|
|
12
|
+
model?: string;
|
|
13
|
+
fallbackModels?: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ClassifyResult {
|
|
16
|
+
classified: number;
|
|
17
|
+
changed: number;
|
|
18
|
+
chunks: number;
|
|
19
|
+
stage: 1 | 2 | 3;
|
|
20
|
+
}
|
|
21
|
+
export declare function runClassify(args: ClassifyArgs): Promise<ClassifyResult>;
|
|
22
|
+
//# sourceMappingURL=classify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/classify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAQ3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AA0CvD,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,cAAc;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACpB;AAuCD,wBAAsB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAuE7E"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal 5-field cron evaluator for per-task dreamer scheduling.
|
|
3
|
+
*
|
|
4
|
+
* Why vendored (no dependency): we only need "next occurrence after time T", the
|
|
5
|
+
* 3-day package-release-age floor makes pulling a dep awkward, and the surface is
|
|
6
|
+
* small. Shared core — both OpenCode and Pi import this via @magic-context/core.
|
|
7
|
+
*
|
|
8
|
+
* Fields: `minute hour day-of-month month day-of-week`
|
|
9
|
+
* minute 0-59 · hour 0-23 · dom 1-31 · month 1-12 · dow 0-6 (0 or 7 = Sunday)
|
|
10
|
+
* Each field supports: a star wildcard, a star-with-step (every-N), a single
|
|
11
|
+
* value `a`, a range `a-b`, a range-with-step `a-b/step`, an open step `a/step`
|
|
12
|
+
* (a..max), and comma-lists of any of those. Numeric only — month and weekday
|
|
13
|
+
* NAMES are intentionally unsupported (smaller surface; add later if asked).
|
|
14
|
+
* Empty string `""` means "never" and is handled by the caller, not here.
|
|
15
|
+
*
|
|
16
|
+
* Day matching uses Vixie OR-semantics: when BOTH dom and dow are restricted
|
|
17
|
+
* (not `*`), a day matches if EITHER matches; when only one is restricted, only
|
|
18
|
+
* that one is consulted; when neither is restricted, every day matches.
|
|
19
|
+
*
|
|
20
|
+
* Timezone: all matching is in the machine's LOCAL time — the dreamer's whole
|
|
21
|
+
* purpose is "run while the user is asleep", which is a wall-clock concept.
|
|
22
|
+
* nextOccurrence steps by real (epoch) minutes and reads LOCAL civil fields off
|
|
23
|
+
* each candidate, so DST transitions are handled correctly by construction (no
|
|
24
|
+
* setHours/local-constructor normalization, which is DST-ambiguous).
|
|
25
|
+
*/
|
|
26
|
+
export interface ParsedCron {
|
|
27
|
+
minute: Set<number>;
|
|
28
|
+
hour: Set<number>;
|
|
29
|
+
dom: Set<number>;
|
|
30
|
+
month: Set<number>;
|
|
31
|
+
dow: Set<number>;
|
|
32
|
+
/** Original field token was not `*` — drives Vixie dom/dow OR-semantics. */
|
|
33
|
+
domRestricted: boolean;
|
|
34
|
+
dowRestricted: boolean;
|
|
35
|
+
}
|
|
36
|
+
export type ParseCronResult = {
|
|
37
|
+
ok: true;
|
|
38
|
+
cron: ParsedCron;
|
|
39
|
+
} | {
|
|
40
|
+
ok: false;
|
|
41
|
+
error: string;
|
|
42
|
+
};
|
|
43
|
+
/** Parse a 5-field cron expression. Empty/whitespace is rejected here — callers
|
|
44
|
+
* treat `""` as "never" before calling. */
|
|
45
|
+
export declare function parseCron(expression: string): ParseCronResult;
|
|
46
|
+
/** True if the expression parses; thin wrapper for config validation. */
|
|
47
|
+
export declare function isValidCron(expression: string): boolean;
|
|
48
|
+
/** True if `date`'s local civil fields match the cron. */
|
|
49
|
+
export declare function matchesCron(cron: ParsedCron, date: Date): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* First instant strictly after `after` whose LOCAL civil time matches `cron`.
|
|
52
|
+
* Returns null if none within the ~4-year cap (effectively-never schedules).
|
|
53
|
+
*
|
|
54
|
+
* @param excludeCivilMinute Skip any candidate sharing this `YYYY-MM-DD HH:mm`
|
|
55
|
+
* key. Pass the just-consumed run's scheduled civil minute when advancing
|
|
56
|
+
* `next_due_at` so a DST fall-back's repeated wall minute doesn't double-fire
|
|
57
|
+
* the same daily slot. (For sub-hourly every-N schedules, only the exact
|
|
58
|
+
* consumed minute is skipped; the other repeated-hour minutes still fire, which
|
|
59
|
+
* is correct — more real time elapsed.)
|
|
60
|
+
*/
|
|
61
|
+
export declare function nextOccurrence(cron: ParsedCron, after: Date, excludeCivilMinute?: string): Date | null;
|
|
62
|
+
/**
|
|
63
|
+
* Convenience: parse + compute next-due epoch (ms) for a schedule string.
|
|
64
|
+
* Returns null for `""` / invalid / effectively-never schedules — the caller
|
|
65
|
+
* persists `next_due_at = NULL` in all of those cases.
|
|
66
|
+
*
|
|
67
|
+
* @param consumedScheduledAtMs When advancing after a run, pass the epoch of the
|
|
68
|
+
* slot just satisfied (the prior `next_due_at`); its civil minute is excluded
|
|
69
|
+
* to prevent the DST repeated-minute double-fire.
|
|
70
|
+
*/
|
|
71
|
+
export declare function nextDueAtMs(expression: string, afterMs: number, consumedScheduledAtMs?: number): number | null;
|
|
72
|
+
//# sourceMappingURL=cron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/cron.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClB,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjB,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjB,4EAA4E;IAC5E,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,eAAe,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA2E5F;4CAC4C;AAC5C,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAqC7D;AAED,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEvD;AAWD,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAOjE;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,IAAI,EACX,kBAAkB,CAAC,EAAE,MAAM,GAC5B,IAAI,GAAG,IAAI,CAgBb;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACvB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,qBAAqB,CAAC,EAAE,MAAM,GAC/B,MAAM,GAAG,IAAI,CAUf"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PluginContext } from "../../../plugin/types";
|
|
2
|
+
import type { Database } from "../../../shared/sqlite";
|
|
3
|
+
export interface EvaluateSmartNotesArgs {
|
|
4
|
+
db: Database;
|
|
5
|
+
client: PluginContext["client"];
|
|
6
|
+
projectIdentity: string;
|
|
7
|
+
parentSessionId: string | undefined;
|
|
8
|
+
sessionDirectory: string | undefined;
|
|
9
|
+
holderId: string;
|
|
10
|
+
/** Keyed lease this task holds (Dreamer v2: per-project evaluate-smart-notes domain). */
|
|
11
|
+
leaseKey: string;
|
|
12
|
+
deadline: number;
|
|
13
|
+
model?: string;
|
|
14
|
+
fallbackModels?: readonly string[];
|
|
15
|
+
onLeaseLost?: (phase: string, error?: unknown) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface EvaluateSmartNotesResult {
|
|
18
|
+
surfaced: number;
|
|
19
|
+
pending: number;
|
|
20
|
+
/** False when there were no pending notes requiring compile/fallback work. */
|
|
21
|
+
ran: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Compile and maintain smart-note checks. The legacy broad-tool agentic
|
|
25
|
+
* evaluator is intentionally retired: this task uses a no-tool compiler agent,
|
|
26
|
+
* runs code only in the QuickJS capability sandbox, and falls back to a no-tool
|
|
27
|
+
* read-only confirmation prompt when compilation repeatedly fails.
|
|
28
|
+
*/
|
|
29
|
+
export declare function evaluateSmartNotes(args: EvaluateSmartNotesArgs): Promise<EvaluateSmartNotesResult>;
|
|
30
|
+
//# sourceMappingURL=evaluate-smart-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluate-smart-notes.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/evaluate-smart-notes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAqBvD,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1D;AAED,MAAM,WAAW,wBAAwB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,GAAG,EAAE,OAAO,CAAC;CAChB;AAQD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACpC,IAAI,EAAE,sBAAsB,GAC7B,OAAO,CAAC,wBAAwB,CAAC,CAwGnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,8 +1,46 @@
|
|
|
1
1
|
import type { Database } from "../../../shared/sqlite";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Dreamer v2 uses one lease PER CONFLICT-DOMAIN (memory:<project>,
|
|
4
|
+
* key-files:<project>, user-memories, …) so disjoint-state tasks don't block
|
|
5
|
+
* each other while the memory-mutating tasks still serialize. A lease is three
|
|
6
|
+
* `dream_state` rows under a key namespace.
|
|
7
|
+
*
|
|
8
|
+
* `DREAMING_LEASE_KEY` is the legacy single-lease key. It keeps the original
|
|
9
|
+
* `acquireLease(db, holderId)` signature working (the lease-key param defaults to
|
|
10
|
+
* it) for the still-suite-based runner until the per-task scheduler replaces it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DREAMING_LEASE_KEY = "dreaming";
|
|
13
|
+
export declare function isLeaseActive(db: Database, leaseKey?: string): boolean;
|
|
14
|
+
export declare function getLeaseHolder(db: Database, leaseKey?: string): string | null;
|
|
15
|
+
export declare function peekLeaseHolderAndExpiry(db: Database, expectedHolder: string, leaseKey?: string): boolean;
|
|
16
|
+
export declare function acquireLease(db: Database, holderId: string, leaseKey?: string): boolean;
|
|
17
|
+
export declare function renewLease(db: Database, holderId: string, leaseKey?: string): boolean;
|
|
18
|
+
export interface LeaseHeartbeat {
|
|
19
|
+
/** Stop the heartbeat timer. Safe to call more than once. */
|
|
20
|
+
stop(): void;
|
|
21
|
+
/** True once the lease was confirmed genuinely lost (and onLost was called). */
|
|
22
|
+
readonly lost: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Keep a held lease alive on a background interval, tolerating transient DB
|
|
26
|
+
* contention. The brittle inline pattern this replaces aborted the whole task on
|
|
27
|
+
* the FIRST renewal hiccup — including a transient SQLITE_BUSY throw under a
|
|
28
|
+
* multi-instance lock storm — even though the 2-minute TTL means one missed 60s
|
|
29
|
+
* beat is harmless. That killed multi-minute dreamer runs (map-memories/verify)
|
|
30
|
+
* with "prompt aborted by external signal" when the lease was never actually
|
|
31
|
+
* lost.
|
|
32
|
+
*
|
|
33
|
+
* We declare the lease lost (and call onLost ONCE) only when:
|
|
34
|
+
* - a DIFFERENT holder actively owns it — renewLease fails and acquireLease
|
|
35
|
+
* can't reclaim it (acquireLease reclaims an expired-but-free lease, so a
|
|
36
|
+
* self-inflicted expiry from our own delayed beat recovers instead of
|
|
37
|
+
* killing the run); or
|
|
38
|
+
* - a full TTL has elapsed with no confirmed renewal (only reachable via
|
|
39
|
+
* repeated transient throws), past which exclusive ownership can't be
|
|
40
|
+
* guaranteed.
|
|
41
|
+
* A transient throw with a recent successful renewal is swallowed and retried on
|
|
42
|
+
* the next beat.
|
|
43
|
+
*/
|
|
44
|
+
export declare function startLeaseHeartbeat(db: Database, holderId: string, leaseKey: string, onLost: (reason: string) => void, intervalMs?: number): LeaseHeartbeat;
|
|
45
|
+
export declare function releaseLease(db: Database, holderId: string, leaseKey?: string): void;
|
|
8
46
|
//# sourceMappingURL=lease.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lease.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/lease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"lease.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/lease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKvD;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAmC7C,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAE,MAA2B,GAAG,OAAO,CAG1F;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAE,MAA2B,GAAG,MAAM,GAAG,IAAI,CAEjG;AAED,wBAAgB,wBAAwB,CACpC,EAAE,EAAE,QAAQ,EACZ,cAAc,EAAE,MAAM,EACtB,QAAQ,GAAE,MAA2B,GACtC,OAAO,CAQT;AA8BD,wBAAgB,YAAY,CACxB,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAA2B,GACtC,OAAO,CAgBT;AAED,wBAAgB,UAAU,CACtB,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAA2B,GACtC,OAAO,CAYT;AAMD,MAAM,WAAW,cAAc;IAC3B,6DAA6D;IAC7D,IAAI,IAAI,IAAI,CAAC;IACb,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAC/B,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAChC,UAAU,GAAE,MAAoC,GACjD,cAAc,CA0DhB;AAED,wBAAgB,YAAY,CACxB,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAA2B,GACtC,IAAI,CAWN"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const MAINTAIN_DOCS_SNAPSHOT_FILES: readonly ["ARCHITECTURE.md", "STRUCTURE.md"];
|
|
2
|
+
export type MaintainDocsDocSnapshot = Map<string, string>;
|
|
3
|
+
/** Read canonical pre-task bytes for maintain-docs enforcement. */
|
|
4
|
+
export declare function snapshotMaintainDocsFiles(docsDir: string): MaintainDocsDocSnapshot;
|
|
5
|
+
/**
|
|
6
|
+
* After maintain-docs, re-read on-disk docs and restore protected regions from the pre-task snapshot.
|
|
7
|
+
* Best-effort: read/write failures are logged, not thrown.
|
|
8
|
+
*/
|
|
9
|
+
export declare function enforceMaintainDocsProtectedRegions(args: {
|
|
10
|
+
docsDir: string;
|
|
11
|
+
snapshot: MaintainDocsDocSnapshot;
|
|
12
|
+
}): void;
|
|
13
|
+
//# sourceMappingURL=maintain-docs-protected-enforcement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintain-docs-protected-enforcement.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/maintain-docs-protected-enforcement.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B,8CAA+C,CAAC;AAEzF,MAAM,MAAM,uBAAuB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1D,mEAAmE;AACnE,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB,CAalF;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CAAC,IAAI,EAAE;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,uBAAuB,CAAC;CACrC,GAAG,IAAI,CAmBP"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* map-memories prompt + host-side helpers.
|
|
3
|
+
*
|
|
4
|
+
* map-memories is a ONE-TIME backfill: it locates the repo file(s) that back
|
|
5
|
+
* each project memory (or marks it file-independent), recording the mapping so
|
|
6
|
+
* the verify task can run incrementally from the start (verify reads "which
|
|
7
|
+
* files changed since this memory's verification" — without a mapping, the first
|
|
8
|
+
* verify would have to check the whole pool and time out, the cold-start trap).
|
|
9
|
+
*
|
|
10
|
+
* The agent only LOCATES backing files; the host parses its single XML manifest
|
|
11
|
+
* and writes the mappings via recordMemoryMapping (mapped, not yet content-
|
|
12
|
+
* verified). The prompt was calibrated in the shadow harness on real memory
|
|
13
|
+
* pools (DeepSeek-v4-Flash); see .alfonso/plans/dreamer-v2-rework.md.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MAP_MEMORIES_SYSTEM_PROMPT = "You are a memory mapper for the magic-context system. You map project memories to the repository files that back them.\n\nA memory's BACKING FILES are the file(s) whose code the memory makes a claim about \u2014 the files you would open to check whether the memory is accurate. You do NOT judge accuracy, rewrite, or remove anything. You only LOCATE backing files.\n\nTools (read-only): read, grep, glob, aft_search, aft_outline, aft_zoom. Each memory may come with \"Likely files\" already named in it and confirmed to exist \u2014 confirm those FIRST (cheap) instead of searching. Use search/grep to FIND code only when no likely files are given. Do not guess \u2014 confirm a file exists and genuinely backs the memory before listing it. Keep reads minimal: you do not need to read a whole file to confirm it backs a one-line claim.\n\nFor each memory decide ONE of:\n- Backing files found \u2192 the COMPLETE set of repo-relative paths whose code the memory is about.\n- File-independent \u2192 the memory describes EXTERNAL behavior (a provider / API / platform / protocol limit, e.g. \"Anthropic returns 400 on empty content\"), or a pure process / workflow / philosophy rule, with NO specific local file that backs it.\n\nOutput ONE XML manifest at the very end and NOTHING else \u2014 no narration, no per-memory commentary, no reasoning:\n<mappings>\n<memory id=\"N\" files=\"path/a.ts,path/b.ts\"/>\n<memory id=\"M\" independent=\"true\"/>\n</mappings>\n\nRules:\n- Every input memory id MUST appear exactly once.\n- files: repo-relative, comma-separated, no spaces inside a path. Only files that actually exist and genuinely back the memory.\n- A BACKING FILE is CODE that implements or handles the claim \u2014 not a file that merely mentions it. A markdown doc (.md), a PARITY/notes file, or a test that only DESCRIBES an external fact is NOT a backing file. If the only place a memory's fact appears is prose/docs/a test (no code implements or handles it), mark it independent=\"true\".\n- Many CONSTRAINTS are HYBRID: \"external system does X, and OUR code handles it here.\" Map those to the HANDLING code (you can verify the handling, even though you can't verify the external behavior). Only mark independent when there is NO local code that implements or handles the fact.\n- Prefer the most specific file(s); do not pad with tangential files. Most memories map to one file; some to a few.\n- When you genuinely cannot find any local backing and it is not clearly external, still emit the memory with independent=\"true\" (do not drop it).";
|
|
16
|
+
export declare const MAX_SEED_PATHS_PER_MEMORY = 3;
|
|
17
|
+
/** Extract candidate backing-file paths a memory NAMES, keep only those that
|
|
18
|
+
* EXIST in the repo, dedupe, cap. Pure host-side seeding — no LLM, no contents. */
|
|
19
|
+
export declare function extractMemoryCandidatePaths(content: string, repoDir: string): string[];
|
|
20
|
+
export interface MapMemoryInput {
|
|
21
|
+
id: number;
|
|
22
|
+
category: string;
|
|
23
|
+
content: string;
|
|
24
|
+
candidates: string[];
|
|
25
|
+
}
|
|
26
|
+
export declare function buildMapMemoriesPrompt(projectPath: string, memories: MapMemoryInput[]): string;
|
|
27
|
+
export interface ParsedMemoryMapping {
|
|
28
|
+
id: number;
|
|
29
|
+
files: string[];
|
|
30
|
+
independent: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Parse the agent's `<mappings>` manifest. Tolerant of attribute order and
|
|
33
|
+
* self-closing vs not; a memory with no files (and not explicitly independent)
|
|
34
|
+
* is treated as independent so it is recorded (never silently dropped). */
|
|
35
|
+
export declare function parseMapMemoriesManifest(text: string): ParsedMemoryMapping[];
|
|
36
|
+
//# sourceMappingURL=map-memories-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-memories-prompt.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/map-memories-prompt.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,0BAA0B,mgFAsB4G,CAAC;AAMpJ,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAW3C;oFACoF;AACpF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBtF;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CAkB9F;AAED,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;CACxB;AAED;;4EAE4E;AAC5E,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAmB5E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PluginContext } from "../../../plugin/types";
|
|
2
|
+
import type { Database } from "../../../shared/sqlite";
|
|
3
|
+
export interface MapMemoriesArgs {
|
|
4
|
+
db: Database;
|
|
5
|
+
client: PluginContext["client"];
|
|
6
|
+
projectIdentity: string;
|
|
7
|
+
parentSessionId: string | undefined;
|
|
8
|
+
sessionDirectory: string;
|
|
9
|
+
holderId: string;
|
|
10
|
+
leaseKey: string;
|
|
11
|
+
deadline: number;
|
|
12
|
+
model?: string;
|
|
13
|
+
fallbackModels?: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export interface MapMemoriesResult {
|
|
16
|
+
mapped: number;
|
|
17
|
+
independent: number;
|
|
18
|
+
batches: number;
|
|
19
|
+
remaining: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function mapMemories(args: MapMemoriesArgs): Promise<MapMemoriesResult>;
|
|
22
|
+
//# sourceMappingURL=map-memories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-memories.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/map-memories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAO3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAwCvD,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACrB;AAyBD,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAqCnF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Database } from "../../../shared/sqlite";
|
|
2
|
+
/**
|
|
3
|
+
* Open OpenCode's DB read-only (used by the key-files task's read-history scan).
|
|
4
|
+
* Returns null when absent or unopenable — callers degrade gracefully.
|
|
5
|
+
*/
|
|
6
|
+
export declare function openOpenCodeDb(): Database | null;
|
|
7
|
+
//# sourceMappingURL=open-opencode-db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-opencode-db.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/open-opencode-db.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD;;;GAGG;AACH,wBAAgB,cAAc,IAAI,QAAQ,GAAG,IAAI,CAchD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
|
+
import { type Primer } from "../storage-primers";
|
|
3
|
+
/** Token cap for the rendered orientation seed — a huge origin compartment must
|
|
4
|
+
* not blow the prompt; the investigator digs via tools, it does not need the
|
|
5
|
+
* whole chunk inline. */
|
|
6
|
+
export declare const PRIMER_SEED_CAP_TOKENS = 4000;
|
|
7
|
+
export interface PrimerSeed {
|
|
8
|
+
/** "raw" = U:/TC: orientation from the origin compartment; "closed-book" =
|
|
9
|
+
* origin compartment P1 (raw unavailable). */
|
|
10
|
+
kind: "raw" | "closed-book";
|
|
11
|
+
/** The orientation block (already token-capped). */
|
|
12
|
+
orientation: string;
|
|
13
|
+
/** P1 of the immediately-preceding and -following compartments, for context. */
|
|
14
|
+
prePost: string;
|
|
15
|
+
/** Session + ordinal range the orientation came from (for logging). */
|
|
16
|
+
sessionId: string | null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build the orientation seed for a primer from its most-recent occurrence's
|
|
20
|
+
* origin compartment. MUST be called inside a `withRawSessionMessageCache` scope
|
|
21
|
+
* (and, on Pi, with a RawMessageProvider registered for the session) so the raw
|
|
22
|
+
* read is cached across the run.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildPrimerSeed(db: Database, primer: Primer): PrimerSeed;
|
|
25
|
+
//# sourceMappingURL=primer-seed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primer-seed.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/primer-seed.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE3E;;0BAE0B;AAC1B,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,MAAM,WAAW,UAAU;IACvB;mDAC+C;IAC/C,IAAI,EAAE,KAAK,GAAG,aAAa,CAAC;IAC5B,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AA8FD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CA4CxE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PluginContext } from "../../../plugin/types";
|
|
2
|
+
import type { Database } from "../../../shared/sqlite";
|
|
3
|
+
export interface PromotePrimersArgs {
|
|
4
|
+
db: Database;
|
|
5
|
+
client: PluginContext["client"];
|
|
6
|
+
projectIdentity: string;
|
|
7
|
+
sessionDirectory: string;
|
|
8
|
+
holderId: string;
|
|
9
|
+
leaseKey: string;
|
|
10
|
+
deadline: number;
|
|
11
|
+
promotionThreshold?: number;
|
|
12
|
+
ensureProjectRegistered?: (directory: string, db: Database) => Promise<void> | void;
|
|
13
|
+
}
|
|
14
|
+
export interface PromotePrimersResult {
|
|
15
|
+
promoted: number;
|
|
16
|
+
updated: number;
|
|
17
|
+
candidates: number;
|
|
18
|
+
pruned: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function promotePrimers(args: PromotePrimersArgs): Promise<PromotePrimersResult>;
|
|
21
|
+
//# sourceMappingURL=promote-primers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promote-primers.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/promote-primers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAqBvD,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,uBAAuB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACvF;AAED,MAAM,WAAW,oBAAoB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAClB;AAoED,wBAAsB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAgG5F"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface EnforceProtectedRegionsResult {
|
|
2
|
+
/** The text to persist (candidate, repaired candidate, or original on reject). */
|
|
3
|
+
text: string;
|
|
4
|
+
violated: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ProtectedBlock {
|
|
7
|
+
/** Full identifying start-marker line (the line containing mc:protected START). */
|
|
8
|
+
startMarkerLine: string;
|
|
9
|
+
/** Bytes from START line through END line inclusive. */
|
|
10
|
+
block: string;
|
|
11
|
+
}
|
|
12
|
+
/** Extract every mc:protected region from `text`, keyed by the full START marker line. */
|
|
13
|
+
export declare function extractProtectedBlocks(text: string): ProtectedBlock[];
|
|
14
|
+
/**
|
|
15
|
+
* Enforce that every mc:protected region present in `original` is byte-identical
|
|
16
|
+
* in `candidate`. Returns the text to actually write and whether a violation was repaired.
|
|
17
|
+
*/
|
|
18
|
+
export declare function enforceProtectedRegions(original: string, candidate: string): EnforceProtectedRegionsResult;
|
|
19
|
+
//# sourceMappingURL=protected-regions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protected-regions.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/protected-regions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,6BAA6B;IAC1C,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACrB;AAKD,MAAM,WAAW,cAAc;IAC3B,mFAAmF;IACnF,eAAe,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,0FAA0F;AAC1F,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE,CAwBrE;AAkDD;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAClB,6BAA6B,CAqB/B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type RawMessageProvider } from "../../../hooks/magic-context/read-session-chunk";
|
|
2
|
+
import type { PluginContext } from "../../../plugin/types";
|
|
3
|
+
import type { Database } from "../../../shared/sqlite";
|
|
4
|
+
export interface RefreshPrimersArgs {
|
|
5
|
+
db: Database;
|
|
6
|
+
client: PluginContext["client"];
|
|
7
|
+
projectIdentity: string;
|
|
8
|
+
parentSessionId: string | undefined;
|
|
9
|
+
sessionDirectory: string;
|
|
10
|
+
holderId: string;
|
|
11
|
+
leaseKey: string;
|
|
12
|
+
deadline: number;
|
|
13
|
+
model?: string;
|
|
14
|
+
fallbackModels?: readonly string[];
|
|
15
|
+
/**
|
|
16
|
+
* Pi only: builds a RawMessageProvider for an arbitrary historical session id
|
|
17
|
+
* (JSONL), so the orientation seed read works on Pi-only installs where there
|
|
18
|
+
* is no opencode.db. OpenCode leaves this undefined — the seed read falls to
|
|
19
|
+
* the read-only opencode.db path. Returning null → closed-book fallback.
|
|
20
|
+
* May be async (Pi JSONL discovery is async); the returned provider's
|
|
21
|
+
* `readMessages()` itself is synchronous (wraps already-loaded entries).
|
|
22
|
+
*/
|
|
23
|
+
rawProviderFactory?: (sessionId: string) => Promise<RawMessageProvider | null> | RawMessageProvider | null;
|
|
24
|
+
}
|
|
25
|
+
export interface RefreshPrimersResult {
|
|
26
|
+
refreshed: number;
|
|
27
|
+
skipped: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function refreshPrimers(args: RefreshPrimersArgs): Promise<RefreshPrimersResult>;
|
|
30
|
+
//# sourceMappingURL=refresh-primers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-primers.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/refresh-primers.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,kBAAkB,EAG1B,MAAM,iDAAiD,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAcvD,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,CACjB,SAAS,EAAE,MAAM,KAChB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,kBAAkB,GAAG,IAAI,CAAC;CACvE;AAED,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACnB;AA0GD,wBAAsB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA4B5F"}
|