@primitive.ai/prim 0.1.0-alpha.120 → 0.1.0-alpha.122
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 +45 -9
- package/SKILL.md +7 -2
- package/dist/{chunk-P2O7NLVN.js → chunk-4GYJHN26.js} +117 -18
- package/dist/{chunk-VOC4KOOP.js → chunk-4M23K2KZ.js} +2 -2
- package/dist/{chunk-NQFRQ56V.js → chunk-4NUGCUQC.js} +2 -2
- package/dist/{chunk-GYQOZGGF.js → chunk-5ME3WD3P.js} +2 -2
- package/dist/{chunk-CCGFRNAA.js → chunk-7LXRFXZG.js} +248 -127
- package/dist/{chunk-MWNRXAEB.js → chunk-AKGRY7OU.js} +1 -1
- package/dist/{chunk-D235RJNO.js → chunk-DQ4I3FLF.js} +3 -3
- package/dist/{chunk-R2NUH4B7.js → chunk-FT673ALA.js} +2 -2
- package/dist/{chunk-TC4FTRYO.js → chunk-HG7FJK7R.js} +2 -2
- package/dist/{chunk-5BQ2NEMP.js → chunk-HLMC7VS4.js} +2615 -941
- package/dist/{chunk-L52OD62C.js → chunk-JYPVPYW3.js} +14 -8
- package/dist/{chunk-2AKDX4RU.js → chunk-JZC2LHS6.js} +1 -1
- package/dist/{chunk-SLDZJD6Q.js → chunk-NMZSCSMY.js} +1 -1
- package/dist/{chunk-LTTF4MBE.js → chunk-OXW6PSPT.js} +2 -2
- package/dist/{chunk-EYBE724K.js → chunk-QG3GASJO.js} +4 -4
- package/dist/{chunk-A6M2M5A2.js → chunk-RRAC76LJ.js} +1 -1
- package/dist/{chunk-U67RBNIZ.js → chunk-S3ZIMGXV.js} +1 -1
- package/dist/{chunk-HXICZG5J.js → chunk-T2T45KF6.js} +4 -4
- package/dist/{chunk-LBCPRHNG.js → chunk-WN7OURQ3.js} +1 -1
- package/dist/{chunk-YTF6OCF3.js → chunk-ZQ7UK5US.js} +5 -5
- package/dist/daemon/server.js +2603 -867
- package/dist/hook-runtime/daemon/server.js +2603 -867
- package/dist/hook-runtime/hooks/post-commit.js +2671 -935
- package/dist/hook-runtime/hooks/post-rewrite.js +2664 -928
- package/dist/hook-runtime/hooks/post-tool-use.js +2606 -870
- package/dist/hook-runtime/hooks/pre-commit.js +9 -5
- package/dist/hook-runtime/hooks/pre-tool-use-worker.js +2625 -947
- package/dist/hook-runtime/hooks/prim-hook.js +2609 -873
- package/dist/hook-runtime/hooks/session-end.js +75 -13
- package/dist/hook-runtime/hooks/session-start.js +2801 -1056
- package/dist/hook-runtime/index.js +3741 -1556
- package/dist/hook-runtime/statusline-main.js +76 -14
- package/dist/hooks/post-commit.js +7 -7
- package/dist/hooks/post-rewrite.js +6 -6
- package/dist/hooks/post-tool-use.js +15 -15
- package/dist/hooks/pre-commit.js +4 -4
- package/dist/hooks/pre-tool-use-worker.js +9 -9
- package/dist/hooks/prim-hook.js +17 -17
- package/dist/hooks/session-end.js +4 -4
- package/dist/hooks/session-start.js +11 -11
- package/dist/index.js +419 -112
- package/dist/statusline-main.js +76 -14
- package/package.json +4 -2
- package/skills/prim-welcome/SKILL.md +197 -0
|
@@ -522,26 +522,87 @@ function daemonRequest(method, params = {}, opts = {}) {
|
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
// src/lib/activation.ts
|
|
525
|
-
import { execFileSync as
|
|
525
|
+
import { execFileSync as execFileSync3 } from "child_process";
|
|
526
526
|
import { existsSync as existsSync4, readFileSync as readFileSync6 } from "fs";
|
|
527
527
|
import { homedir as homedir2 } from "os";
|
|
528
528
|
import { join as join8 } from "path";
|
|
529
529
|
|
|
530
|
-
// src/lib/
|
|
530
|
+
// src/lib/demo-pause.ts
|
|
531
531
|
import { execFileSync } from "child_process";
|
|
532
|
+
var DEMO_PAUSE_MS = 30 * 6e4;
|
|
533
|
+
var PAUSE_KEY = "prim.demoPause";
|
|
534
|
+
var GIT_TIMEOUT_MS = 1e3;
|
|
535
|
+
function git(cwd, args) {
|
|
536
|
+
try {
|
|
537
|
+
return execFileSync("git", args, {
|
|
538
|
+
cwd,
|
|
539
|
+
encoding: "utf-8",
|
|
540
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
541
|
+
timeout: GIT_TIMEOUT_MS
|
|
542
|
+
});
|
|
543
|
+
} catch {
|
|
544
|
+
return void 0;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
function setLocal(cwd, key, value) {
|
|
548
|
+
try {
|
|
549
|
+
execFileSync(
|
|
550
|
+
"git",
|
|
551
|
+
value === null ? ["config", "--local", "--unset", key] : ["config", "--local", key, value],
|
|
552
|
+
{ cwd, stdio: ["ignore", "ignore", "pipe"], timeout: GIT_TIMEOUT_MS }
|
|
553
|
+
);
|
|
554
|
+
} catch (error) {
|
|
555
|
+
if (value !== null || error.status !== 5) throw error;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
function parsePause(value) {
|
|
559
|
+
const [runId = "", until, previous, state] = value.trim().split(" ");
|
|
560
|
+
const flag = previous === "true" || previous === "false" ? previous : "unset";
|
|
561
|
+
return { runId, until: Number(until) || 0, previous: flag, ending: state !== "active" };
|
|
562
|
+
}
|
|
563
|
+
function readCaptureConfig(cwd) {
|
|
564
|
+
let active;
|
|
565
|
+
let pause;
|
|
566
|
+
const out = git(cwd, ["config", "--get-regexp", "^prim\\.(active|demopause)$"]) ?? "";
|
|
567
|
+
for (const line of out.split("\n")) {
|
|
568
|
+
const space = line.indexOf(" ");
|
|
569
|
+
const key = line.slice(0, space).toLowerCase();
|
|
570
|
+
const value = line.slice(space + 1);
|
|
571
|
+
if (key === "prim.active") active = value === "true" || value === "false" ? value : void 0;
|
|
572
|
+
if (key === "prim.demopause") pause = parsePause(value);
|
|
573
|
+
}
|
|
574
|
+
return { active, pause };
|
|
575
|
+
}
|
|
576
|
+
function resumeCapture(cwd, pause) {
|
|
577
|
+
setLocal(cwd, "prim.active", pause.previous === "unset" ? null : pause.previous);
|
|
578
|
+
setLocal(cwd, PAUSE_KEY, null);
|
|
579
|
+
}
|
|
580
|
+
function healDemoPause(cwd, pause, options = {}) {
|
|
581
|
+
if (pause.until > (options.now ?? Date.now()) && !(pause.ending && options.userPrompt))
|
|
582
|
+
return false;
|
|
583
|
+
try {
|
|
584
|
+
resumeCapture(cwd, pause);
|
|
585
|
+
return true;
|
|
586
|
+
} catch {
|
|
587
|
+
return false;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// src/lib/git.ts
|
|
592
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
532
593
|
import { createHash as createHash4 } from "crypto";
|
|
533
594
|
import { lstatSync as lstatSync2, realpathSync } from "fs";
|
|
534
595
|
import { basename, dirname as dirname5, isAbsolute as isAbsolute3, relative, resolve as resolve2, sep } from "path";
|
|
535
|
-
var
|
|
596
|
+
var GIT_TIMEOUT_MS2 = 1e3;
|
|
536
597
|
var GITHUB_OWNER_PATTERN = /^(?![A-Za-z0-9-]*--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/u;
|
|
537
598
|
var GITHUB_REPOSITORY_PATTERN = /^[A-Za-z0-9._-]{1,100}$/u;
|
|
538
599
|
function gitToplevel(cwd) {
|
|
539
600
|
try {
|
|
540
|
-
return
|
|
601
|
+
return execFileSync2("git", ["rev-parse", "--show-toplevel"], {
|
|
541
602
|
cwd,
|
|
542
603
|
encoding: "utf-8",
|
|
543
604
|
stdio: ["ignore", "pipe", "ignore"],
|
|
544
|
-
timeout:
|
|
605
|
+
timeout: GIT_TIMEOUT_MS2
|
|
545
606
|
}).trim();
|
|
546
607
|
} catch {
|
|
547
608
|
return null;
|
|
@@ -549,11 +610,11 @@ function gitToplevel(cwd) {
|
|
|
549
610
|
}
|
|
550
611
|
function gitValue(cwd, args) {
|
|
551
612
|
try {
|
|
552
|
-
const value =
|
|
613
|
+
const value = execFileSync2("git", args, {
|
|
553
614
|
cwd,
|
|
554
615
|
encoding: "utf-8",
|
|
555
616
|
stdio: ["ignore", "pipe", "ignore"],
|
|
556
|
-
timeout:
|
|
617
|
+
timeout: GIT_TIMEOUT_MS2
|
|
557
618
|
}).trim();
|
|
558
619
|
return value || void 0;
|
|
559
620
|
} catch {
|
|
@@ -580,17 +641,17 @@ var PRIM_ACTIVE_KEY = "prim.active";
|
|
|
580
641
|
var PRIM_REPO_SYNC_ID_KEY = "prim.repoSyncId";
|
|
581
642
|
var PRIM_REPO_SYNC_REPOSITORY_KEY = "prim.repoSyncRepository";
|
|
582
643
|
var PRIM_REPO_BINDING_STATE_KEY = "prim.repoBindingState";
|
|
583
|
-
var
|
|
644
|
+
var GIT_TIMEOUT_MS3 = 1e3;
|
|
584
645
|
var REPO_SYNC_ID_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
|
|
585
646
|
var PROJECT_INSTALL_FILES = [".claude/settings.json", ".codex/hooks.json", ".cursor/hooks.json"];
|
|
586
647
|
var PRIM_HOOK_BINS = ["prim-hook", "prim-pre-tool-use", "prim-post-tool-use"];
|
|
587
648
|
function repoActiveFlag(cwd, strict = false) {
|
|
588
649
|
try {
|
|
589
|
-
const value =
|
|
650
|
+
const value = execFileSync3("git", ["config", "--get", PRIM_ACTIVE_KEY], {
|
|
590
651
|
cwd,
|
|
591
652
|
encoding: "utf-8",
|
|
592
653
|
stdio: ["ignore", "pipe", "ignore"],
|
|
593
|
-
timeout:
|
|
654
|
+
timeout: GIT_TIMEOUT_MS3
|
|
594
655
|
}).trim();
|
|
595
656
|
if (value === "true") return "true";
|
|
596
657
|
if (value === "false") return "false";
|
|
@@ -607,11 +668,11 @@ function isValidRepoSyncId(value) {
|
|
|
607
668
|
}
|
|
608
669
|
function localGitConfigValue(cwd, key) {
|
|
609
670
|
try {
|
|
610
|
-
const value =
|
|
671
|
+
const value = execFileSync3("git", ["config", "--local", "--get", key], {
|
|
611
672
|
cwd,
|
|
612
673
|
encoding: "utf-8",
|
|
613
674
|
stdio: ["ignore", "pipe", "ignore"],
|
|
614
|
-
timeout:
|
|
675
|
+
timeout: GIT_TIMEOUT_MS3
|
|
615
676
|
}).trim();
|
|
616
677
|
return value || void 0;
|
|
617
678
|
} catch {
|
|
@@ -648,8 +709,9 @@ function hasProjectPrimInstall(cwd) {
|
|
|
648
709
|
}
|
|
649
710
|
return false;
|
|
650
711
|
}
|
|
651
|
-
function isRepoActiveForCapture(cwd) {
|
|
652
|
-
|
|
712
|
+
function isRepoActiveForCapture(cwd, options = {}) {
|
|
713
|
+
let { active: flag, pause } = readCaptureConfig(cwd);
|
|
714
|
+
if (pause && healDemoPause(cwd, pause, options)) flag = repoActiveFlag(cwd);
|
|
653
715
|
if (flag === "true") return true;
|
|
654
716
|
if (flag === "false") return false;
|
|
655
717
|
return hasProjectPrimInstall(cwd);
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
recordPostCommitFired
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-WN7OURQ3.js";
|
|
5
5
|
import {
|
|
6
6
|
unattendedEnv
|
|
7
7
|
} from "../chunk-OYHYCK4K.js";
|
|
8
8
|
import {
|
|
9
9
|
commitAttributionFromEnvironment,
|
|
10
10
|
toCommitMove
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-4M23K2KZ.js";
|
|
12
12
|
import {
|
|
13
13
|
getOrCreateWorkspaceId
|
|
14
14
|
} from "../chunk-EZXEWFDG.js";
|
|
15
15
|
import {
|
|
16
16
|
appendMove,
|
|
17
17
|
resolveOrg
|
|
18
|
-
} from "../chunk-
|
|
19
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-OXW6PSPT.js";
|
|
19
|
+
import "../chunk-4NUGCUQC.js";
|
|
20
20
|
import {
|
|
21
21
|
cachedCollectScopeAdmits
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import "../chunk-
|
|
22
|
+
} from "../chunk-HLMC7VS4.js";
|
|
23
|
+
import "../chunk-S3ZIMGXV.js";
|
|
24
24
|
import {
|
|
25
25
|
githubRepositoryFullName,
|
|
26
26
|
isRepoActiveForCapture,
|
|
27
27
|
repoSyncId,
|
|
28
28
|
resolveRepositoryContext
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-4GYJHN26.js";
|
|
30
30
|
import "../chunk-JSBRDJBE.js";
|
|
31
31
|
|
|
32
32
|
// src/hooks/post-commit.ts
|
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
canonicalRewritePairs,
|
|
7
7
|
toRewriteMove
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-4M23K2KZ.js";
|
|
9
9
|
import {
|
|
10
10
|
getOrCreateWorkspaceId
|
|
11
11
|
} from "../chunk-EZXEWFDG.js";
|
|
12
12
|
import {
|
|
13
13
|
appendMove,
|
|
14
14
|
resolveOrg
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
} from "../chunk-OXW6PSPT.js";
|
|
16
|
+
import "../chunk-4NUGCUQC.js";
|
|
17
17
|
import {
|
|
18
18
|
cachedCollectScopeAdmits
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-HLMC7VS4.js";
|
|
20
|
+
import "../chunk-S3ZIMGXV.js";
|
|
21
21
|
import {
|
|
22
22
|
githubRepositoryFullName,
|
|
23
23
|
isRepoActiveForCapture,
|
|
24
24
|
repoSyncId,
|
|
25
25
|
resolveRepositoryContext
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-4GYJHN26.js";
|
|
27
27
|
import "../chunk-JSBRDJBE.js";
|
|
28
28
|
|
|
29
29
|
// src/hooks/post-rewrite.ts
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
requireDurableIngestAcknowledgement
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-RRAC76LJ.js";
|
|
5
5
|
import {
|
|
6
6
|
enrichHookPayloadWithFileRefs,
|
|
7
7
|
preserveHookFileMetadata
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-QG3GASJO.js";
|
|
9
9
|
import {
|
|
10
10
|
appendCodexContext,
|
|
11
11
|
prepareCodexContext
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-T2T45KF6.js";
|
|
13
|
+
import "../chunk-5ME3WD3P.js";
|
|
14
14
|
import {
|
|
15
15
|
postToolInvocationId,
|
|
16
16
|
toMove,
|
|
17
17
|
toolOutcomeFor
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-4M23K2KZ.js";
|
|
19
19
|
import {
|
|
20
20
|
getOrCreateWorkspaceId
|
|
21
21
|
} from "../chunk-EZXEWFDG.js";
|
|
22
22
|
import {
|
|
23
23
|
appendMove,
|
|
24
24
|
resolveOrg
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import "../chunk-
|
|
25
|
+
} from "../chunk-OXW6PSPT.js";
|
|
26
|
+
import "../chunk-NMZSCSMY.js";
|
|
27
27
|
import {
|
|
28
28
|
observeDemoInvocation
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-FT673ALA.js";
|
|
30
30
|
import {
|
|
31
31
|
normalizeEnvelope,
|
|
32
32
|
readHookStdin,
|
|
33
33
|
shouldSuppressImportedCursorHandler
|
|
34
|
-
} from "../chunk-
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
34
|
+
} from "../chunk-HG7FJK7R.js";
|
|
35
|
+
import "../chunk-JYPVPYW3.js";
|
|
36
|
+
import "../chunk-AKGRY7OU.js";
|
|
37
37
|
import {
|
|
38
38
|
scrubFromCwd
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-4NUGCUQC.js";
|
|
40
40
|
import {
|
|
41
41
|
bold,
|
|
42
42
|
cachedCollectScopeAdmits,
|
|
43
43
|
color
|
|
44
|
-
} from "../chunk-
|
|
44
|
+
} from "../chunk-HLMC7VS4.js";
|
|
45
45
|
import {
|
|
46
46
|
getClient,
|
|
47
47
|
terminalSafeLine
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-S3ZIMGXV.js";
|
|
49
49
|
import {
|
|
50
50
|
currentBranch,
|
|
51
51
|
isRepoActiveForCapture,
|
|
52
52
|
repoSyncId,
|
|
53
53
|
resolveRepositoryContext
|
|
54
|
-
} from "../chunk-
|
|
54
|
+
} from "../chunk-4GYJHN26.js";
|
|
55
55
|
import {
|
|
56
56
|
parseAgent
|
|
57
57
|
} from "../chunk-KZB4ABIB.js";
|
package/dist/hooks/pre-commit.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
checkAffectedDecisions,
|
|
4
4
|
formatDecisionsWarning
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-DQ4I3FLF.js";
|
|
6
|
+
import "../chunk-NMZSCSMY.js";
|
|
7
|
+
import "../chunk-S3ZIMGXV.js";
|
|
8
|
+
import "../chunk-4GYJHN26.js";
|
|
9
9
|
import "../chunk-JSBRDJBE.js";
|
|
10
10
|
|
|
11
11
|
// src/hooks/pre-commit.ts
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
resultForPreflight,
|
|
11
11
|
toolInputDigest,
|
|
12
12
|
waitForPreflight
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-ZQ7UK5US.js";
|
|
14
14
|
import {
|
|
15
15
|
observeDemoInvocation
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-FT673ALA.js";
|
|
17
17
|
import {
|
|
18
18
|
normalizeEnvelope,
|
|
19
19
|
readHookStdin,
|
|
20
20
|
shouldSuppressImportedCursorHandler
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-HG7FJK7R.js";
|
|
22
22
|
import {
|
|
23
23
|
buildCodexOutput,
|
|
24
24
|
buildCursorOutput,
|
|
@@ -30,13 +30,13 @@ import {
|
|
|
30
30
|
failOpenHermes,
|
|
31
31
|
failOpenOutput,
|
|
32
32
|
readHookMode
|
|
33
|
-
} from "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
33
|
+
} from "../chunk-JYPVPYW3.js";
|
|
34
|
+
import "../chunk-AKGRY7OU.js";
|
|
35
|
+
import "../chunk-4NUGCUQC.js";
|
|
36
36
|
import {
|
|
37
37
|
cachedCollectScopeAdmits
|
|
38
|
-
} from "../chunk-
|
|
39
|
-
import "../chunk-
|
|
38
|
+
} from "../chunk-HLMC7VS4.js";
|
|
39
|
+
import "../chunk-S3ZIMGXV.js";
|
|
40
40
|
import {
|
|
41
41
|
canonicalGitRoot,
|
|
42
42
|
currentBranch,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
packageVersion,
|
|
45
45
|
repoActiveFlag,
|
|
46
46
|
repoSyncId
|
|
47
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-4GYJHN26.js";
|
|
48
48
|
import {
|
|
49
49
|
parseAgent
|
|
50
50
|
} from "../chunk-KZB4ABIB.js";
|
package/dist/hooks/prim-hook.js
CHANGED
|
@@ -8,58 +8,58 @@ import {
|
|
|
8
8
|
acknowledgeDecisionFeedback,
|
|
9
9
|
leaseDecisionFeedback,
|
|
10
10
|
renderFeedback
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-JZC2LHS6.js";
|
|
12
12
|
import {
|
|
13
13
|
recordConversationCaptured
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-WN7OURQ3.js";
|
|
15
15
|
import {
|
|
16
16
|
unattendedEnv
|
|
17
17
|
} from "../chunk-OYHYCK4K.js";
|
|
18
18
|
import {
|
|
19
19
|
enrichHookPayloadWithFileRefs,
|
|
20
20
|
preserveHookFileMetadata
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-QG3GASJO.js";
|
|
22
22
|
import {
|
|
23
23
|
prepareCodexContext
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import "../chunk-
|
|
24
|
+
} from "../chunk-T2T45KF6.js";
|
|
25
|
+
import "../chunk-5ME3WD3P.js";
|
|
26
26
|
import {
|
|
27
27
|
postToolInvocationId,
|
|
28
28
|
shouldFlushAfter,
|
|
29
29
|
toMove
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-4M23K2KZ.js";
|
|
31
31
|
import {
|
|
32
32
|
getOrCreateWorkspaceId
|
|
33
33
|
} from "../chunk-EZXEWFDG.js";
|
|
34
34
|
import {
|
|
35
35
|
appendMove,
|
|
36
36
|
resolveOrg
|
|
37
|
-
} from "../chunk-
|
|
38
|
-
import "../chunk-
|
|
37
|
+
} from "../chunk-OXW6PSPT.js";
|
|
38
|
+
import "../chunk-NMZSCSMY.js";
|
|
39
39
|
import {
|
|
40
40
|
observeDemoInvocation
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-FT673ALA.js";
|
|
42
42
|
import {
|
|
43
43
|
normalizeEnvelope,
|
|
44
44
|
readHookStdin,
|
|
45
45
|
shouldSuppressImportedCursorHandler
|
|
46
|
-
} from "../chunk-
|
|
47
|
-
import "../chunk-
|
|
48
|
-
import "../chunk-
|
|
46
|
+
} from "../chunk-HG7FJK7R.js";
|
|
47
|
+
import "../chunk-JYPVPYW3.js";
|
|
48
|
+
import "../chunk-AKGRY7OU.js";
|
|
49
49
|
import {
|
|
50
50
|
scrubFromCwd,
|
|
51
51
|
writeHookDebug
|
|
52
|
-
} from "../chunk-
|
|
52
|
+
} from "../chunk-4NUGCUQC.js";
|
|
53
53
|
import {
|
|
54
54
|
cachedCollectScopeAdmits
|
|
55
|
-
} from "../chunk-
|
|
56
|
-
import "../chunk-
|
|
55
|
+
} from "../chunk-HLMC7VS4.js";
|
|
56
|
+
import "../chunk-S3ZIMGXV.js";
|
|
57
57
|
import {
|
|
58
58
|
currentBranch,
|
|
59
59
|
isRepoActiveForCapture,
|
|
60
60
|
repoSyncId,
|
|
61
61
|
resolveRepositoryContext
|
|
62
|
-
} from "../chunk-
|
|
62
|
+
} from "../chunk-4GYJHN26.js";
|
|
63
63
|
import {
|
|
64
64
|
parseAgent
|
|
65
65
|
} from "../chunk-KZB4ABIB.js";
|
|
@@ -149,7 +149,7 @@ async function main() {
|
|
|
149
149
|
const cwd = parsed.cwd ?? process.cwd();
|
|
150
150
|
const isClaudeStop = agent === "claude_code" && parsed.hook_event_name === "Stop";
|
|
151
151
|
const isCodexContextEvent = agent === "codex" && (parsed.hook_event_name === "UserPromptSubmit" || parsed.hook_event_name === "Stop");
|
|
152
|
-
if (!isRepoActiveForCapture(cwd)) {
|
|
152
|
+
if (!isRepoActiveForCapture(cwd, { userPrompt: parsed.hook_event_name === "UserPromptSubmit" })) {
|
|
153
153
|
if (isClaudeStop || isCodexContextEvent || agent === "cursor") {
|
|
154
154
|
await emitOutput(cursorPassiveOutput());
|
|
155
155
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
daemonRequest
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-NMZSCSMY.js";
|
|
5
5
|
import {
|
|
6
6
|
normalizeEnvelope,
|
|
7
7
|
readHookStdin,
|
|
8
8
|
shouldSuppressImportedCursorHandler
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-HG7FJK7R.js";
|
|
10
|
+
import "../chunk-AKGRY7OU.js";
|
|
11
11
|
import {
|
|
12
12
|
isRepoActiveForCapture
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-4GYJHN26.js";
|
|
14
14
|
import {
|
|
15
15
|
parseAgent
|
|
16
16
|
} from "../chunk-KZB4ABIB.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
kickDaemonEnsure,
|
|
8
8
|
refreshClaudePlugins,
|
|
9
9
|
warmBinCache
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-7LXRFXZG.js";
|
|
11
11
|
import {
|
|
12
12
|
buildHookOutput,
|
|
13
13
|
handoffHookOutput
|
|
@@ -17,43 +17,43 @@ import {
|
|
|
17
17
|
acknowledgeDecisionFeedback,
|
|
18
18
|
leaseDecisionFeedback,
|
|
19
19
|
renderFeedback
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-JZC2LHS6.js";
|
|
21
21
|
import {
|
|
22
22
|
clearHooksWired,
|
|
23
23
|
recordHooksWired
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-WN7OURQ3.js";
|
|
25
25
|
import "../chunk-OYHYCK4K.js";
|
|
26
26
|
import {
|
|
27
27
|
prepareCodexContext
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-T2T45KF6.js";
|
|
29
|
+
import "../chunk-5ME3WD3P.js";
|
|
30
30
|
import {
|
|
31
31
|
getOrCreateWorkspaceId
|
|
32
32
|
} from "../chunk-EZXEWFDG.js";
|
|
33
33
|
import {
|
|
34
34
|
daemonRequest
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-NMZSCSMY.js";
|
|
36
36
|
import {
|
|
37
37
|
normalizeEnvelope,
|
|
38
38
|
readHookStdin,
|
|
39
39
|
shouldSuppressImportedCursorHandler
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-HG7FJK7R.js";
|
|
41
41
|
import {
|
|
42
42
|
MANAGED_GIT_HOOK_NAMES
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-AKGRY7OU.js";
|
|
44
44
|
import {
|
|
45
45
|
fetchAndCacheCollectScope
|
|
46
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-HLMC7VS4.js";
|
|
47
47
|
import {
|
|
48
48
|
getSiteUrl,
|
|
49
49
|
isSessionEnded
|
|
50
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-S3ZIMGXV.js";
|
|
51
51
|
import {
|
|
52
52
|
gitToplevel,
|
|
53
53
|
isRepoActiveForCapture,
|
|
54
54
|
repoActiveFlag,
|
|
55
55
|
setRepoActive
|
|
56
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-4GYJHN26.js";
|
|
57
57
|
import {
|
|
58
58
|
parseAgent
|
|
59
59
|
} from "../chunk-KZB4ABIB.js";
|