@primitive.ai/prim 0.1.0-alpha.98 → 0.1.0-alpha.99
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 +11 -0
- package/dist/{chunk-7IPGD6CD.js → chunk-25DDRMWS.js} +2 -2
- package/dist/{chunk-B6EPQ4YH.js → chunk-2IRLFOEL.js} +123 -19
- package/dist/{chunk-WKLYYT63.js → chunk-2Q3OGSTV.js} +3 -3
- package/dist/{chunk-2DPLT2CQ.js → chunk-5LRKJTLA.js} +1 -1
- package/dist/{chunk-AN6XTFIN.js → chunk-6C3CCVDI.js} +2 -2
- package/dist/{chunk-NIQAVFP6.js → chunk-7VIMU2HR.js} +1 -1
- package/dist/{chunk-2DA2B4EC.js → chunk-EJPKZT5M.js} +2 -2
- package/dist/{chunk-HUZXBJJ5.js → chunk-FK7FJPWS.js} +1 -1
- package/dist/{chunk-QPMLAD2C.js → chunk-JJI7FU24.js} +2 -2
- package/dist/{chunk-PPZBEOWK.js → chunk-JJYS7IPD.js} +3 -3
- package/dist/{chunk-RT7DXMTN.js → chunk-K4JWJ6OM.js} +79 -266
- package/dist/{chunk-3X77XQGW.js → chunk-KGBMU76T.js} +1 -1
- package/dist/{chunk-JOR67B5T.js → chunk-O2WV5SQZ.js} +8 -8
- package/dist/{chunk-IL443QTF.js → chunk-X5BN67D2.js} +2 -2
- package/dist/{chunk-6QK75B7G.js → chunk-XG7S3LIL.js} +214 -11
- package/dist/{chunk-MN4X6RR6.js → chunk-XPS6LG6I.js} +5 -7
- package/dist/{chunk-BIAWZMCK.js → chunk-ZNLIGT3J.js} +2 -2
- package/dist/daemon/server.js +247 -180
- package/dist/hook-runtime/daemon/server.js +247 -180
- package/dist/hook-runtime/hooks/post-commit.js +114 -59
- package/dist/hook-runtime/hooks/post-rewrite.js +109 -54
- package/dist/hook-runtime/hooks/post-tool-use.js +256 -156
- package/dist/hook-runtime/hooks/pre-commit.js +177 -33
- package/dist/hook-runtime/hooks/pre-tool-use.js +237 -137
- package/dist/hook-runtime/hooks/prim-hook.js +281 -181
- package/dist/hook-runtime/hooks/session-start.js +209 -109
- package/dist/hook-runtime/index.js +615 -515
- package/dist/hook-runtime/statusline-main.js +71 -16
- package/dist/hooks/post-commit.js +7 -7
- package/dist/hooks/post-rewrite.js +6 -6
- package/dist/hooks/post-tool-use.js +13 -13
- package/dist/hooks/pre-commit.js +4 -4
- package/dist/hooks/pre-tool-use.js +10 -11
- package/dist/hooks/prim-hook.js +14 -14
- package/dist/hooks/session-end.js +4 -4
- package/dist/hooks/session-start.js +11 -11
- package/dist/index.js +20 -20
- package/dist/statusline-main.js +71 -16
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/commands/statusline.ts
|
|
4
|
-
import { readFileSync as
|
|
5
|
-
import { dirname as
|
|
6
|
-
import { fileURLToPath } from "url";
|
|
4
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
5
|
+
import { dirname as dirname6, resolve as resolve3 } from "path";
|
|
6
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
7
7
|
|
|
8
8
|
// src/client.ts
|
|
9
9
|
import { createHash as createHash2 } from "crypto";
|
|
10
|
-
import { chmodSync, existsSync as
|
|
11
|
-
import { dirname as
|
|
10
|
+
import { chmodSync as chmodSync2, existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync5, rmSync as rmSync3 } from "fs";
|
|
11
|
+
import { dirname as dirname4 } from "path";
|
|
12
12
|
|
|
13
13
|
// src/lib/atomic-file.ts
|
|
14
14
|
import { randomUUID } from "crypto";
|
|
@@ -278,6 +278,61 @@ import { existsSync, mkdirSync as mkdirSync2, readFileSync as readFileSync2, rmS
|
|
|
278
278
|
import { dirname as dirname2, join as join3 } from "path";
|
|
279
279
|
var syncSleeper = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
|
|
280
280
|
|
|
281
|
+
// src/daemon/client-instance-id.ts
|
|
282
|
+
import { randomBytes as randomBytes2 } from "crypto";
|
|
283
|
+
import { chmodSync, lstatSync, readFileSync as readFileSync3 } from "fs";
|
|
284
|
+
import { join as join4 } from "path";
|
|
285
|
+
var INSTANCE_BODY_CHARS = 43;
|
|
286
|
+
var INSTANCE_PREFIX = "pci_";
|
|
287
|
+
var MAX_STORED_BYTES = INSTANCE_PREFIX.length + INSTANCE_BODY_CHARS + 1;
|
|
288
|
+
|
|
289
|
+
// src/lib/bin-path.ts
|
|
290
|
+
import { existsSync as existsSync2, readFileSync as readFileSync4 } from "fs";
|
|
291
|
+
import { dirname as dirname3, isAbsolute as isAbsolute2, join as join5 } from "path";
|
|
292
|
+
import { fileURLToPath } from "url";
|
|
293
|
+
var PKG_NAME = "@primitive.ai/prim";
|
|
294
|
+
var ROOT_WALK_LIMIT = 6;
|
|
295
|
+
var resolvedRoot;
|
|
296
|
+
function locateRoot() {
|
|
297
|
+
if (resolvedRoot !== void 0) {
|
|
298
|
+
return resolvedRoot;
|
|
299
|
+
}
|
|
300
|
+
let dir = dirname3(fileURLToPath(import.meta.url));
|
|
301
|
+
for (let depth = 0; depth < ROOT_WALK_LIMIT; depth++) {
|
|
302
|
+
const manifestPath = join5(dir, "package.json");
|
|
303
|
+
if (existsSync2(manifestPath)) {
|
|
304
|
+
try {
|
|
305
|
+
const manifest = JSON.parse(readFileSync4(manifestPath, "utf-8"));
|
|
306
|
+
if (manifest.name === PKG_NAME && manifest.bin) {
|
|
307
|
+
resolvedRoot = { dir, version: manifest.version, bin: manifest.bin };
|
|
308
|
+
return resolvedRoot;
|
|
309
|
+
}
|
|
310
|
+
} catch {
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
const parent = dirname3(dir);
|
|
314
|
+
if (parent === dir) {
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
dir = parent;
|
|
318
|
+
}
|
|
319
|
+
resolvedRoot = null;
|
|
320
|
+
return resolvedRoot;
|
|
321
|
+
}
|
|
322
|
+
function packageVersion() {
|
|
323
|
+
return locateRoot()?.version ?? null;
|
|
324
|
+
}
|
|
325
|
+
var PRIM_CONFIG_SHELL_RESOLVER = [
|
|
326
|
+
'prim_absolute() { case "$1" in [/]* ) ;; *) return 1 ;; esac; case "$1" in [[:space:]]*|*[[:space:]]|*[/][/]*|*[/].[/]*|*[/]..[/]*|*[/].|*[/]..|?*[/]) return 1 ;; esac; }; ',
|
|
327
|
+
'prim_config=${PRIM_CONFIG_DIR:-}; if ! prim_absolute "$prim_config"; then prim_config=${XDG_CONFIG_HOME:-}; if prim_absolute "$prim_config"; then ',
|
|
328
|
+
'case "$prim_config" in /) prim_config=/prim ;; *) prim_config="$prim_config/prim" ;; esac; ',
|
|
329
|
+
'else prim_home=${HOME:-}; prim_absolute "$prim_home" || exit 78; case "$prim_home" in /) prim_config=/.config/prim ;; *) prim_config="$prim_home/.config/prim" ;; esac; ',
|
|
330
|
+
"fi; fi; "
|
|
331
|
+
].join("");
|
|
332
|
+
|
|
333
|
+
// src/lib/ingest-uploader.ts
|
|
334
|
+
var runtimeVersion = process.env.PRIM_RUNTIME_VERSION ?? packageVersion();
|
|
335
|
+
|
|
281
336
|
// src/lib/terminal-safe.ts
|
|
282
337
|
function replaceIsolatedSurrogates(value) {
|
|
283
338
|
let out = "";
|
|
@@ -329,7 +384,7 @@ var CLI_MANAGEMENT_RESPONSE_MAX_BYTES = 2 * 1024 * 1024;
|
|
|
329
384
|
|
|
330
385
|
// src/daemon/client.ts
|
|
331
386
|
import { createConnection } from "net";
|
|
332
|
-
import { join as
|
|
387
|
+
import { join as join7 } from "path";
|
|
333
388
|
|
|
334
389
|
// src/daemon/principal.ts
|
|
335
390
|
import { createHash as createHash3 } from "crypto";
|
|
@@ -376,7 +431,7 @@ function parseDaemonResponseEnvelope(value) {
|
|
|
376
431
|
}
|
|
377
432
|
|
|
378
433
|
// src/daemon/client.ts
|
|
379
|
-
var SOCK_PATH =
|
|
434
|
+
var SOCK_PATH = join7(primConfigDirectory(), "sock");
|
|
380
435
|
var DEFAULT_TIMEOUT_MS = 250;
|
|
381
436
|
var nextRequestId = 1;
|
|
382
437
|
function daemonRequest(method, params = {}, opts = {}) {
|
|
@@ -465,15 +520,15 @@ function daemonRequest(method, params = {}, opts = {}) {
|
|
|
465
520
|
|
|
466
521
|
// src/lib/activation.ts
|
|
467
522
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
468
|
-
import { existsSync as
|
|
523
|
+
import { existsSync as existsSync4, readFileSync as readFileSync6 } from "fs";
|
|
469
524
|
import { homedir as homedir2 } from "os";
|
|
470
|
-
import { join as
|
|
525
|
+
import { join as join8 } from "path";
|
|
471
526
|
|
|
472
527
|
// src/lib/git.ts
|
|
473
528
|
import { execFileSync } from "child_process";
|
|
474
529
|
import { createHash as createHash4 } from "crypto";
|
|
475
|
-
import { lstatSync, realpathSync } from "fs";
|
|
476
|
-
import { basename, dirname as
|
|
530
|
+
import { lstatSync as lstatSync2, realpathSync } from "fs";
|
|
531
|
+
import { basename, dirname as dirname5, isAbsolute as isAbsolute3, relative, resolve as resolve2, sep } from "path";
|
|
477
532
|
var GIT_TIMEOUT_MS = 1e3;
|
|
478
533
|
var GITHUB_OWNER_PATTERN = /^(?![A-Za-z0-9-]*--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/u;
|
|
479
534
|
var GITHUB_REPOSITORY_PATTERN = /^[A-Za-z0-9._-]{1,100}$/u;
|
|
@@ -576,10 +631,10 @@ function hasProjectPrimInstall(cwd) {
|
|
|
576
631
|
const root = gitToplevel(cwd);
|
|
577
632
|
if (root === null || root === homedir2()) return false;
|
|
578
633
|
for (const rel of PROJECT_INSTALL_FILES) {
|
|
579
|
-
const path =
|
|
580
|
-
if (
|
|
634
|
+
const path = join8(root, rel);
|
|
635
|
+
if (existsSync4(path)) {
|
|
581
636
|
try {
|
|
582
|
-
const content =
|
|
637
|
+
const content = readFileSync6(path, "utf-8");
|
|
583
638
|
if (PRIM_HOOK_BINS.some((bin) => content.includes(bin))) return true;
|
|
584
639
|
} catch {
|
|
585
640
|
}
|
|
@@ -726,7 +781,7 @@ function formatStatusline(version, snapshot, resolveIngestionStatus, options = {
|
|
|
726
781
|
var STATUSLINE_TIMEOUT_MS = 200;
|
|
727
782
|
function readPackageVersion() {
|
|
728
783
|
try {
|
|
729
|
-
const here =
|
|
784
|
+
const here = dirname6(fileURLToPath2(import.meta.url));
|
|
730
785
|
const candidates = [
|
|
731
786
|
// Schema-v2 runtimes staged a manifest beside this standalone bundle.
|
|
732
787
|
// Keep resolving it while those legacy launchers transition to schema v3.
|
|
@@ -736,7 +791,7 @@ function readPackageVersion() {
|
|
|
736
791
|
];
|
|
737
792
|
for (const path of candidates) {
|
|
738
793
|
try {
|
|
739
|
-
const pkg = JSON.parse(
|
|
794
|
+
const pkg = JSON.parse(readFileSync7(path, "utf-8"));
|
|
740
795
|
if (pkg.version) {
|
|
741
796
|
return pkg.version;
|
|
742
797
|
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
recordPostCommitFired
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-KGBMU76T.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-EJPKZT5M.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-JJI7FU24.js";
|
|
19
|
+
import "../chunk-ZNLIGT3J.js";
|
|
20
20
|
import {
|
|
21
21
|
cachedCollectScopeAdmits
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import "../chunk-
|
|
22
|
+
} from "../chunk-25DDRMWS.js";
|
|
23
|
+
import "../chunk-2IRLFOEL.js";
|
|
24
24
|
import {
|
|
25
25
|
githubRepositoryFullName,
|
|
26
26
|
isRepoActiveForCapture,
|
|
27
27
|
repoSyncId,
|
|
28
28
|
resolveRepositoryContext
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-XG7S3LIL.js";
|
|
30
30
|
|
|
31
31
|
// src/hooks/post-commit.ts
|
|
32
32
|
import { execFileSync, spawn } from "child_process";
|
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
canonicalRewritePairs,
|
|
7
7
|
toRewriteMove
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-EJPKZT5M.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-JJI7FU24.js";
|
|
16
|
+
import "../chunk-ZNLIGT3J.js";
|
|
17
17
|
import {
|
|
18
18
|
cachedCollectScopeAdmits
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-25DDRMWS.js";
|
|
20
|
+
import "../chunk-2IRLFOEL.js";
|
|
21
21
|
import {
|
|
22
22
|
githubRepositoryFullName,
|
|
23
23
|
isRepoActiveForCapture,
|
|
24
24
|
repoSyncId,
|
|
25
25
|
resolveRepositoryContext
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-XG7S3LIL.js";
|
|
27
27
|
|
|
28
28
|
// src/hooks/post-rewrite.ts
|
|
29
29
|
import { execFileSync, spawn } from "child_process";
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
requireDurableIngestAcknowledgement
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-FK7FJPWS.js";
|
|
5
5
|
import {
|
|
6
6
|
enrichHookPayloadWithFileRefs,
|
|
7
7
|
preserveHookFileMetadata
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-JJYS7IPD.js";
|
|
9
9
|
import {
|
|
10
10
|
postToolInvocationId,
|
|
11
11
|
toMove,
|
|
12
12
|
toolOutcomeFor
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-EJPKZT5M.js";
|
|
14
14
|
import {
|
|
15
15
|
getOrCreateWorkspaceId
|
|
16
16
|
} from "../chunk-EZXEWFDG.js";
|
|
17
17
|
import {
|
|
18
18
|
appendMove,
|
|
19
19
|
resolveOrg
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-JJI7FU24.js";
|
|
21
21
|
import "../chunk-MXVCP33E.js";
|
|
22
22
|
import {
|
|
23
23
|
appendCodexContext,
|
|
24
24
|
prepareCodexContext
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import "../chunk-
|
|
25
|
+
} from "../chunk-XPS6LG6I.js";
|
|
26
|
+
import "../chunk-X5BN67D2.js";
|
|
27
27
|
import {
|
|
28
28
|
scrubFromCwd
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-ZNLIGT3J.js";
|
|
30
30
|
import {
|
|
31
31
|
bold,
|
|
32
32
|
cachedCollectScopeAdmits,
|
|
33
33
|
color
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-25DDRMWS.js";
|
|
35
35
|
import {
|
|
36
36
|
getClient,
|
|
37
37
|
terminalSafeLine
|
|
38
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-2IRLFOEL.js";
|
|
39
39
|
import {
|
|
40
40
|
normalizeEnvelope,
|
|
41
41
|
parseAgent,
|
|
42
42
|
readHookStdin,
|
|
43
43
|
shouldSuppressImportedCursorHandler
|
|
44
|
-
} from "../chunk-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-
|
|
44
|
+
} from "../chunk-6C3CCVDI.js";
|
|
45
|
+
import "../chunk-K4JWJ6OM.js";
|
|
46
|
+
import "../chunk-5LRKJTLA.js";
|
|
47
47
|
import {
|
|
48
48
|
currentBranch,
|
|
49
49
|
isRepoActiveForCapture,
|
|
50
50
|
repoSyncId,
|
|
51
51
|
resolveRepositoryContext
|
|
52
|
-
} from "../chunk-
|
|
52
|
+
} from "../chunk-XG7S3LIL.js";
|
|
53
53
|
|
|
54
54
|
// src/hooks/post-tool-use.ts
|
|
55
55
|
import { readFileSync } from "fs";
|
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-2Q3OGSTV.js";
|
|
6
|
+
import "../chunk-2IRLFOEL.js";
|
|
7
|
+
import "../chunk-5LRKJTLA.js";
|
|
8
|
+
import "../chunk-XG7S3LIL.js";
|
|
9
9
|
|
|
10
10
|
// src/hooks/pre-commit.ts
|
|
11
11
|
import { execSync } from "child_process";
|
|
@@ -17,39 +17,38 @@ import {
|
|
|
17
17
|
appendCodexContext,
|
|
18
18
|
hasVisibleCodexMessage,
|
|
19
19
|
prepareCodexContext
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-XPS6LG6I.js";
|
|
21
|
+
import "../chunk-X5BN67D2.js";
|
|
22
22
|
import {
|
|
23
23
|
DEFAULT_RULES,
|
|
24
24
|
scrub
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-ZNLIGT3J.js";
|
|
26
26
|
import {
|
|
27
27
|
boundedHealthError,
|
|
28
28
|
cachedCollectScopeAdmits
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-25DDRMWS.js";
|
|
30
30
|
import {
|
|
31
31
|
HttpError,
|
|
32
32
|
getClient
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-2IRLFOEL.js";
|
|
34
34
|
import {
|
|
35
35
|
normalizeEnvelope,
|
|
36
36
|
parseAgent,
|
|
37
37
|
readHookStdin,
|
|
38
38
|
shouldSuppressImportedCursorHandler
|
|
39
|
-
} from "../chunk-
|
|
40
|
-
import
|
|
41
|
-
|
|
42
|
-
} from "../chunk-RT7DXMTN.js";
|
|
43
|
-
import "../chunk-2DPLT2CQ.js";
|
|
39
|
+
} from "../chunk-6C3CCVDI.js";
|
|
40
|
+
import "../chunk-K4JWJ6OM.js";
|
|
41
|
+
import "../chunk-5LRKJTLA.js";
|
|
44
42
|
import {
|
|
45
43
|
canonicalGitRoot,
|
|
46
44
|
canonicalRepositoryPath,
|
|
47
45
|
currentBranch,
|
|
48
46
|
githubRepositoryFullName,
|
|
49
47
|
isRepoActive,
|
|
48
|
+
packageVersion,
|
|
50
49
|
repoSyncId,
|
|
51
50
|
resolveAuthCredential
|
|
52
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-XG7S3LIL.js";
|
|
53
52
|
|
|
54
53
|
// src/hooks/preflight-v3.ts
|
|
55
54
|
import { Buffer } from "buffer";
|
package/dist/hooks/prim-hook.js
CHANGED
|
@@ -8,56 +8,56 @@ import {
|
|
|
8
8
|
acknowledgeDecisionFeedback,
|
|
9
9
|
leaseDecisionFeedback,
|
|
10
10
|
renderFeedback
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-7VIMU2HR.js";
|
|
12
12
|
import {
|
|
13
13
|
recordConversationCaptured
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-KGBMU76T.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-JJYS7IPD.js";
|
|
22
22
|
import {
|
|
23
23
|
postToolInvocationId,
|
|
24
24
|
shouldFlushAfter,
|
|
25
25
|
toMove
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-EJPKZT5M.js";
|
|
27
27
|
import {
|
|
28
28
|
getOrCreateWorkspaceId
|
|
29
29
|
} from "../chunk-EZXEWFDG.js";
|
|
30
30
|
import {
|
|
31
31
|
appendMove,
|
|
32
32
|
resolveOrg
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-JJI7FU24.js";
|
|
34
34
|
import "../chunk-MXVCP33E.js";
|
|
35
35
|
import {
|
|
36
36
|
prepareCodexContext
|
|
37
|
-
} from "../chunk-
|
|
38
|
-
import "../chunk-
|
|
37
|
+
} from "../chunk-XPS6LG6I.js";
|
|
38
|
+
import "../chunk-X5BN67D2.js";
|
|
39
39
|
import {
|
|
40
40
|
scrubFromCwd,
|
|
41
41
|
writeHookDebug
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-ZNLIGT3J.js";
|
|
43
43
|
import {
|
|
44
44
|
cachedCollectScopeAdmits
|
|
45
|
-
} from "../chunk-
|
|
46
|
-
import "../chunk-
|
|
45
|
+
} from "../chunk-25DDRMWS.js";
|
|
46
|
+
import "../chunk-2IRLFOEL.js";
|
|
47
47
|
import {
|
|
48
48
|
normalizeEnvelope,
|
|
49
49
|
parseAgent,
|
|
50
50
|
readHookStdin,
|
|
51
51
|
shouldSuppressImportedCursorHandler
|
|
52
|
-
} from "../chunk-
|
|
53
|
-
import "../chunk-
|
|
54
|
-
import "../chunk-
|
|
52
|
+
} from "../chunk-6C3CCVDI.js";
|
|
53
|
+
import "../chunk-K4JWJ6OM.js";
|
|
54
|
+
import "../chunk-5LRKJTLA.js";
|
|
55
55
|
import {
|
|
56
56
|
currentBranch,
|
|
57
57
|
isRepoActiveForCapture,
|
|
58
58
|
repoSyncId,
|
|
59
59
|
resolveRepositoryContext
|
|
60
|
-
} from "../chunk-
|
|
60
|
+
} from "../chunk-XG7S3LIL.js";
|
|
61
61
|
|
|
62
62
|
// src/hooks/prim-hook.ts
|
|
63
63
|
import { spawn } from "child_process";
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
parseAgent,
|
|
5
5
|
readHookStdin,
|
|
6
6
|
shouldSuppressImportedCursorHandler
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-6C3CCVDI.js";
|
|
8
|
+
import "../chunk-K4JWJ6OM.js";
|
|
9
9
|
import {
|
|
10
10
|
daemonRequest
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-5LRKJTLA.js";
|
|
12
12
|
import {
|
|
13
13
|
isRepoActiveForCapture
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-XG7S3LIL.js";
|
|
15
15
|
|
|
16
16
|
// src/hooks/session-end.ts
|
|
17
17
|
var STDIN_TIMEOUT_MS = 1e3;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
kickDaemonEnsure,
|
|
8
8
|
refreshClaudePlugins,
|
|
9
9
|
warmBinCache
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-O2WV5SQZ.js";
|
|
11
11
|
import {
|
|
12
12
|
buildHookOutput,
|
|
13
13
|
handoffHookOutput
|
|
@@ -17,44 +17,44 @@ import {
|
|
|
17
17
|
acknowledgeDecisionFeedback,
|
|
18
18
|
leaseDecisionFeedback,
|
|
19
19
|
renderFeedback
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-7VIMU2HR.js";
|
|
21
21
|
import {
|
|
22
22
|
clearHooksWired,
|
|
23
23
|
recordHooksWired
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-KGBMU76T.js";
|
|
25
25
|
import "../chunk-OYHYCK4K.js";
|
|
26
26
|
import {
|
|
27
27
|
getOrCreateWorkspaceId
|
|
28
28
|
} from "../chunk-EZXEWFDG.js";
|
|
29
29
|
import {
|
|
30
30
|
prepareCodexContext
|
|
31
|
-
} from "../chunk-
|
|
32
|
-
import "../chunk-
|
|
31
|
+
} from "../chunk-XPS6LG6I.js";
|
|
32
|
+
import "../chunk-X5BN67D2.js";
|
|
33
33
|
import {
|
|
34
34
|
fetchAndCacheCollectScope
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-25DDRMWS.js";
|
|
36
36
|
import {
|
|
37
37
|
getSiteUrl,
|
|
38
38
|
isSessionEnded
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-2IRLFOEL.js";
|
|
40
40
|
import {
|
|
41
41
|
normalizeEnvelope,
|
|
42
42
|
parseAgent,
|
|
43
43
|
readHookStdin,
|
|
44
44
|
shouldSuppressImportedCursorHandler
|
|
45
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-6C3CCVDI.js";
|
|
46
46
|
import {
|
|
47
47
|
MANAGED_GIT_HOOK_NAMES
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-K4JWJ6OM.js";
|
|
49
49
|
import {
|
|
50
50
|
daemonRequest
|
|
51
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-5LRKJTLA.js";
|
|
52
52
|
import {
|
|
53
53
|
gitToplevel,
|
|
54
54
|
isRepoActiveForCapture,
|
|
55
55
|
repoActiveFlag,
|
|
56
56
|
setRepoActive
|
|
57
|
-
} from "../chunk-
|
|
57
|
+
} from "../chunk-XG7S3LIL.js";
|
|
58
58
|
|
|
59
59
|
// src/hooks/reauth-notice.ts
|
|
60
60
|
var REAUTH_NOTICE = "[prim] authentication ended \u2014 run `prim auth login` to resume decision capture";
|
package/dist/index.js
CHANGED
|
@@ -19,25 +19,25 @@ import {
|
|
|
19
19
|
resolveRepositoryBinding,
|
|
20
20
|
uninstallGitHookAtPath,
|
|
21
21
|
uninstallProjectGitHook
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-O2WV5SQZ.js";
|
|
23
23
|
import {
|
|
24
24
|
requireDurableIngestAcknowledgement
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-FK7FJPWS.js";
|
|
26
26
|
import {
|
|
27
27
|
checkAffectedDecisions,
|
|
28
28
|
daemonOrDirectGet,
|
|
29
29
|
formatDecisionsWarning
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2Q3OGSTV.js";
|
|
31
31
|
import {
|
|
32
32
|
fetchFeedbackCapability
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-7VIMU2HR.js";
|
|
34
34
|
import {
|
|
35
35
|
POST_COMMIT_GRACE_MS,
|
|
36
36
|
clearHooksWired,
|
|
37
37
|
inspectPostCommitFiring,
|
|
38
38
|
lastConversationCaptured,
|
|
39
39
|
recordHooksWired
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-KGBMU76T.js";
|
|
41
41
|
import {
|
|
42
42
|
isUnattended,
|
|
43
43
|
unattendedEnv
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
rotationIdentity,
|
|
57
57
|
sweepOrphanedDrainProgress,
|
|
58
58
|
writeDrainCheckpoint
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-JJI7FU24.js";
|
|
60
60
|
import {
|
|
61
61
|
MS_PER_SECOND,
|
|
62
62
|
deliveryBacklogState,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
formatStatusline,
|
|
66
66
|
formatTeammates,
|
|
67
67
|
repositoryBindingDiagnosticLabel
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-X5BN67D2.js";
|
|
69
69
|
import {
|
|
70
70
|
bold,
|
|
71
71
|
boundedHealthError,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
isGitHubInstallIntentStatusResponse,
|
|
85
85
|
isMoveIngestRequest,
|
|
86
86
|
stripAnsi
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-25DDRMWS.js";
|
|
88
88
|
import {
|
|
89
89
|
CliManagementResponseError,
|
|
90
90
|
HttpError,
|
|
@@ -101,17 +101,13 @@ import {
|
|
|
101
101
|
setStoredToken,
|
|
102
102
|
stripControlChars,
|
|
103
103
|
terminalSafeLine
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-2IRLFOEL.js";
|
|
105
105
|
import {
|
|
106
106
|
MANAGED_GIT_HOOK_NAMES,
|
|
107
107
|
assertOwnedHookRuntime,
|
|
108
108
|
atomicWrite,
|
|
109
|
-
binFile,
|
|
110
|
-
commandMatchesBin,
|
|
111
|
-
compareSemver,
|
|
112
109
|
ensureRegistration,
|
|
113
110
|
entryHasCommand,
|
|
114
|
-
hookCommandResolutions,
|
|
115
111
|
hookRuntimePaths,
|
|
116
112
|
inspectGitHookEntrypoint,
|
|
117
113
|
inspectHookRuntime,
|
|
@@ -119,38 +115,41 @@ import {
|
|
|
119
115
|
inspectHookRuntimeResolutions2,
|
|
120
116
|
makeRegistration,
|
|
121
117
|
managedHookBlock,
|
|
122
|
-
packageRoot,
|
|
123
|
-
packageVersion,
|
|
124
118
|
performStatus,
|
|
125
119
|
performStatus2,
|
|
126
|
-
pinnedNpxArgs,
|
|
127
120
|
projectRoot,
|
|
128
121
|
readSettings,
|
|
129
122
|
registerClaudeCommands,
|
|
130
123
|
registerCursorCommands,
|
|
131
124
|
removeHookRuntime,
|
|
132
|
-
stableHookCommand,
|
|
133
125
|
stableNodePath,
|
|
134
126
|
stageHookRuntime,
|
|
135
127
|
stripCommand
|
|
136
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-K4JWJ6OM.js";
|
|
137
129
|
import {
|
|
138
130
|
daemonIsLive,
|
|
139
131
|
daemonRequest
|
|
140
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-5LRKJTLA.js";
|
|
141
133
|
import {
|
|
142
134
|
REFRESH_TOKEN_PATH,
|
|
143
135
|
TOKEN_FILE_PATH,
|
|
144
136
|
WorkosConnectProtocolError,
|
|
145
137
|
atomicWriteFile,
|
|
138
|
+
binFile,
|
|
146
139
|
canonicalGitRoot,
|
|
147
140
|
canonicalRepositoryPath,
|
|
141
|
+
commandMatchesBin,
|
|
142
|
+
compareSemver,
|
|
148
143
|
decisionIngestionStatus,
|
|
149
144
|
discoverWorkosConnect,
|
|
150
145
|
gitToplevel,
|
|
146
|
+
hookCommandResolutions,
|
|
151
147
|
isRepoActiveForCapture,
|
|
152
148
|
isValidRepoSyncId,
|
|
153
149
|
mainWorktreeRoot,
|
|
150
|
+
packageRoot,
|
|
151
|
+
packageVersion,
|
|
152
|
+
pinnedNpxArgs,
|
|
154
153
|
pollWorkosDeviceAuthorization,
|
|
155
154
|
primConfigDirectory,
|
|
156
155
|
processIsAlive,
|
|
@@ -160,10 +159,11 @@ import {
|
|
|
160
159
|
requestWorkosDeviceAuthorization,
|
|
161
160
|
resolveAuthCredential,
|
|
162
161
|
setRepoActive,
|
|
162
|
+
stableHookCommand,
|
|
163
163
|
syncDirectory,
|
|
164
164
|
withFileLock,
|
|
165
165
|
withFileLockSync
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-XG7S3LIL.js";
|
|
167
167
|
|
|
168
168
|
// src/index.ts
|
|
169
169
|
import { readFileSync as readFileSync10 } from "fs";
|