@primitive.ai/prim 0.1.0-alpha.126 → 0.1.0-alpha.127
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 +140 -1
- package/SKILL.md +6 -1
- package/dist/{chunk-JFWJN2ME.js → chunk-72NIZMZN.js} +114 -5
- package/dist/{chunk-R6NDP7OF.js → chunk-A5VTE43F.js} +2 -2
- package/dist/{chunk-C5VBPHOS.js → chunk-C4QNBSWB.js} +20 -6
- package/dist/{chunk-BFYJLI7V.js → chunk-F3FDVHR7.js} +1 -1
- package/dist/{chunk-YP4OXKNX.js → chunk-H6X52UVF.js} +1 -1
- package/dist/{chunk-ND6TYHNI.js → chunk-H74RDXKP.js} +2 -2
- package/dist/{chunk-NJBN3WXF.js → chunk-HZI5PBN4.js} +785 -154
- package/dist/{chunk-FYYHBOOM.js → chunk-JCKOW45X.js} +2 -2
- package/dist/{chunk-DT7E3SD5.js → chunk-KFRGVHGB.js} +4 -4
- package/dist/{chunk-TI37ME2D.js → chunk-L6IL4N6Y.js} +16 -7
- package/dist/{chunk-KKUDAQQZ.js → chunk-MGKSZSTV.js} +3 -3
- package/dist/{chunk-ZKXNJB6U.js → chunk-NVDPKW7Z.js} +69 -29
- package/dist/{chunk-NBNQI3YJ.js → chunk-O65UVJZH.js} +6 -3
- package/dist/{chunk-74DQDWLW.js → chunk-R4EYLEIK.js} +7 -2
- package/dist/{chunk-5D2C6RCH.js → chunk-RV3JFSMX.js} +4 -4
- package/dist/{chunk-PPZ56EVJ.js → chunk-TNWI3JWK.js} +1 -1
- package/dist/{chunk-6KXQQ7CQ.js → chunk-URYZDQFH.js} +3 -3
- package/dist/{chunk-L32WYFJT.js → chunk-UUQT5GMO.js} +135 -12
- package/dist/{chunk-EZXIKEMA.js → chunk-VVFVENU4.js} +6 -4
- package/dist/{chunk-O73J3KQQ.js → chunk-WGTUNUIS.js} +5 -2
- package/dist/daemon/server.js +805 -218
- package/dist/hook-runtime/daemon/server.js +805 -218
- package/dist/hook-runtime/hooks/post-commit.js +286 -59
- package/dist/hook-runtime/hooks/post-rewrite.js +278 -51
- package/dist/hook-runtime/hooks/post-tool-use.js +672 -194
- package/dist/hook-runtime/hooks/pre-commit.js +536 -88
- package/dist/hook-runtime/hooks/pre-tool-use-worker.js +608 -157
- package/dist/hook-runtime/hooks/prim-hook.js +642 -167
- package/dist/hook-runtime/hooks/session-end.js +263 -47
- package/dist/hook-runtime/hooks/session-start.js +1103 -476
- package/dist/hook-runtime/index.js +3645 -2120
- package/dist/hook-runtime/statusline-main.js +257 -29
- 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 +14 -15
- package/dist/hooks/prim-hook.js +16 -16
- package/dist/hooks/session-end.js +4 -4
- package/dist/hooks/session-start.js +49 -18
- package/dist/index.js +1014 -271
- package/dist/statusline-main.js +257 -29
- package/package.json +1 -1
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-EZXEWFDG.js";
|
|
4
4
|
import {
|
|
5
5
|
scrubEnvironmentPaths
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-R4EYLEIK.js";
|
|
7
7
|
import {
|
|
8
8
|
isValidRepoSyncId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HZI5PBN4.js";
|
|
10
10
|
|
|
11
11
|
// src/hooks/prim-hook-core.ts
|
|
12
12
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatStatusline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-URYZDQFH.js";
|
|
4
4
|
import {
|
|
5
5
|
daemonPrincipalsMatch,
|
|
6
6
|
daemonRequest,
|
|
7
7
|
resolveDaemonPrincipal
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-H6X52UVF.js";
|
|
9
9
|
import {
|
|
10
10
|
getSiteUrl,
|
|
11
11
|
isSessionEnded,
|
|
12
12
|
terminalSafeText
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NVDPKW7Z.js";
|
|
14
14
|
import {
|
|
15
15
|
decisionIngestionStatus,
|
|
16
16
|
gitToplevel,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
primConfigDirectory,
|
|
19
19
|
repositoryBindingState,
|
|
20
20
|
withFileLock
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HZI5PBN4.js";
|
|
22
22
|
|
|
23
23
|
// src/hooks/codex-context.ts
|
|
24
24
|
import { createHash, randomBytes as randomBytes2 } from "crypto";
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isMoveIngestRequest,
|
|
3
3
|
scheduleCollectScopeRefresh
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WGTUNUIS.js";
|
|
5
5
|
import {
|
|
6
6
|
getPinnedClient,
|
|
7
7
|
getSiteUrl
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NVDPKW7Z.js";
|
|
9
9
|
import {
|
|
10
|
+
identityPending,
|
|
10
11
|
machineApiUrl,
|
|
11
12
|
machineJournalBucket,
|
|
13
|
+
machinePendingBucket,
|
|
12
14
|
parseMachineIdentity
|
|
13
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HZI5PBN4.js";
|
|
14
16
|
|
|
15
17
|
// src/protocol/decision-lifecycle.ts
|
|
16
18
|
var DECISION_LIFECYCLE_PROTOCOL_VERSION = 2;
|
|
@@ -86,11 +88,15 @@ function classifyJournalBuckets(buckets, binding) {
|
|
|
86
88
|
continue;
|
|
87
89
|
}
|
|
88
90
|
if (binding.captureAuthorityKind === "workos_m2m") {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
const apiUrl = machineApiUrl(getSiteUrl());
|
|
92
|
+
if (binding.clientId && (bucket === machineJournalBucket({
|
|
93
|
+
apiUrl,
|
|
91
94
|
clientId: binding.clientId,
|
|
92
95
|
authorizedUserId: binding.authorizedUserId
|
|
93
|
-
})
|
|
96
|
+
}) || // What this client captured before its identity was verified. Those
|
|
97
|
+
// belong to whoever the server says the client is, which is now
|
|
98
|
+
// known; no verified identity's bucket is opened this way.
|
|
99
|
+
bucket === machinePendingBucket({ apiUrl, clientId: binding.clientId })))
|
|
94
100
|
deliverableBuckets.add(bucket);
|
|
95
101
|
else
|
|
96
102
|
retainedBuckets.push({
|
|
@@ -120,7 +126,10 @@ function buildOrganizationBoundMoveRequest(batch, binding) {
|
|
|
120
126
|
}
|
|
121
127
|
const { captureActor, ...wireMove } = move;
|
|
122
128
|
if (binding.captureAuthorityKind === "workos_m2m") {
|
|
123
|
-
if (!captureActor || captureActor.clientId !== binding.clientId || captureActor.
|
|
129
|
+
if (!captureActor || captureActor.clientId !== binding.clientId || captureActor.apiUrl !== machineApiUrl(getSiteUrl()) || // An identity-pending actor names only its client and is bound to
|
|
130
|
+
// the identity verified for it. Any other actor is a claim about a
|
|
131
|
+
// verified identity and must match this one exactly.
|
|
132
|
+
!identityPending(captureActor) && (captureActor.authorizedUserId !== binding.authorizedUserId || captureActor.machineId && captureActor.machineId !== binding.machineId || captureActor.organizationId && captureActor.organizationId !== binding.organizationId))
|
|
124
133
|
throw new InvalidJournalEnvelopeError();
|
|
125
134
|
} else if (captureActor) throw new InvalidJournalEnvelopeError();
|
|
126
135
|
return {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inspectHookRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UUQT5GMO.js";
|
|
4
4
|
import {
|
|
5
5
|
isDemoStatusResponse
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WGTUNUIS.js";
|
|
7
7
|
import {
|
|
8
8
|
atomicWriteFile,
|
|
9
9
|
primConfigDirectory,
|
|
10
10
|
withFileLock,
|
|
11
11
|
withFileLockSync
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HZI5PBN4.js";
|
|
13
13
|
|
|
14
14
|
// src/hooks/pre-tool-use-scoring.ts
|
|
15
15
|
import { isAbsolute, relative, sep } from "path";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CLOUD_CREDENTIALS_REMEDY,
|
|
2
3
|
CREDENTIAL_FAMILY_PATH,
|
|
3
4
|
CREDENTIAL_LOCK_PATH,
|
|
4
5
|
CREDENTIAL_METADATA_PATH,
|
|
@@ -15,7 +16,9 @@ import {
|
|
|
15
16
|
atomicWriteFile,
|
|
16
17
|
cachedMachineCredential,
|
|
17
18
|
ensureDurableDirectory,
|
|
19
|
+
forwardMachineRequest,
|
|
18
20
|
hasMachineConfiguration,
|
|
21
|
+
isClaudeCloudSession,
|
|
19
22
|
jwtExpiresAt,
|
|
20
23
|
machineContext,
|
|
21
24
|
machineSessionEnded,
|
|
@@ -25,11 +28,12 @@ import {
|
|
|
25
28
|
readBoundedJson,
|
|
26
29
|
readCredentialMigrationState,
|
|
27
30
|
readStoredCredentialMetadata,
|
|
31
|
+
rejectedCredentialsMessage,
|
|
28
32
|
resolveAuthCredential,
|
|
29
33
|
syncDirectory,
|
|
30
34
|
withFileLock,
|
|
31
35
|
workosConnectTokenEndpoint
|
|
32
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-HZI5PBN4.js";
|
|
33
37
|
|
|
34
38
|
// src/decisions/identity.ts
|
|
35
39
|
var PUBLIC_ID = /^dec_[0-9a-f]{8}$/u;
|
|
@@ -263,6 +267,9 @@ var CREDENTIAL_FILE_MODE = 384;
|
|
|
263
267
|
var REFRESH_THRESHOLD_MS = 6e4;
|
|
264
268
|
var DEFAULT_API_URL = "https://api.getprimitive.ai";
|
|
265
269
|
var AUTH_EXPIRED_MESSAGE = "Authentication expired. Run `prim auth login` to re-authenticate.";
|
|
270
|
+
function authExpiredMessage() {
|
|
271
|
+
return isClaudeCloudSession() ? `Primitive credentials are missing or rejected in this Claude Code cloud session: ${CLOUD_CREDENTIALS_REMEDY}.` : AUTH_EXPIRED_MESSAGE;
|
|
272
|
+
}
|
|
266
273
|
function readTrimmed(path) {
|
|
267
274
|
try {
|
|
268
275
|
const value = readFileSync2(path, "utf8").trim();
|
|
@@ -699,7 +706,7 @@ var CliManagementResponseError = class extends Error {
|
|
|
699
706
|
var CLI_MANAGEMENT_RESPONSE_MAX_BYTES = 2 * 1024 * 1024;
|
|
700
707
|
async function managementResponseValue(response) {
|
|
701
708
|
if (response.status === 401) {
|
|
702
|
-
throw new HttpError(401,
|
|
709
|
+
throw new HttpError(401, authExpiredMessage());
|
|
703
710
|
}
|
|
704
711
|
let value;
|
|
705
712
|
try {
|
|
@@ -721,23 +728,50 @@ function selectedCredential() {
|
|
|
721
728
|
}
|
|
722
729
|
return _cachedCredential;
|
|
723
730
|
}
|
|
731
|
+
async function requestHeaders(method, path) {
|
|
732
|
+
return {
|
|
733
|
+
"Content-Type": "application/json",
|
|
734
|
+
...method === "POST" && path === "/api/cli/moves/ingest" ? await ingestUploaderHeaders() : {}
|
|
735
|
+
};
|
|
736
|
+
}
|
|
724
737
|
async function fetchWithToken(method, path, body, options, token, siteUrl) {
|
|
725
738
|
return fetch(`${siteUrl}${path}`, {
|
|
726
739
|
method,
|
|
727
|
-
headers: {
|
|
728
|
-
Authorization: `Bearer ${token}`,
|
|
729
|
-
"Content-Type": "application/json",
|
|
730
|
-
...method === "POST" && path === "/api/cli/moves/ingest" ? await ingestUploaderHeaders() : {}
|
|
731
|
-
},
|
|
740
|
+
headers: { Authorization: `Bearer ${token}`, ...await requestHeaders(method, path) },
|
|
732
741
|
body: body === void 0 ? void 0 : JSON.stringify(body),
|
|
733
742
|
signal: options?.signal,
|
|
734
743
|
redirect: options?.redirect
|
|
735
744
|
});
|
|
736
745
|
}
|
|
746
|
+
async function fetchAsMachine(credential, method, path, body, options) {
|
|
747
|
+
if (!credential.tokenInjection)
|
|
748
|
+
return fetchWithToken(
|
|
749
|
+
method,
|
|
750
|
+
path,
|
|
751
|
+
body,
|
|
752
|
+
{ ...options, redirect: "error" },
|
|
753
|
+
credential.accessToken,
|
|
754
|
+
credential.apiUrl
|
|
755
|
+
);
|
|
756
|
+
try {
|
|
757
|
+
return await forwardMachineRequest(
|
|
758
|
+
{
|
|
759
|
+
method,
|
|
760
|
+
path,
|
|
761
|
+
headers: await requestHeaders(method, path),
|
|
762
|
+
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
763
|
+
},
|
|
764
|
+
options.signal
|
|
765
|
+
);
|
|
766
|
+
} catch (error) {
|
|
767
|
+
if (!(error instanceof MachineAuthError)) throw error;
|
|
768
|
+
throw new HttpError(error.terminal ? 401 : 503, error.message, { error: error.code });
|
|
769
|
+
}
|
|
770
|
+
}
|
|
737
771
|
async function responseValue(response) {
|
|
738
772
|
if (!response.ok) {
|
|
739
773
|
if (response.status === 401) {
|
|
740
|
-
throw new HttpError(401,
|
|
774
|
+
throw new HttpError(401, authExpiredMessage());
|
|
741
775
|
}
|
|
742
776
|
const errorBody = await response.json().catch(() => null);
|
|
743
777
|
const errorRecord = typeof errorBody === "object" && errorBody !== null && !Array.isArray(errorBody) ? errorBody : void 0;
|
|
@@ -764,14 +798,7 @@ async function machineClient(options = {}, management = false) {
|
|
|
764
798
|
const current = await acquireMachineCredential({ signal: requestOptions.signal });
|
|
765
799
|
if (!current || current.generation !== selected.generation || current.machineId !== selected.machineId || current.authorizedUserId !== selected.authorizedUserId || current.organizationId !== selected.organizationId)
|
|
766
800
|
throw new HttpError(409, "Machine identity changed; restart the operation.");
|
|
767
|
-
let response = await
|
|
768
|
-
method,
|
|
769
|
-
path,
|
|
770
|
-
body,
|
|
771
|
-
{ ...requestOptions, redirect: "error" },
|
|
772
|
-
current.accessToken,
|
|
773
|
-
selected.apiUrl
|
|
774
|
-
);
|
|
801
|
+
let response = await fetchAsMachine(current, method, path, body, requestOptions);
|
|
775
802
|
if (response.status === 401) {
|
|
776
803
|
const renewed = await acquireMachineCredential({
|
|
777
804
|
force: true,
|
|
@@ -780,19 +807,14 @@ async function machineClient(options = {}, management = false) {
|
|
|
780
807
|
if (!renewed || renewed.generation !== selected.generation || renewed.machineId !== selected.machineId || renewed.authorizedUserId !== selected.authorizedUserId || renewed.organizationId !== selected.organizationId) {
|
|
781
808
|
throw new HttpError(409, "Machine identity changed; restart the operation.");
|
|
782
809
|
}
|
|
783
|
-
response = await
|
|
784
|
-
method,
|
|
785
|
-
path,
|
|
786
|
-
body,
|
|
787
|
-
{ ...requestOptions, redirect: "error" },
|
|
788
|
-
renewed.accessToken,
|
|
789
|
-
renewed.apiUrl
|
|
790
|
-
);
|
|
810
|
+
response = await fetchAsMachine(renewed, method, path, body, requestOptions);
|
|
791
811
|
}
|
|
792
812
|
if (response.status === 401)
|
|
793
813
|
throw new HttpError(
|
|
794
814
|
401,
|
|
795
|
-
"Machine access was rejected.
|
|
815
|
+
selected.tokenInjection ? "Machine access was rejected. Check the cloud environment's OAuth 2.0 client credentials network secret, or mint a replacement credential if this one was revoked." : rejectedCredentialsMessage(
|
|
816
|
+
"Machine access was rejected. Ask your administrator to check or rotate its credentials."
|
|
817
|
+
)
|
|
796
818
|
);
|
|
797
819
|
return parse(response);
|
|
798
820
|
};
|
|
@@ -818,10 +840,10 @@ async function request(method, path, body, options) {
|
|
|
818
840
|
if (token) credential = { token, source: "token_file" };
|
|
819
841
|
}
|
|
820
842
|
if (!credential) {
|
|
821
|
-
throw new HttpError(401,
|
|
843
|
+
throw new HttpError(401, authExpiredMessage());
|
|
822
844
|
}
|
|
823
845
|
if (isTokenExpiringSoon(credential) && isSessionEnded()) {
|
|
824
|
-
throw new HttpError(401,
|
|
846
|
+
throw new HttpError(401, authExpiredMessage());
|
|
825
847
|
}
|
|
826
848
|
const tokenUsed = credential.token;
|
|
827
849
|
let response = await fetchWithToken(method, path, body, options, tokenUsed, siteUrl);
|
|
@@ -861,7 +883,7 @@ async function getPinnedClient(options = {}) {
|
|
|
861
883
|
if (token2) credential = { token: token2, source: "token_file" };
|
|
862
884
|
}
|
|
863
885
|
if (!credential || isTokenExpiringSoon(credential) && isSessionEnded()) {
|
|
864
|
-
throw new HttpError(401,
|
|
886
|
+
throw new HttpError(401, authExpiredMessage());
|
|
865
887
|
}
|
|
866
888
|
const token = credential.token;
|
|
867
889
|
const pinnedRequest = async (method, path, body, requestOptions) => responseValue(await fetchWithToken(method, path, body, requestOptions, token, siteUrl));
|
|
@@ -870,6 +892,22 @@ async function getPinnedClient(options = {}) {
|
|
|
870
892
|
post: (path, body, requestOptions) => pinnedRequest("POST", path, body, requestOptions)
|
|
871
893
|
};
|
|
872
894
|
}
|
|
895
|
+
function getBearerClient(token, siteUrl) {
|
|
896
|
+
const pinnedRequest = async (method, path, body, requestOptions) => responseValue(
|
|
897
|
+
await fetchWithToken(
|
|
898
|
+
method,
|
|
899
|
+
path,
|
|
900
|
+
body,
|
|
901
|
+
{ ...requestOptions, redirect: "error" },
|
|
902
|
+
token,
|
|
903
|
+
siteUrl
|
|
904
|
+
)
|
|
905
|
+
);
|
|
906
|
+
return {
|
|
907
|
+
get: (path, requestOptions) => pinnedRequest("GET", path, void 0, requestOptions),
|
|
908
|
+
post: (path, body, requestOptions) => pinnedRequest("POST", path, body, requestOptions)
|
|
909
|
+
};
|
|
910
|
+
}
|
|
873
911
|
async function getPinnedManagementClient(options = {}) {
|
|
874
912
|
const machine = await machineClient(options, true);
|
|
875
913
|
if (machine) return machine;
|
|
@@ -883,7 +921,7 @@ async function getPinnedManagementClient(options = {}) {
|
|
|
883
921
|
if (token2) credential = { token: token2, source: "token_file" };
|
|
884
922
|
}
|
|
885
923
|
if (!credential || isTokenExpiringSoon(credential) && isSessionEnded()) {
|
|
886
|
-
throw new HttpError(401,
|
|
924
|
+
throw new HttpError(401, authExpiredMessage());
|
|
887
925
|
}
|
|
888
926
|
const token = credential.token;
|
|
889
927
|
const pinnedRequest = async (method, path, body, requestOptions) => managementResponseValue(
|
|
@@ -902,6 +940,7 @@ export {
|
|
|
902
940
|
terminalSafeLine,
|
|
903
941
|
isTerminalSafeText,
|
|
904
942
|
stripControlChars,
|
|
943
|
+
DEFAULT_API_URL,
|
|
905
944
|
getSiteUrl,
|
|
906
945
|
getSiteUrlForEnvironment,
|
|
907
946
|
getTokenExpiresAt,
|
|
@@ -914,5 +953,6 @@ export {
|
|
|
914
953
|
CliManagementResponseError,
|
|
915
954
|
getClient,
|
|
916
955
|
getPinnedClient,
|
|
956
|
+
getBearerClient,
|
|
917
957
|
getPinnedManagementClient
|
|
918
958
|
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSiteUrl
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NVDPKW7Z.js";
|
|
4
4
|
import {
|
|
5
5
|
atomicWriteFile,
|
|
6
6
|
ensureDurableDirectory,
|
|
7
7
|
hasMachineConfiguration,
|
|
8
|
+
identityPending,
|
|
8
9
|
jwtOrganizationId,
|
|
9
10
|
machineCaptureActor,
|
|
10
11
|
machineContext,
|
|
11
12
|
machineJournalBucket,
|
|
13
|
+
machinePendingBucket,
|
|
12
14
|
primConfigDirectory,
|
|
13
15
|
resolveAuthCredential
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HZI5PBN4.js";
|
|
15
17
|
|
|
16
18
|
// src/journal.ts
|
|
17
19
|
import {
|
|
@@ -155,7 +157,8 @@ function journalPath(orgId) {
|
|
|
155
157
|
function appendMove(move, orgId) {
|
|
156
158
|
const actor = machineCaptureActor();
|
|
157
159
|
const captured = actor ? { ...move, captureActor: actor } : move;
|
|
158
|
-
|
|
160
|
+
const bucket = actor ? identityPending(actor) ? machinePendingBucket(actor) : machineJournalBucket(actor) : orgId;
|
|
161
|
+
appendMoveToPath(journalPath(bucket), captured);
|
|
159
162
|
return captured;
|
|
160
163
|
}
|
|
161
164
|
function parseMoves(content) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
boundedHealthError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WGTUNUIS.js";
|
|
4
4
|
import {
|
|
5
5
|
terminalSafeLine
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NVDPKW7Z.js";
|
|
7
7
|
|
|
8
8
|
// src/hooks/redact.ts
|
|
9
9
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
@@ -51,6 +51,11 @@ var DEFAULT_RULES = [
|
|
|
51
51
|
pattern: /\bAWS_(?:SECRET_ACCESS_KEY|SESSION_TOKEN)"?\s*[:=]\s*["']?[A-Za-z0-9/+=]{20,}["']?/gi,
|
|
52
52
|
reason: "aws-secret"
|
|
53
53
|
},
|
|
54
|
+
{
|
|
55
|
+
// `prim auth enroll --print-env` output an agent may write into a file.
|
|
56
|
+
pattern: /\bPRIM_M2M_CLIENT_SECRET"?\s*[:=]\s*["']?[^\s"']+["']?/g,
|
|
57
|
+
reason: "prim-m2m-secret"
|
|
58
|
+
},
|
|
54
59
|
{ pattern: /\bAIza[0-9A-Za-z_-]{35}(?![0-9A-Za-z_-])/g, reason: "gcp-api-key" },
|
|
55
60
|
{
|
|
56
61
|
pattern: /\bya29\.[0-9A-Za-z_-]{20,}(?![0-9A-Za-z_-])/g,
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
analyzeShellTargets,
|
|
6
6
|
extractFileTargets
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MGKSZSTV.js";
|
|
8
8
|
import {
|
|
9
9
|
scrubEnvironmentPaths
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-R4EYLEIK.js";
|
|
11
11
|
import {
|
|
12
12
|
cachedCollectScopeAdmits
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WGTUNUIS.js";
|
|
14
14
|
import {
|
|
15
15
|
canonicalRepositoryPath,
|
|
16
16
|
currentBranch,
|
|
17
17
|
isRepoActiveForCapture,
|
|
18
18
|
relatedWorktreeTarget,
|
|
19
19
|
repoSyncId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HZI5PBN4.js";
|
|
21
21
|
|
|
22
22
|
// src/hooks/file-refs.ts
|
|
23
23
|
var MAX_PREFLIGHT_FILE_TARGETS = 25;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
boundedHealthError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WGTUNUIS.js";
|
|
4
4
|
import {
|
|
5
5
|
stripControlChars
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NVDPKW7Z.js";
|
|
7
7
|
import {
|
|
8
8
|
hasMachineConfiguration
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HZI5PBN4.js";
|
|
10
10
|
|
|
11
11
|
// src/lib/delivery-backlog.ts
|
|
12
12
|
var MS_PER_SECOND = 1e3;
|