@tangle-network/cli-agent-registry 0.15.32 → 0.15.34
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/{backend-types-BZoSzUzQ.d.mts → backend-types-DRmLR1e0.d.mts} +1 -1
- package/dist/backend-types.d.mts +1 -1
- package/dist/{cli-auth-bundle-DcxhAW23.mjs → cli-auth-bundle-B4SGUcYM.mjs} +26 -27
- package/dist/cli-auth-bundle.d.mts +240 -2
- package/dist/cli-auth-bundle.mjs +2 -2
- package/dist/cli-auth-placeholder.d.mts +138 -6
- package/dist/cli-auth-placeholder.mjs +202 -44
- package/dist/cli-backend-auth-env.mjs +12 -202
- package/dist/default-backend.d.mts +1 -1
- package/dist/default-backend.mjs +1 -1
- package/dist/harness-Dn0LC8Pe.mjs +346 -0
- package/dist/host-contracts.d.mts +2 -2
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/local-cli-auth.d.mts +1 -1
- package/dist/local-cli-auth.mjs +1 -1
- package/dist/native-session-contracts.d.mts +1 -1
- package/dist/public-profile-request-BwBfLgGv.d.mts +17 -0
- package/dist/servable-models.mjs +1 -1
- package/dist/{session-contract-IJy6T_nD.d.mts → session-contract-Cx8ziXIJ.d.mts} +1 -1
- package/dist/session-contract.d.mts +1 -1
- package/dist/{spec-BJnoebFr.d.mts → spec-Br00Ybw5.d.mts} +2 -2
- package/dist/specs-CStHlNhB.d.mts +84 -0
- package/dist/{specs-D_iuiC3T.mjs → specs-CZ6eAF6G.mjs} +47 -9
- package/dist/specs.d.mts +4 -72
- package/dist/specs.mjs +2 -2
- package/package.json +4 -3
- package/dist/cli-auth-bundle-BIABHp5D.d.mts +0 -51
|
@@ -44,4 +44,4 @@ declare function isBackendType(value: string): value is BackendType;
|
|
|
44
44
|
declare function parseBackendType(value: string): BackendType;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { isBackendType as a, backendTypeSchema as i, BACKEND_TYPE as n, parseBackendType as o, BackendType as r, ALL_BACKEND_TYPES as t };
|
|
47
|
-
//# sourceMappingURL=backend-types-
|
|
47
|
+
//# sourceMappingURL=backend-types-DRmLR1e0.d.mts.map
|
package/dist/backend-types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as isBackendType, i as backendTypeSchema, n as BACKEND_TYPE, o as parseBackendType, r as BackendType, t as ALL_BACKEND_TYPES } from "./backend-types-
|
|
1
|
+
import { a as isBackendType, i as backendTypeSchema, n as BACKEND_TYPE, o as parseBackendType, r as BackendType, t as ALL_BACKEND_TYPES } from "./backend-types-DRmLR1e0.mjs";
|
|
2
2
|
export { ALL_BACKEND_TYPES, BACKEND_TYPE, BackendType, backendTypeSchema, isBackendType, parseBackendType };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as getSpec } from "./specs-
|
|
2
|
-
import "@tangle-network/agent-interface";
|
|
1
|
+
import { l as getSpec } from "./specs-CZ6eAF6G.mjs";
|
|
2
|
+
import { ProxySecretReceiptSchema } from "@tangle-network/agent-interface";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region ../runtime-contracts/dist/public-profile-request.js
|
|
5
5
|
const cliAuthReferenceSchema = z.strictObject({
|
|
@@ -13,22 +13,33 @@ const cliAuthReferenceSchema = z.strictObject({
|
|
|
13
13
|
});
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli-auth-bundle.ts
|
|
16
|
+
const nativeCredentialSelectionSchema = z.strictObject({
|
|
17
|
+
harness: z.enum(["claude-code", "codex"]),
|
|
18
|
+
cliAuth: cliAuthReferenceSchema
|
|
19
|
+
}).refine(({ harness, cliAuth }) => harness === "claude-code" ? cliAuth.format === "token" : cliAuth.format === "bundle" || cliAuth.format === "files");
|
|
20
|
+
/** A legacy seat replies installed; canonical admission returns its proxy receipt, pending HOME or revoked on retirement. */
|
|
21
|
+
const legacyNativeCredentialReplySchema = nativeCredentialSelectionSchema.safeExtend({ installed: z.literal(true) });
|
|
22
|
+
const canonicalNativeCredentialReplySchema = nativeCredentialSelectionSchema.safeExtend({ proxySecretReceipt: ProxySecretReceiptSchema });
|
|
16
23
|
const DEFAULT_MODE = 384;
|
|
17
24
|
const AUTH_BUNDLE_PATHS = Object.freeze({
|
|
18
25
|
codex: ".codex/auth.json",
|
|
19
26
|
"claude-code": ".claude/.credentials.json"
|
|
20
27
|
});
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (typeof
|
|
25
|
-
let value;
|
|
28
|
+
/** Decode credential JSON without retaining parser diagnostics or their causes. */
|
|
29
|
+
const cliAuthObjectSchema = z.record(z.string(), z.unknown());
|
|
30
|
+
function parseCliAuthJson(raw, message, schema) {
|
|
31
|
+
if (typeof raw !== "string") throw new Error(message);
|
|
26
32
|
try {
|
|
27
|
-
value = JSON.parse(
|
|
33
|
+
const value = JSON.parse(raw);
|
|
34
|
+
return schema ? schema.parse(value) : value;
|
|
28
35
|
} catch {
|
|
29
|
-
throw new Error(
|
|
36
|
+
throw new Error(message);
|
|
30
37
|
}
|
|
31
|
-
|
|
38
|
+
}
|
|
39
|
+
/** Convert a native credential JSON bundle without reading host credentials. */
|
|
40
|
+
function materializeCliAuthBundle(backendType, rawBundle) {
|
|
41
|
+
if (backendType !== "codex" && backendType !== "claude-code") throw new Error("CLI auth bundle is not supported for the selected backend");
|
|
42
|
+
parseCliAuthJson(rawBundle, "CLI auth bundle must be a JSON object", cliAuthObjectSchema);
|
|
32
43
|
return [{
|
|
33
44
|
path: AUTH_BUNDLE_PATHS[backendType],
|
|
34
45
|
content: rawBundle,
|
|
@@ -69,27 +80,15 @@ function resolveCliAuthReference(backendType, model, environment) {
|
|
|
69
80
|
tokenEnvironment: { [tokenEnv]: value }
|
|
70
81
|
};
|
|
71
82
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
authFiles: materializeCliAuthBundle(backendType, value),
|
|
75
|
-
tokenEnvironment: {}
|
|
76
|
-
};
|
|
77
|
-
let parsed;
|
|
78
|
-
try {
|
|
79
|
-
parsed = JSON.parse(value);
|
|
80
|
-
} catch {
|
|
81
|
-
throw new Error("Native authFiles secret must contain a JSON array of auth files");
|
|
82
|
-
}
|
|
83
|
-
const files = cliAuthFilesSchema.safeParse(parsed);
|
|
84
|
-
if (!files.success) throw new Error("Native authFiles secret must contain a JSON array of auth files");
|
|
85
|
-
if (backendType === "codex" && (files.data.length !== 1 || files.data[0]?.path !== AUTH_BUNDLE_PATHS.codex || files.data[0]?.content.trim().length === 0)) throw new Error("Codex native auth files require only .codex/auth.json");
|
|
83
|
+
const files = reference.format === "bundle" ? materializeCliAuthBundle(backendType, value) : parseCliAuthJson(value, "Native authFiles secret must contain a JSON array of auth files", cliAuthFilesSchema);
|
|
84
|
+
if (backendType === "codex" && (files.length !== 1 || files[0]?.path !== AUTH_BUNDLE_PATHS.codex || files[0]?.content.trim().length === 0)) throw new Error("Codex native auth files require only .codex/auth.json");
|
|
86
85
|
return {
|
|
87
86
|
reference,
|
|
88
|
-
authFiles: files
|
|
87
|
+
authFiles: files,
|
|
89
88
|
tokenEnvironment: {}
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
91
|
//#endregion
|
|
93
|
-
export {
|
|
92
|
+
export { cliAuthFilesSchema as a, materializeCliAuthBundle as c, resolveCliAuthReference as d, cliAuthReferenceSchema as f, canonicalNativeCredentialReplySchema as i, nativeCredentialSelectionSchema as l, CLI_AUTH_REFERENCE_ENV_VAR as n, cliAuthObjectSchema as o, assertCliAuthReferenceSupported as r, legacyNativeCredentialReplySchema as s, AUTH_BUNDLE_PATHS as t, parseCliAuthJson as u };
|
|
94
93
|
|
|
95
|
-
//# sourceMappingURL=cli-auth-bundle-
|
|
94
|
+
//# sourceMappingURL=cli-auth-bundle-B4SGUcYM.mjs.map
|
|
@@ -1,2 +1,240 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { n as cliAuthReferenceSchema, t as CliAuthReference } from "./public-profile-request-BwBfLgGv.mjs";
|
|
2
|
+
import { CliAuthFile } from "@tangle-network/agent-interface";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
//#region src/cli-auth-bundle.d.ts
|
|
6
|
+
declare const nativeCredentialSelectionSchema: z.ZodObject<{
|
|
7
|
+
harness: z.ZodEnum<{
|
|
8
|
+
"claude-code": "claude-code";
|
|
9
|
+
codex: "codex";
|
|
10
|
+
}>;
|
|
11
|
+
cliAuth: z.ZodObject<{
|
|
12
|
+
account: z.ZodString;
|
|
13
|
+
secretEnv: z.ZodString;
|
|
14
|
+
format: z.ZodEnum<{
|
|
15
|
+
token: "token";
|
|
16
|
+
bundle: "bundle";
|
|
17
|
+
files: "files";
|
|
18
|
+
}>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
/** A legacy seat replies installed; canonical admission returns its proxy receipt, pending HOME or revoked on retirement. */
|
|
22
|
+
declare const legacyNativeCredentialReplySchema: z.ZodObject<{
|
|
23
|
+
harness: z.ZodEnum<{
|
|
24
|
+
"claude-code": "claude-code";
|
|
25
|
+
codex: "codex";
|
|
26
|
+
}>;
|
|
27
|
+
cliAuth: z.ZodObject<{
|
|
28
|
+
account: z.ZodString;
|
|
29
|
+
secretEnv: z.ZodString;
|
|
30
|
+
format: z.ZodEnum<{
|
|
31
|
+
token: "token";
|
|
32
|
+
bundle: "bundle";
|
|
33
|
+
files: "files";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
installed: z.ZodLiteral<true>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
declare const canonicalNativeCredentialReplySchema: z.ZodObject<{
|
|
39
|
+
harness: z.ZodEnum<{
|
|
40
|
+
"claude-code": "claude-code";
|
|
41
|
+
codex: "codex";
|
|
42
|
+
}>;
|
|
43
|
+
cliAuth: z.ZodObject<{
|
|
44
|
+
account: z.ZodString;
|
|
45
|
+
secretEnv: z.ZodString;
|
|
46
|
+
format: z.ZodEnum<{
|
|
47
|
+
token: "token";
|
|
48
|
+
bundle: "bundle";
|
|
49
|
+
files: "files";
|
|
50
|
+
}>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
proxySecretReceipt: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
53
|
+
status: z.ZodLiteral<"proxy-installed">;
|
|
54
|
+
materializationAcknowledged: z.ZodLiteral<false>;
|
|
55
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
56
|
+
sandboxId: z.ZodString;
|
|
57
|
+
generation: z.ZodNumber;
|
|
58
|
+
bindings: z.ZodArray<z.ZodObject<{
|
|
59
|
+
envName: z.ZodString;
|
|
60
|
+
secretRef: z.ZodObject<{
|
|
61
|
+
key: z.ZodString;
|
|
62
|
+
kind: z.ZodLiteral<"secret-ref">;
|
|
63
|
+
}, z.core.$strict>;
|
|
64
|
+
grant: z.ZodObject<{
|
|
65
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
66
|
+
grantId: z.ZodString;
|
|
67
|
+
sandboxId: z.ZodString;
|
|
68
|
+
epoch: z.ZodString;
|
|
69
|
+
identity: z.ZodObject<{
|
|
70
|
+
tenantId: z.ZodString;
|
|
71
|
+
issuerId: z.ZodString;
|
|
72
|
+
secretId: z.ZodString;
|
|
73
|
+
revision: z.ZodString;
|
|
74
|
+
}, z.core.$strict>;
|
|
75
|
+
scope: z.ZodObject<{
|
|
76
|
+
hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
77
|
+
methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
78
|
+
paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"bearer">;
|
|
82
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"basic">;
|
|
84
|
+
username: z.ZodString;
|
|
85
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
86
|
+
type: z.ZodLiteral<"header">;
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
type: z.ZodLiteral<"query">;
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
}, z.core.$strict>], "type">;
|
|
92
|
+
placeholderFormat: z.ZodEnum<{
|
|
93
|
+
jwt: "jwt";
|
|
94
|
+
opaque: "opaque";
|
|
95
|
+
}>;
|
|
96
|
+
issuedAt: z.ZodISODateTime;
|
|
97
|
+
expiresAt: z.ZodISODateTime;
|
|
98
|
+
sourceExpiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
99
|
+
parentGrantId: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
}, z.core.$strict>>;
|
|
102
|
+
proxyAcknowledged: z.ZodLiteral<true>;
|
|
103
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
104
|
+
status: z.ZodLiteral<"installed">;
|
|
105
|
+
materializationAcknowledged: z.ZodLiteral<true>;
|
|
106
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
107
|
+
sandboxId: z.ZodString;
|
|
108
|
+
generation: z.ZodNumber;
|
|
109
|
+
bindings: z.ZodArray<z.ZodObject<{
|
|
110
|
+
envName: z.ZodString;
|
|
111
|
+
secretRef: z.ZodObject<{
|
|
112
|
+
key: z.ZodString;
|
|
113
|
+
kind: z.ZodLiteral<"secret-ref">;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
grant: z.ZodObject<{
|
|
116
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
117
|
+
grantId: z.ZodString;
|
|
118
|
+
sandboxId: z.ZodString;
|
|
119
|
+
epoch: z.ZodString;
|
|
120
|
+
identity: z.ZodObject<{
|
|
121
|
+
tenantId: z.ZodString;
|
|
122
|
+
issuerId: z.ZodString;
|
|
123
|
+
secretId: z.ZodString;
|
|
124
|
+
revision: z.ZodString;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
scope: z.ZodObject<{
|
|
127
|
+
hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
128
|
+
methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
129
|
+
paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
132
|
+
type: z.ZodLiteral<"bearer">;
|
|
133
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
134
|
+
type: z.ZodLiteral<"basic">;
|
|
135
|
+
username: z.ZodString;
|
|
136
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
137
|
+
type: z.ZodLiteral<"header">;
|
|
138
|
+
name: z.ZodString;
|
|
139
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
140
|
+
type: z.ZodLiteral<"query">;
|
|
141
|
+
name: z.ZodString;
|
|
142
|
+
}, z.core.$strict>], "type">;
|
|
143
|
+
placeholderFormat: z.ZodEnum<{
|
|
144
|
+
jwt: "jwt";
|
|
145
|
+
opaque: "opaque";
|
|
146
|
+
}>;
|
|
147
|
+
issuedAt: z.ZodISODateTime;
|
|
148
|
+
expiresAt: z.ZodISODateTime;
|
|
149
|
+
sourceExpiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
150
|
+
parentGrantId: z.ZodOptional<z.ZodString>;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
proxyAcknowledged: z.ZodLiteral<true>;
|
|
154
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
155
|
+
status: z.ZodLiteral<"revoked">;
|
|
156
|
+
materializationAcknowledged: z.ZodLiteral<true>;
|
|
157
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
158
|
+
sandboxId: z.ZodString;
|
|
159
|
+
generation: z.ZodNumber;
|
|
160
|
+
bindings: z.ZodArray<z.ZodObject<{
|
|
161
|
+
envName: z.ZodString;
|
|
162
|
+
secretRef: z.ZodObject<{
|
|
163
|
+
key: z.ZodString;
|
|
164
|
+
kind: z.ZodLiteral<"secret-ref">;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
grant: z.ZodObject<{
|
|
167
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
168
|
+
grantId: z.ZodString;
|
|
169
|
+
sandboxId: z.ZodString;
|
|
170
|
+
epoch: z.ZodString;
|
|
171
|
+
identity: z.ZodObject<{
|
|
172
|
+
tenantId: z.ZodString;
|
|
173
|
+
issuerId: z.ZodString;
|
|
174
|
+
secretId: z.ZodString;
|
|
175
|
+
revision: z.ZodString;
|
|
176
|
+
}, z.core.$strict>;
|
|
177
|
+
scope: z.ZodObject<{
|
|
178
|
+
hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
179
|
+
methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
180
|
+
paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
181
|
+
}, z.core.$strict>;
|
|
182
|
+
presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
183
|
+
type: z.ZodLiteral<"bearer">;
|
|
184
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
185
|
+
type: z.ZodLiteral<"basic">;
|
|
186
|
+
username: z.ZodString;
|
|
187
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
188
|
+
type: z.ZodLiteral<"header">;
|
|
189
|
+
name: z.ZodString;
|
|
190
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
191
|
+
type: z.ZodLiteral<"query">;
|
|
192
|
+
name: z.ZodString;
|
|
193
|
+
}, z.core.$strict>], "type">;
|
|
194
|
+
placeholderFormat: z.ZodEnum<{
|
|
195
|
+
jwt: "jwt";
|
|
196
|
+
opaque: "opaque";
|
|
197
|
+
}>;
|
|
198
|
+
issuedAt: z.ZodISODateTime;
|
|
199
|
+
expiresAt: z.ZodISODateTime;
|
|
200
|
+
sourceExpiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
201
|
+
parentGrantId: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, z.core.$strict>;
|
|
203
|
+
}, z.core.$strict>>;
|
|
204
|
+
proxyAcknowledged: z.ZodLiteral<true>;
|
|
205
|
+
}, z.core.$strict>], "status">;
|
|
206
|
+
}, z.core.$strict>;
|
|
207
|
+
type LocalCliAuthFile = CliAuthFile;
|
|
208
|
+
declare const AUTH_BUNDLE_PATHS: Readonly<{
|
|
209
|
+
readonly codex: ".codex/auth.json";
|
|
210
|
+
readonly "claude-code": ".claude/.credentials.json";
|
|
211
|
+
}>;
|
|
212
|
+
/** Decode credential JSON without retaining parser diagnostics or their causes. */
|
|
213
|
+
declare const cliAuthObjectSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
214
|
+
declare function parseCliAuthJson<T = unknown>(raw: string, message: string, schema?: z.ZodType<T>): T;
|
|
215
|
+
/** Convert a native credential JSON bundle without reading host credentials. */
|
|
216
|
+
declare function materializeCliAuthBundle(backendType: string, rawBundle: string): LocalCliAuthFile[];
|
|
217
|
+
declare const CLI_AUTH_REFERENCE_ENV_VAR = "AGENT_INTERNAL_CLI_AUTH_REF";
|
|
218
|
+
type CliAuthMaterial = {
|
|
219
|
+
reference: CliAuthReference;
|
|
220
|
+
authFiles: LocalCliAuthFile[];
|
|
221
|
+
tokenEnvironment: Record<string, string>;
|
|
222
|
+
};
|
|
223
|
+
declare const cliAuthFilesSchema: z.ZodArray<z.ZodObject<{
|
|
224
|
+
path: z.ZodString;
|
|
225
|
+
content: z.ZodString;
|
|
226
|
+
mode: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
}, z.core.$strict>>;
|
|
228
|
+
declare function assertCliAuthReferenceSupported(backendType: string, model: {
|
|
229
|
+
cliAuth?: CliAuthReference;
|
|
230
|
+
authMode?: string;
|
|
231
|
+
apiKey?: string;
|
|
232
|
+
apiKeyEnv?: string;
|
|
233
|
+
baseUrl?: string;
|
|
234
|
+
authFiles?: LocalCliAuthFile[];
|
|
235
|
+
}): CliAuthReference | undefined;
|
|
236
|
+
/** Resolve only the selected injected secret, without copying it into a public config. */
|
|
237
|
+
declare function resolveCliAuthReference(backendType: string, model: Parameters<typeof assertCliAuthReferenceSupported>[1], environment: Readonly<Record<string, string | undefined>>): CliAuthMaterial | undefined;
|
|
238
|
+
//#endregion
|
|
239
|
+
export { AUTH_BUNDLE_PATHS, CLI_AUTH_REFERENCE_ENV_VAR, CliAuthMaterial, type CliAuthReference, LocalCliAuthFile, assertCliAuthReferenceSupported, canonicalNativeCredentialReplySchema, cliAuthFilesSchema, cliAuthObjectSchema, cliAuthReferenceSchema, legacyNativeCredentialReplySchema, materializeCliAuthBundle, nativeCredentialSelectionSchema, parseCliAuthJson, resolveCliAuthReference };
|
|
240
|
+
//# sourceMappingURL=cli-auth-bundle.d.mts.map
|
package/dist/cli-auth-bundle.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as materializeCliAuthBundle, i as
|
|
2
|
-
export { AUTH_BUNDLE_PATHS, CLI_AUTH_REFERENCE_ENV_VAR, assertCliAuthReferenceSupported, cliAuthFilesSchema, cliAuthReferenceSchema, materializeCliAuthBundle, resolveCliAuthReference };
|
|
1
|
+
import { a as cliAuthFilesSchema, c as materializeCliAuthBundle, d as resolveCliAuthReference, f as cliAuthReferenceSchema, i as canonicalNativeCredentialReplySchema, l as nativeCredentialSelectionSchema, n as CLI_AUTH_REFERENCE_ENV_VAR, o as cliAuthObjectSchema, r as assertCliAuthReferenceSupported, s as legacyNativeCredentialReplySchema, t as AUTH_BUNDLE_PATHS, u as parseCliAuthJson } from "./cli-auth-bundle-B4SGUcYM.mjs";
|
|
2
|
+
export { AUTH_BUNDLE_PATHS, CLI_AUTH_REFERENCE_ENV_VAR, assertCliAuthReferenceSupported, canonicalNativeCredentialReplySchema, cliAuthFilesSchema, cliAuthObjectSchema, cliAuthReferenceSchema, legacyNativeCredentialReplySchema, materializeCliAuthBundle, nativeCredentialSelectionSchema, parseCliAuthJson, resolveCliAuthReference };
|
|
@@ -1,7 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as cliAuthReferenceSchema, t as CliAuthReference } from "./public-profile-request-BwBfLgGv.mjs";
|
|
2
|
+
import { CliAuthMaterial, materializeCliAuthBundle } from "./cli-auth-bundle.mjs";
|
|
3
|
+
import { ProxySecretBinding, ProxySecretPresentation, ProxySecretReceiptSchema } from "@tangle-network/agent-interface";
|
|
4
|
+
import { z } from "zod";
|
|
3
5
|
|
|
6
|
+
//#region ../runtime-contracts/dist/proxy-secret-materialization.d.ts
|
|
7
|
+
/** Private compiled transport; real values stay in resolvedSecrets[slot]. */
|
|
8
|
+
declare const proxySecretMaterializationsSchema: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
9
|
+
binding: z.ZodObject<{
|
|
10
|
+
hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
11
|
+
methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
12
|
+
paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
13
|
+
envName: z.ZodString;
|
|
14
|
+
secretRef: z.ZodObject<{
|
|
15
|
+
key: z.ZodString;
|
|
16
|
+
kind: z.ZodLiteral<"secret-ref">;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"bearer">;
|
|
20
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"basic">;
|
|
22
|
+
username: z.ZodString;
|
|
23
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"header">;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"query">;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
}, z.core.$strict>], "type">;
|
|
30
|
+
placeholderFormat: z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
jwt: "jwt";
|
|
32
|
+
opaque: "opaque";
|
|
33
|
+
}>>;
|
|
34
|
+
ttlSeconds: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
grant: z.ZodObject<{
|
|
37
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
38
|
+
grantId: z.ZodString;
|
|
39
|
+
sandboxId: z.ZodString;
|
|
40
|
+
epoch: z.ZodString;
|
|
41
|
+
identity: z.ZodObject<{
|
|
42
|
+
tenantId: z.ZodString;
|
|
43
|
+
issuerId: z.ZodString;
|
|
44
|
+
secretId: z.ZodString;
|
|
45
|
+
revision: z.ZodString;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
scope: z.ZodObject<{
|
|
48
|
+
hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
49
|
+
methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
50
|
+
paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"bearer">;
|
|
54
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"basic">;
|
|
56
|
+
username: z.ZodString;
|
|
57
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
58
|
+
type: z.ZodLiteral<"header">;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"query">;
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
}, z.core.$strict>], "type">;
|
|
64
|
+
placeholderFormat: z.ZodEnum<{
|
|
65
|
+
jwt: "jwt";
|
|
66
|
+
opaque: "opaque";
|
|
67
|
+
}>;
|
|
68
|
+
issuedAt: z.ZodISODateTime;
|
|
69
|
+
expiresAt: z.ZodISODateTime;
|
|
70
|
+
sourceExpiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
71
|
+
parentGrantId: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
placeholder: z.ZodString;
|
|
74
|
+
slot: z.ZodString;
|
|
75
|
+
issuerExpiresAt: z.ZodISODateTime;
|
|
76
|
+
executionExpiresAt: z.ZodISODateTime;
|
|
77
|
+
native: z.ZodOptional<z.ZodUnknown>;
|
|
78
|
+
}, z.core.$strict>, unknown>>;
|
|
79
|
+
type ProxySecretMaterialization = z.infer<typeof proxySecretMaterializationsSchema>[number];
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/native-cli-auth-metadata.d.ts
|
|
82
|
+
/** Sole decoder of the private annotation; it grants no source or scope authority. */
|
|
83
|
+
declare function decodeNativeCliAuthAnnotation(raw: unknown): {
|
|
84
|
+
harness: "claude-code" | "codex";
|
|
85
|
+
cliAuth: {
|
|
86
|
+
account: string;
|
|
87
|
+
secretEnv: string;
|
|
88
|
+
format: "token" | "bundle" | "files";
|
|
89
|
+
};
|
|
90
|
+
component: "account" | "access";
|
|
91
|
+
} | undefined;
|
|
92
|
+
//#endregion
|
|
4
93
|
//#region src/cli-auth-placeholder.d.ts
|
|
94
|
+
declare const MAX_NATIVE_CLI_AUTH_MATERIAL_BYTES: number;
|
|
5
95
|
/** The box env name that holds a Codex seat's account-id placeholder. */
|
|
6
96
|
declare function nativeAccountEnv(secretEnv: string): string;
|
|
7
97
|
declare function isCliAuthPlaceholder(value: string | undefined): value is string;
|
|
@@ -13,8 +103,48 @@ declare function nativeProxyBindings(harness: string, reference: CliAuthReferenc
|
|
|
13
103
|
* passes through; undefined refuses. Refresh and ID tokens never reach a slot.
|
|
14
104
|
*/
|
|
15
105
|
declare function nativeProxyValue(raw: string, presentation: ProxySecretPresentation): string | undefined;
|
|
16
|
-
|
|
17
|
-
|
|
106
|
+
declare const rotationSchema: z.ZodObject<{
|
|
107
|
+
accessToken: z.ZodString;
|
|
108
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
109
|
+
idToken: z.ZodOptional<z.ZodString>;
|
|
110
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
declare const providers: {
|
|
114
|
+
codex: {
|
|
115
|
+
accessToken: string;
|
|
116
|
+
refreshToken: string;
|
|
117
|
+
idToken: string;
|
|
118
|
+
accountId: string;
|
|
119
|
+
oauthProvenance: string;
|
|
120
|
+
};
|
|
121
|
+
"claude-code": {
|
|
122
|
+
accessToken: string;
|
|
123
|
+
refreshToken: string;
|
|
124
|
+
expiresAt: string;
|
|
125
|
+
scopes: string;
|
|
126
|
+
clientId: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
/** TRUSTED HOLDER ONLY. All returned values, including rotatedBundle, stay outside the Box. */
|
|
130
|
+
declare function parseNativeCliAuthMaterial(input: {
|
|
131
|
+
harness: keyof typeof providers;
|
|
132
|
+
cliAuth: z.infer<typeof cliAuthReferenceSchema>;
|
|
133
|
+
secretValue: string;
|
|
134
|
+
rotation?: z.input<typeof rotationSchema>;
|
|
135
|
+
}): {
|
|
136
|
+
rotatedBundle: string;
|
|
137
|
+
accessToken: string;
|
|
138
|
+
accountId: string | undefined;
|
|
139
|
+
refreshToken: string | undefined;
|
|
140
|
+
expiresAt: number | undefined;
|
|
141
|
+
refreshParameters: {
|
|
142
|
+
scopes: string[] | undefined;
|
|
143
|
+
clientId: string | undefined;
|
|
144
|
+
issuer: string | undefined;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
type PlaceholderBootstrap = {
|
|
18
148
|
backendType: string;
|
|
19
149
|
reference: CliAuthReference;
|
|
20
150
|
placeholders: {
|
|
@@ -22,7 +152,9 @@ declare function buildCliAuthPlaceholderMaterial(input: {
|
|
|
22
152
|
account?: string;
|
|
23
153
|
};
|
|
24
154
|
now: Date;
|
|
25
|
-
}
|
|
155
|
+
};
|
|
156
|
+
declare function buildCliAuthPlaceholderMaterial(input: PlaceholderBootstrap): CliAuthMaterial;
|
|
157
|
+
declare function buildCliAuthPlaceholderMaterial(input: readonly ProxySecretMaterialization[]): ReturnType<typeof materializeCliAuthBundle>;
|
|
26
158
|
//#endregion
|
|
27
|
-
export { buildCliAuthPlaceholderMaterial, isCliAuthPlaceholder, nativeAccountEnv, nativeProxyBindings, nativeProxyValue };
|
|
159
|
+
export { MAX_NATIVE_CLI_AUTH_MATERIAL_BYTES, buildCliAuthPlaceholderMaterial, decodeNativeCliAuthAnnotation, isCliAuthPlaceholder, nativeAccountEnv, nativeProxyBindings, nativeProxyValue, parseNativeCliAuthMaterial };
|
|
28
160
|
//# sourceMappingURL=cli-auth-placeholder.d.mts.map
|