@cortexkit/pi-magic-context 0.44.0 → 0.44.2
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/dist/historian-calibration-extension.js +17 -0
- package/dist/{index-tfzybajk.js → index-59dmj4zs.js} +4 -1
- package/dist/{index-jscq7067.js → index-5fw91enm.js} +1 -1
- package/dist/{index-mmkdxa5j.js → index-97e5fzy3.js} +1 -1
- package/dist/{index-8ytss1hp.js → index-esnhck8v.js} +14869 -14266
- package/dist/{index-2kj55q4e.js → index-gsff513e.js} +263 -51
- package/dist/index-n8kg008j.js +245 -0
- package/dist/index.js +1935 -877
- package/dist/{message-time-backfill-3rp0w2z9.js → message-time-backfill-5yrp95cx.js} +2 -2
- package/dist/{read-session-chunk-2s116ah5.js → read-session-chunk-zhtcx9f1.js} +4 -2
- package/dist/{safe-notification-target-pd09ybr0.js → safe-notification-target-y3hg2m7p.js} +2 -2
- package/dist/subagent-entry.js +22 -6
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-59dmj4zs.js";
|
|
2
2
|
import {
|
|
3
3
|
logSlowWriteTransaction
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-97e5fzy3.js";
|
|
5
5
|
|
|
6
6
|
// ../plugin/src/features/magic-context/message-time-backfill.ts
|
|
7
7
|
var MESSAGE_TIME_BACKFILL_BATCH_SIZE = 500;
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
readRawSessionMessages2,
|
|
11
11
|
readRawSessionMessagePage2,
|
|
12
12
|
getRawSessionMessageOrdinalCount2,
|
|
13
|
+
visitRawSessionMessages2,
|
|
13
14
|
readRawSessionMessageRange2,
|
|
14
15
|
primeTailRawMessageCache2,
|
|
15
16
|
getCachedAbsoluteMessageCount2,
|
|
@@ -22,8 +23,8 @@ import {
|
|
|
22
23
|
getRawSessionTagKeysThrough2,
|
|
23
24
|
getLegacyProtectedTailStartOrdinal2,
|
|
24
25
|
readSessionChunk2
|
|
25
|
-
} from "./index-
|
|
26
|
-
import"./index-
|
|
26
|
+
} from "./index-gsff513e.js";
|
|
27
|
+
import"./index-59dmj4zs.js";
|
|
27
28
|
export {
|
|
28
29
|
cleanUserText2 as cleanUserText,
|
|
29
30
|
compareRawSessionMessageOrder2 as compareRawSessionMessageOrder,
|
|
@@ -46,6 +47,7 @@ export {
|
|
|
46
47
|
readSessionChunk2 as readSessionChunk,
|
|
47
48
|
resolveHostServedBoundaryId2 as resolveHostServedBoundaryId,
|
|
48
49
|
setRawMessageProvider2 as setRawMessageProvider,
|
|
50
|
+
visitRawSessionMessages2 as visitRawSessionMessages,
|
|
49
51
|
withRawMessageProvider2 as withRawMessageProvider,
|
|
50
52
|
withRawSessionMessageCache2 as withRawSessionMessageCache
|
|
51
53
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isDefaultSessionTitle2,
|
|
3
3
|
waitForSafeNotificationTarget2
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-5fw91enm.js";
|
|
5
|
+
import"./index-59dmj4zs.js";
|
|
6
6
|
export {
|
|
7
7
|
isDefaultSessionTitle2 as isDefaultSessionTitle,
|
|
8
8
|
waitForSafeNotificationTarget2 as waitForSafeNotificationTarget
|
package/dist/subagent-entry.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TOKEN_BUDGET_TOOL_REFUSAL
|
|
3
|
+
} from "./index-gsff513e.js";
|
|
1
4
|
import {
|
|
2
5
|
setHarness,
|
|
3
6
|
log
|
|
4
|
-
} from "./index-
|
|
7
|
+
} from "./index-59dmj4zs.js";
|
|
5
8
|
import {
|
|
6
9
|
setStoragePrivatePermissionEnforcement,
|
|
7
10
|
resolveProjectIdentityForSession,
|
|
@@ -10,11 +13,11 @@ import {
|
|
|
10
13
|
ensureProjectRegisteredFromPiDirectory,
|
|
11
14
|
resolvePiHarnessKind,
|
|
12
15
|
registerMagicContextTools
|
|
13
|
-
} from "./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-mmkdxa5j.js";
|
|
16
|
+
} from "./index-esnhck8v.js";
|
|
17
|
+
import"./index-97e5fzy3.js";
|
|
16
18
|
|
|
17
19
|
// src/subagent-entry.ts
|
|
20
|
+
import { readFileSync } from "node:fs";
|
|
18
21
|
var SUBAGENT_DREAMER_ACTIONS_FLAG = "magic-context-dreamer-actions";
|
|
19
22
|
var openedDb;
|
|
20
23
|
function magicContextSubagentExtension(pi) {
|
|
@@ -24,6 +27,19 @@ function magicContextSubagentExtension(pi) {
|
|
|
24
27
|
type: "boolean",
|
|
25
28
|
default: false
|
|
26
29
|
});
|
|
30
|
+
const budgetGuardFile = process.env.MAGIC_CONTEXT_SUBAGENT_BUDGET_GUARD_FILE;
|
|
31
|
+
if (budgetGuardFile) {
|
|
32
|
+
pi.on("tool_call", () => {
|
|
33
|
+
try {
|
|
34
|
+
if (readFileSync(budgetGuardFile, "utf8") === "finalize") {
|
|
35
|
+
return { block: true, reason: TOKEN_BUDGET_TOOL_REFUSAL };
|
|
36
|
+
}
|
|
37
|
+
} catch {
|
|
38
|
+
return { block: true, reason: TOKEN_BUDGET_TOOL_REFUSAL };
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
27
43
|
pi.on("session_start", async () => {
|
|
28
44
|
try {
|
|
29
45
|
const directory = process.cwd();
|
|
@@ -45,11 +61,11 @@ function magicContextSubagentExtension(pi) {
|
|
|
45
61
|
memoryToolEnabled: dreamerActionsEnabled,
|
|
46
62
|
allowDreamerActions: dreamerActionsEnabled,
|
|
47
63
|
sessionScopedToolsDisabled: true,
|
|
48
|
-
todowriteEnabled: cfg.todowrite.enabled
|
|
64
|
+
todowriteEnabled: cfg.todowrite.enabled,
|
|
49
65
|
todowriteCommandEnabled: false,
|
|
50
66
|
promptSurface: registrationPromptSurface
|
|
51
67
|
});
|
|
52
|
-
log(`[pi-subagent] registered tools: ctx_search${dreamerActionsEnabled ? ", ctx_memory" : ""}${cfg.todowrite.enabled
|
|
68
|
+
log(`[pi-subagent] registered tools: ctx_search${dreamerActionsEnabled ? ", ctx_memory" : ""}${cfg.todowrite.enabled ? ", todowrite" : ""}` + ` (ctx_note/ctx_expand omitted: --no-session child;` + ` memory=${cfg.memory.enabled}, embedding=${cfg.embedding.provider !== "off"},` + ` git_commits=${cfg.memory.git_commit_indexing.enabled}, dreamer_actions=${dreamerActionsEnabled})`);
|
|
53
69
|
} catch (err) {
|
|
54
70
|
const message = err instanceof Error ? err.message : String(err);
|
|
55
71
|
log(`[pi-subagent] startup failed: ${message}`);
|
package/package.json
CHANGED