@cat-factory/contracts 0.214.0 → 0.215.0
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/binary-generators.d.ts +46 -8
- package/dist/binary-generators.d.ts.map +1 -1
- package/dist/binary-generators.js +24 -4
- package/dist/binary-generators.js.map +1 -1
- package/dist/capability-credentials.d.ts +159 -0
- package/dist/capability-credentials.d.ts.map +1 -0
- package/dist/capability-credentials.js +145 -0
- package/dist/capability-credentials.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/reserved-env-keys.d.ts +50 -0
- package/dist/reserved-env-keys.d.ts.map +1 -0
- package/dist/reserved-env-keys.js +234 -0
- package/dist/reserved-env-keys.js.map +1 -0
- package/dist/routes/capability-credentials.d.ts +148 -0
- package/dist/routes/capability-credentials.d.ts.map +1 -0
- package/dist/routes/capability-credentials.js +34 -0
- package/dist/routes/capability-credentials.js.map +1 -0
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,12 +10,31 @@ import * as v from 'valibot';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const binaryGeneratorCredentialSchema: v.ObjectSchema<{
|
|
12
12
|
/**
|
|
13
|
-
* The credential's key
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* The credential's LOOKUP key: what the secret resolver is asked for, and what a workspace
|
|
14
|
+
* stores its own value under. Also the ENVIRONMENT VARIABLE the agent reads it from unless
|
|
15
|
+
* {@link envName} says otherwise, so it must be a valid POSIX variable name either way: a
|
|
16
|
+
* generator declaring `x-rd-token` would resolve fine and then be dropped by the harness's env
|
|
16
17
|
* validation, which is a silent "the integration just 401s" at run time.
|
|
18
|
+
*
|
|
19
|
+
* It may NOT name a variable the platform's own configuration owns
|
|
20
|
+
* ({@link isReservedPlatformEnvKey}). The resolver reads the key off the deployment's
|
|
21
|
+
* environment and the value is injected into an agent process, so an integration declaring
|
|
22
|
+
* `ENCRYPTION_KEY` would hand a prompt-injectable agent the deployment's master sealing key.
|
|
23
|
+
* Refused here so a deployment learns at boot, and again at dispatch, since a mothership-mode
|
|
24
|
+
* node boot-validates none of the definitions it resolves.
|
|
17
25
|
*/
|
|
18
|
-
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name">]>;
|
|
26
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
27
|
+
/**
|
|
28
|
+
* The environment variable the value is injected as, when that differs from {@link key}. This
|
|
29
|
+
* is the name the agent is told to read, and it is what a vendor SDK that auto-reads its own
|
|
30
|
+
* documented variable needs.
|
|
31
|
+
*
|
|
32
|
+
* Held to the toolchain rule rather than the reserved-platform one, because it reads nothing:
|
|
33
|
+
* the floor above is about what may be READ off the deployment's environment, and an injection
|
|
34
|
+
* name only decides what a variable is called inside this job's agent process. That is what lets
|
|
35
|
+
* an integration keep a vendor's documented name even when a platform prefix family covers it.
|
|
36
|
+
*/
|
|
37
|
+
readonly envName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>, undefined>;
|
|
19
38
|
/**
|
|
20
39
|
* How the integration expects the credential to be presented (`X-RD-Token: <value>`,
|
|
21
40
|
* `Authorization: Bearer <value>`). Folded into the brief verbatim: the agent writes the
|
|
@@ -75,12 +94,31 @@ export declare const binaryGeneratorDefinitionSchema: v.ObjectSchema<{
|
|
|
75
94
|
readonly guidance: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 20000, undefined>]>, undefined>;
|
|
76
95
|
readonly credential: v.OptionalSchema<v.ObjectSchema<{
|
|
77
96
|
/**
|
|
78
|
-
* The credential's key
|
|
79
|
-
*
|
|
80
|
-
*
|
|
97
|
+
* The credential's LOOKUP key: what the secret resolver is asked for, and what a workspace
|
|
98
|
+
* stores its own value under. Also the ENVIRONMENT VARIABLE the agent reads it from unless
|
|
99
|
+
* {@link envName} says otherwise, so it must be a valid POSIX variable name either way: a
|
|
100
|
+
* generator declaring `x-rd-token` would resolve fine and then be dropped by the harness's env
|
|
81
101
|
* validation, which is a silent "the integration just 401s" at run time.
|
|
102
|
+
*
|
|
103
|
+
* It may NOT name a variable the platform's own configuration owns
|
|
104
|
+
* ({@link isReservedPlatformEnvKey}). The resolver reads the key off the deployment's
|
|
105
|
+
* environment and the value is injected into an agent process, so an integration declaring
|
|
106
|
+
* `ENCRYPTION_KEY` would hand a prompt-injectable agent the deployment's master sealing key.
|
|
107
|
+
* Refused here so a deployment learns at boot, and again at dispatch, since a mothership-mode
|
|
108
|
+
* node boot-validates none of the definitions it resolves.
|
|
109
|
+
*/
|
|
110
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
111
|
+
/**
|
|
112
|
+
* The environment variable the value is injected as, when that differs from {@link key}. This
|
|
113
|
+
* is the name the agent is told to read, and it is what a vendor SDK that auto-reads its own
|
|
114
|
+
* documented variable needs.
|
|
115
|
+
*
|
|
116
|
+
* Held to the toolchain rule rather than the reserved-platform one, because it reads nothing:
|
|
117
|
+
* the floor above is about what may be READ off the deployment's environment, and an injection
|
|
118
|
+
* name only decides what a variable is called inside this job's agent process. That is what lets
|
|
119
|
+
* an integration keep a vendor's documented name even when a platform prefix family covers it.
|
|
82
120
|
*/
|
|
83
|
-
readonly
|
|
121
|
+
readonly envName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>, undefined>;
|
|
84
122
|
/**
|
|
85
123
|
* How the integration expects the credential to be presented (`X-RD-Token: <value>`,
|
|
86
124
|
* `Authorization: Bearer <value>`). Folded into the brief verbatim: the agent writes the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary-generators.d.ts","sourceRoot":"","sources":["../src/binary-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"binary-generators.d.ts","sourceRoot":"","sources":["../src/binary-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAsC5B;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B;IAC1C;;;;;;;;;;;;;OAaG;;IAYH;;;;;;;;;OASG;;IAcH;;;;OAIG;;IAEH;;;;;OAKG;;aAEH,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B;IAC1C,iFAAiF;;;IAGjF,2DAA2D;;IAE3D;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;;QAxGH;;;;;;;;;;;;;WAaG;;QAYH;;;;;;;;;WASG;;QAcH;;;;WAIG;;QAEH;;;;;WAKG;;;IAgDH;;;;OAIG;;;;;;;aAEH,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;;;GAQG;AACH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B;;;;IAI1C,0FAA0F;;IAE1F,gGAAgG;;aAEhG,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,EAAE,CAO7E"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
import { binaryModalitySchema, mediaTypeSchema } from './binary-modalities.js';
|
|
3
3
|
import { uploadApiContractSchema } from './foundational-services.js';
|
|
4
|
+
import { isReservedPlatformEnvKey, isToolchainEnvName, reservedEnvKeyMessage, toolchainEnvNameMessage, } from './reserved-env-keys.js';
|
|
4
5
|
// ---------------------------------------------------------------------------
|
|
5
6
|
// Wire vocabulary for GENERATIVE BINARY INTEGRATIONS — the third-party (or in-house) APIs a
|
|
6
7
|
// binary-generating agent kind calls to PRODUCE its deliverable: an image generator, a
|
|
@@ -32,12 +33,31 @@ const slug = v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(64), v.reg
|
|
|
32
33
|
*/
|
|
33
34
|
export const binaryGeneratorCredentialSchema = v.object({
|
|
34
35
|
/**
|
|
35
|
-
* The credential's key
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* The credential's LOOKUP key: what the secret resolver is asked for, and what a workspace
|
|
37
|
+
* stores its own value under. Also the ENVIRONMENT VARIABLE the agent reads it from unless
|
|
38
|
+
* {@link envName} says otherwise, so it must be a valid POSIX variable name either way: a
|
|
39
|
+
* generator declaring `x-rd-token` would resolve fine and then be dropped by the harness's env
|
|
38
40
|
* validation, which is a silent "the integration just 401s" at run time.
|
|
41
|
+
*
|
|
42
|
+
* It may NOT name a variable the platform's own configuration owns
|
|
43
|
+
* ({@link isReservedPlatformEnvKey}). The resolver reads the key off the deployment's
|
|
44
|
+
* environment and the value is injected into an agent process, so an integration declaring
|
|
45
|
+
* `ENCRYPTION_KEY` would hand a prompt-injectable agent the deployment's master sealing key.
|
|
46
|
+
* Refused here so a deployment learns at boot, and again at dispatch, since a mothership-mode
|
|
47
|
+
* node boot-validates none of the definitions it resolves.
|
|
39
48
|
*/
|
|
40
|
-
key: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(128), v.regex(/^[A-Za-z_][A-Za-z0-9_]*$/, 'must be a valid environment variable name')),
|
|
49
|
+
key: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(128), v.regex(/^[A-Za-z_][A-Za-z0-9_]*$/, 'must be a valid environment variable name'), v.check((key) => !isReservedPlatformEnvKey(key), (issue) => reservedEnvKeyMessage(String(issue.input)))),
|
|
50
|
+
/**
|
|
51
|
+
* The environment variable the value is injected as, when that differs from {@link key}. This
|
|
52
|
+
* is the name the agent is told to read, and it is what a vendor SDK that auto-reads its own
|
|
53
|
+
* documented variable needs.
|
|
54
|
+
*
|
|
55
|
+
* Held to the toolchain rule rather than the reserved-platform one, because it reads nothing:
|
|
56
|
+
* the floor above is about what may be READ off the deployment's environment, and an injection
|
|
57
|
+
* name only decides what a variable is called inside this job's agent process. That is what lets
|
|
58
|
+
* an integration keep a vendor's documented name even when a platform prefix family covers it.
|
|
59
|
+
*/
|
|
60
|
+
envName: v.optional(v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(128), v.regex(/^[A-Za-z_][A-Za-z0-9_]*$/, 'must be a valid environment variable name'), v.check((name) => !isToolchainEnvName(name), (issue) => toolchainEnvNameMessage(String(issue.input))))),
|
|
41
61
|
/**
|
|
42
62
|
* How the integration expects the credential to be presented (`X-RD-Token: <value>`,
|
|
43
63
|
* `Authorization: Bearer <value>`). Folded into the brief verbatim: the agent writes the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary-generators.js","sourceRoot":"","sources":["../src/binary-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"binary-generators.js","sourceRoot":"","sources":["../src/binary-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAE/B,8EAA8E;AAC9E,4FAA4F;AAC5F,uFAAuF;AACvF,6CAA6C;AAC7C,EAAE;AACF,+FAA+F;AAC/F,+FAA+F;AAC/F,8FAA8F;AAC9F,8FAA8F;AAC9F,8FAA8F;AAC9F,6FAA6F;AAC7F,+FAA+F;AAC/F,iCAAiC;AACjC,EAAE;AACF,+FAA+F;AAC/F,+FAA+F;AAC/F,uFAAuF;AACvF,2CAA2C;AAC3C,8EAA8E;AAE9E,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CACjB,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,IAAI,EAAE,EACR,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACd,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,EACf,CAAC,CAAC,KAAK,CAAC,sBAAsB,EAAE,4BAA4B,CAAC,CAC9D,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD;;;;;;;;;;;;;O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|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
/**
|
|
3
|
+
* The key a stored credential answers for: the LOOKUP name the capability's definition declares,
|
|
4
|
+
* which is what a resolver is asked for.
|
|
5
|
+
*
|
|
6
|
+
* It is not necessarily the variable the agent reads the value from. A definition that needs a
|
|
7
|
+
* specific variable name in the process it configures declares `envName` beside its `key`, and
|
|
8
|
+
* the store never sees that name: it stores what the resolver is ASKED for, and the injection
|
|
9
|
+
* name is applied afterwards, at dispatch.
|
|
10
|
+
*
|
|
11
|
+
* Held to BOTH lists, which protect different things and neither implies the other:
|
|
12
|
+
*
|
|
13
|
+
* - {@link isReservedPlatformEnvKey}, the platform's own configuration. Storing a value under
|
|
14
|
+
* `ENCRYPTION_KEY` would not read the deployment's key (this store answers first), but the
|
|
15
|
+
* declaration it would satisfy is refused at boot, so accepting it here lets an operator fill
|
|
16
|
+
* in a credential that can never be asked for.
|
|
17
|
+
* - {@link isToolchainEnvName}, the harness's own process. This one is belt-and-braces at this
|
|
18
|
+
* boundary rather than the real guard (the real guard is on `envName` at declaration), because
|
|
19
|
+
* a stored key with no `envName` beside it IS the injected name.
|
|
20
|
+
*/
|
|
21
|
+
export declare const capabilityCredentialKeySchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
22
|
+
/** One stored credential: the key it answers for, and the write-only value sealed at rest. */
|
|
23
|
+
export declare const capabilityCredentialEntrySchema: v.ObjectSchema<{
|
|
24
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
25
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 8192, undefined>]>;
|
|
26
|
+
}, undefined>;
|
|
27
|
+
export type CapabilityCredentialEntry = v.InferOutput<typeof capabilityCredentialEntrySchema>;
|
|
28
|
+
/**
|
|
29
|
+
* The non-secret projection of a stored credential — what the API returns and the UI lists.
|
|
30
|
+
*
|
|
31
|
+
* A KEY and nothing else. There is deliberately no operator-authored description field, unlike a
|
|
32
|
+
* test secret's: what a capability credential is FOR is already stated by the definition that
|
|
33
|
+
* declares it (`usage`, `guidance`), and a second free-text answer beside it is a copy that can
|
|
34
|
+
* disagree with the definition and always wins visually. The read that pairs stored keys with
|
|
35
|
+
* their DECLARATIONS is {@link capabilityCredentialStatusSchema}.
|
|
36
|
+
*/
|
|
37
|
+
export declare const capabilityCredentialRefSchema: v.ObjectSchema<{
|
|
38
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
39
|
+
/** When the value was last written, so the UI can show age without revealing the value. */
|
|
40
|
+
readonly updatedAt: v.NumberSchema<undefined>;
|
|
41
|
+
}, undefined>;
|
|
42
|
+
export type CapabilityCredentialRef = v.InferOutput<typeof capabilityCredentialRefSchema>;
|
|
43
|
+
/**
|
|
44
|
+
* A credential the deployment's registered capabilities actually DECLARE, joined to whether this
|
|
45
|
+
* workspace has stored one.
|
|
46
|
+
*
|
|
47
|
+
* This is the read that makes the store usable rather than a blank key-value form. The keys a
|
|
48
|
+
* workspace must fill in are not a workspace fact at all — they are a property of the
|
|
49
|
+
* deployment's CODE (its `AgentKindRegistry` tool servers, its `BinaryGeneratorRegistry`) — so
|
|
50
|
+
* without projecting them, an operator has to read the deployment's source to learn what to type,
|
|
51
|
+
* and a typo produces a stored credential that is never asked for.
|
|
52
|
+
*
|
|
53
|
+
* Admin-gated on purpose. The workspace SNAPSHOT's generative-integration projection deliberately
|
|
54
|
+
* omits credential key names ("a workspace viewer has no business learning which environment
|
|
55
|
+
* variables the deployment sets"), and that judgement does not change because the value now lives
|
|
56
|
+
* in a row: this rides the same `secrets.manage` surface as the write.
|
|
57
|
+
*/
|
|
58
|
+
export declare const capabilityCredentialStatusSchema: v.ObjectSchema<{
|
|
59
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
60
|
+
/** Which capabilities want it — id + label, so the UI can say who a key is for. */
|
|
61
|
+
readonly declaredBy: v.ArraySchema<v.ObjectSchema<{
|
|
62
|
+
readonly subject: v.PicklistSchema<["tool-server", "binary-generator"], undefined>;
|
|
63
|
+
readonly id: v.StringSchema<undefined>;
|
|
64
|
+
readonly label: v.StringSchema<undefined>;
|
|
65
|
+
/** The definition's own note on how the value is presented, when it states one. */
|
|
66
|
+
readonly usage: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
67
|
+
}, undefined>, undefined>;
|
|
68
|
+
/** Whether at least one declaring capability treats it as required. */
|
|
69
|
+
readonly required: v.BooleanSchema<undefined>;
|
|
70
|
+
/** Whether THIS workspace has stored a value. */
|
|
71
|
+
readonly stored: v.BooleanSchema<undefined>;
|
|
72
|
+
/** When the stored value was last written. Absent when nothing is stored. */
|
|
73
|
+
readonly updatedAt: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
74
|
+
}, undefined>;
|
|
75
|
+
export type CapabilityCredentialStatus = v.InferOutput<typeof capabilityCredentialStatusSchema>;
|
|
76
|
+
/** Set/replace a workspace's capability credentials. Values write-only; keys unique. */
|
|
77
|
+
export declare const upsertCapabilityCredentialsSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
78
|
+
readonly entries: v.ArraySchema<v.ObjectSchema<{
|
|
79
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
80
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 8192, undefined>]>;
|
|
81
|
+
}, undefined>, undefined>;
|
|
82
|
+
}, undefined>, v.CheckAction<{
|
|
83
|
+
entries: {
|
|
84
|
+
key: string;
|
|
85
|
+
value: string;
|
|
86
|
+
}[];
|
|
87
|
+
}, "capability credential keys must be unique within a workspace">, v.CheckAction<{
|
|
88
|
+
entries: {
|
|
89
|
+
key: string;
|
|
90
|
+
value: string;
|
|
91
|
+
}[];
|
|
92
|
+
}, "at most 100 capability credentials per workspace">]>;
|
|
93
|
+
export type UpsertCapabilityCredentialsInput = v.InferOutput<typeof upsertCapabilityCredentialsSchema>;
|
|
94
|
+
/**
|
|
95
|
+
* What the credential surface returns: what this deployment's capabilities DECLARE joined to what
|
|
96
|
+
* this workspace has STORED, plus any stored key nothing declares.
|
|
97
|
+
*
|
|
98
|
+
* The orphan half is not tidiness. A capability is deployment CODE, so a workspace's stored key
|
|
99
|
+
* stops being declared whenever the deployment retires an integration or renames a variable — and
|
|
100
|
+
* an orphaned credential is a live secret nobody will ever ask for, sitting sealed in a row. It is
|
|
101
|
+
* reported as its own list rather than dropped from the view, for the same reason an unknown
|
|
102
|
+
* generator id is named rather than filtered: the operator is the only one who can decide whether
|
|
103
|
+
* to delete it or whether the deployment regressed.
|
|
104
|
+
*/
|
|
105
|
+
export declare const capabilityCredentialsViewSchema: v.ObjectSchema<{
|
|
106
|
+
readonly declared: v.ArraySchema<v.ObjectSchema<{
|
|
107
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
108
|
+
/** Which capabilities want it — id + label, so the UI can say who a key is for. */
|
|
109
|
+
readonly declaredBy: v.ArraySchema<v.ObjectSchema<{
|
|
110
|
+
readonly subject: v.PicklistSchema<["tool-server", "binary-generator"], undefined>;
|
|
111
|
+
readonly id: v.StringSchema<undefined>;
|
|
112
|
+
readonly label: v.StringSchema<undefined>;
|
|
113
|
+
/** The definition's own note on how the value is presented, when it states one. */
|
|
114
|
+
readonly usage: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
115
|
+
}, undefined>, undefined>;
|
|
116
|
+
/** Whether at least one declaring capability treats it as required. */
|
|
117
|
+
readonly required: v.BooleanSchema<undefined>;
|
|
118
|
+
/** Whether THIS workspace has stored a value. */
|
|
119
|
+
readonly stored: v.BooleanSchema<undefined>;
|
|
120
|
+
/** When the stored value was last written. Absent when nothing is stored. */
|
|
121
|
+
readonly updatedAt: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
122
|
+
}, undefined>, undefined>;
|
|
123
|
+
/** Stored keys no registered capability declares. */
|
|
124
|
+
readonly orphaned: v.ArraySchema<v.ObjectSchema<{
|
|
125
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
126
|
+
/** When the value was last written, so the UI can show age without revealing the value. */
|
|
127
|
+
readonly updatedAt: v.NumberSchema<undefined>;
|
|
128
|
+
}, undefined>, undefined>;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the deployment ALSO has an environment-variable fallback behind this store. False
|
|
131
|
+
* when a facade wired a store-only resolver.
|
|
132
|
+
*
|
|
133
|
+
* Stated because it changes what an EMPTY row means: with the fallback, a key nothing is stored
|
|
134
|
+
* for may still resolve from the deployment's environment, so the UI must not report it as
|
|
135
|
+
* missing. "Absent" and "zero" again.
|
|
136
|
+
*/
|
|
137
|
+
readonly environmentFallback: v.BooleanSchema<undefined>;
|
|
138
|
+
/**
|
|
139
|
+
* Whether the DECLARATION half of this view is known to be incomplete — the generative
|
|
140
|
+
* integrations are read through `BinaryGeneratorSource`, which THROWS rather than answering an
|
|
141
|
+
* empty set when it cannot reach the mothership, and this surface must not turn that outage
|
|
142
|
+
* into "no integration needs a credential".
|
|
143
|
+
*
|
|
144
|
+
* Its own flag rather than a failed request, because the stored half is still perfectly
|
|
145
|
+
* readable and an operator locked out of their own credential list during someone else's
|
|
146
|
+
* outage is a worse answer than a list with a caveat on it.
|
|
147
|
+
*/
|
|
148
|
+
readonly declarationsIncomplete: v.BooleanSchema<undefined>;
|
|
149
|
+
}, undefined>;
|
|
150
|
+
export type CapabilityCredentialsView = v.InferOutput<typeof capabilityCredentialsViewSchema>;
|
|
151
|
+
/** Validate a decrypted blob at the read boundary, so a drifted row fails clearly and early. */
|
|
152
|
+
export declare const capabilityCredentialEntriesSchema: v.ArraySchema<v.ObjectSchema<{
|
|
153
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>, v.CheckAction<string, (issue: v.CheckIssue<string>) => string>]>;
|
|
154
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 8192, undefined>]>;
|
|
155
|
+
}, undefined>, undefined>;
|
|
156
|
+
export declare function parseCapabilityCredentialEntries(raw: unknown): CapabilityCredentialEntry[];
|
|
157
|
+
/** The non-secret summary persisted beside the sealed values, so a read decrypts nothing. */
|
|
158
|
+
export declare function capabilityCredentialsSummary(entries: CapabilityCredentialEntry[], updatedAt: number): CapabilityCredentialRef[];
|
|
159
|
+
//# sourceMappingURL=capability-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-credentials.d.ts","sourceRoot":"","sources":["../src/capability-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAiC5B;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,2ZAiBzC,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,+BAA+B;;;aAG1C,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B;;IAExC,2FAA2F;;aAE3F,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEzF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gCAAgC;;IAE3C,mFAAmF;;;;;QAM/E,mFAAmF;;;IAIvF,uEAAuE;;IAEvE,iDAAiD;;IAEjD,6EAA6E;;aAE7E,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gCAAgC,CAAC,CAAA;AAE/F,wFAAwF;AACxF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;wDAO7C,CAAA;AACD,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,WAAW,CAC1D,OAAO,iCAAiC,CACzC,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B;;;QA3C1C,mFAAmF;;;;;YAM/E,mFAAmF;;;QAIvF,uEAAuE;;QAEvE,iDAAiD;;QAEjD,6EAA6E;;;IA+B7E,qDAAqD;;;QAnErD,2FAA2F;;;IAqE3F;;;;;;;OAOG;;IAEH;;;;;;;;;OASG;;aAEH,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F,gGAAgG;AAChG,eAAO,MAAM,iCAAiC;;;yBAA2C,CAAA;AACzF,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,OAAO,GAAG,yBAAyB,EAAE,CAE1F;AAED,6FAA6F;AAC7F,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,yBAAyB,EAAE,EACpC,SAAS,EAAE,MAAM,GAChB,uBAAuB,EAAE,CAE3B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { isReservedPlatformEnvKey, isToolchainEnvName, reservedEnvKeyMessage, toolchainEnvNameMessage, } from './reserved-env-keys.js';
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// PER-WORKSPACE capability credentials (SEALED) — the tenant-scoped home for the secrets a
|
|
5
|
+
// registered capability declares.
|
|
6
|
+
//
|
|
7
|
+
// A tool server (MCP) and a generative binary integration each declare the credential they need
|
|
8
|
+
// BY NAME, and the value is resolved per dispatch through the kernel `ToolSecretResolver`. The
|
|
9
|
+
// shipped default reads that name off the DEPLOYMENT'S OWN ENVIRONMENT, which is the right answer
|
|
10
|
+
// for a single-tenant install and the wrong one for every other shape: one process serves many
|
|
11
|
+
// workspaces, so one variable serves them all — every tenant's runs authenticate as whoever set
|
|
12
|
+
// the variable, a tenant cannot supply its own vendor account, rotating one tenant's key means a
|
|
13
|
+
// redeploy, and the value is visible to every operator with shell access to the host.
|
|
14
|
+
//
|
|
15
|
+
// Every other credential in the platform already went the other way: provider API keys, tracker /
|
|
16
|
+
// document / runner / observability connections, personal subscriptions, private package
|
|
17
|
+
// registries and the sensitive test secrets are all per-tenant rows, sealed at rest, edited in
|
|
18
|
+
// the UI. Capabilities are the subsystem that did not get it. This module is that store's wire
|
|
19
|
+
// vocabulary, and it is modelled on `test-secrets.ts` deliberately — same sealed-blob-plus-
|
|
20
|
+
// non-secret-summary shape, same write-only values, same "the view lists KEYS, never values".
|
|
21
|
+
//
|
|
22
|
+
// The env resolver is NOT removed. It becomes the FALLBACK: a workspace that has stored nothing
|
|
23
|
+
// keeps resolving exactly as before, so a local install and a single-tenant deployment need no
|
|
24
|
+
// migration and no UI visit. What changes is which one wins when both have a value — see
|
|
25
|
+
// `composeToolSecretResolvers` in `@cat-factory/server`.
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
/**
|
|
28
|
+
* The key a stored credential answers for: the LOOKUP name the capability's definition declares,
|
|
29
|
+
* which is what a resolver is asked for.
|
|
30
|
+
*
|
|
31
|
+
* It is not necessarily the variable the agent reads the value from. A definition that needs a
|
|
32
|
+
* specific variable name in the process it configures declares `envName` beside its `key`, and
|
|
33
|
+
* the store never sees that name: it stores what the resolver is ASKED for, and the injection
|
|
34
|
+
* name is applied afterwards, at dispatch.
|
|
35
|
+
*
|
|
36
|
+
* Held to BOTH lists, which protect different things and neither implies the other:
|
|
37
|
+
*
|
|
38
|
+
* - {@link isReservedPlatformEnvKey}, the platform's own configuration. Storing a value under
|
|
39
|
+
* `ENCRYPTION_KEY` would not read the deployment's key (this store answers first), but the
|
|
40
|
+
* declaration it would satisfy is refused at boot, so accepting it here lets an operator fill
|
|
41
|
+
* in a credential that can never be asked for.
|
|
42
|
+
* - {@link isToolchainEnvName}, the harness's own process. This one is belt-and-braces at this
|
|
43
|
+
* boundary rather than the real guard (the real guard is on `envName` at declaration), because
|
|
44
|
+
* a stored key with no `envName` beside it IS the injected name.
|
|
45
|
+
*/
|
|
46
|
+
export const capabilityCredentialKeySchema = v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(128), v.regex(/^[A-Za-z_][A-Za-z0-9_]*$/, 'must be a valid environment variable name (letters, digits and underscores, not starting with a digit)'), v.check((key) => !isReservedPlatformEnvKey(key), (issue) => reservedEnvKeyMessage(String(issue.input))), v.check((key) => !isToolchainEnvName(key), (issue) => toolchainEnvNameMessage(String(issue.input))));
|
|
47
|
+
/** One stored credential: the key it answers for, and the write-only value sealed at rest. */
|
|
48
|
+
export const capabilityCredentialEntrySchema = v.object({
|
|
49
|
+
key: capabilityCredentialKeySchema,
|
|
50
|
+
value: v.pipe(v.string(), v.minLength(1), v.maxLength(8192)),
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* The non-secret projection of a stored credential — what the API returns and the UI lists.
|
|
54
|
+
*
|
|
55
|
+
* A KEY and nothing else. There is deliberately no operator-authored description field, unlike a
|
|
56
|
+
* test secret's: what a capability credential is FOR is already stated by the definition that
|
|
57
|
+
* declares it (`usage`, `guidance`), and a second free-text answer beside it is a copy that can
|
|
58
|
+
* disagree with the definition and always wins visually. The read that pairs stored keys with
|
|
59
|
+
* their DECLARATIONS is {@link capabilityCredentialStatusSchema}.
|
|
60
|
+
*/
|
|
61
|
+
export const capabilityCredentialRefSchema = v.object({
|
|
62
|
+
key: capabilityCredentialKeySchema,
|
|
63
|
+
/** When the value was last written, so the UI can show age without revealing the value. */
|
|
64
|
+
updatedAt: v.number(),
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* A credential the deployment's registered capabilities actually DECLARE, joined to whether this
|
|
68
|
+
* workspace has stored one.
|
|
69
|
+
*
|
|
70
|
+
* This is the read that makes the store usable rather than a blank key-value form. The keys a
|
|
71
|
+
* workspace must fill in are not a workspace fact at all — they are a property of the
|
|
72
|
+
* deployment's CODE (its `AgentKindRegistry` tool servers, its `BinaryGeneratorRegistry`) — so
|
|
73
|
+
* without projecting them, an operator has to read the deployment's source to learn what to type,
|
|
74
|
+
* and a typo produces a stored credential that is never asked for.
|
|
75
|
+
*
|
|
76
|
+
* Admin-gated on purpose. The workspace SNAPSHOT's generative-integration projection deliberately
|
|
77
|
+
* omits credential key names ("a workspace viewer has no business learning which environment
|
|
78
|
+
* variables the deployment sets"), and that judgement does not change because the value now lives
|
|
79
|
+
* in a row: this rides the same `secrets.manage` surface as the write.
|
|
80
|
+
*/
|
|
81
|
+
export const capabilityCredentialStatusSchema = v.object({
|
|
82
|
+
key: capabilityCredentialKeySchema,
|
|
83
|
+
/** Which capabilities want it — id + label, so the UI can say who a key is for. */
|
|
84
|
+
declaredBy: v.array(v.object({
|
|
85
|
+
subject: v.picklist(['tool-server', 'binary-generator']),
|
|
86
|
+
id: v.string(),
|
|
87
|
+
label: v.string(),
|
|
88
|
+
/** The definition's own note on how the value is presented, when it states one. */
|
|
89
|
+
usage: v.optional(v.string()),
|
|
90
|
+
})),
|
|
91
|
+
/** Whether at least one declaring capability treats it as required. */
|
|
92
|
+
required: v.boolean(),
|
|
93
|
+
/** Whether THIS workspace has stored a value. */
|
|
94
|
+
stored: v.boolean(),
|
|
95
|
+
/** When the stored value was last written. Absent when nothing is stored. */
|
|
96
|
+
updatedAt: v.optional(v.number()),
|
|
97
|
+
});
|
|
98
|
+
/** Set/replace a workspace's capability credentials. Values write-only; keys unique. */
|
|
99
|
+
export const upsertCapabilityCredentialsSchema = v.pipe(v.object({ entries: v.array(capabilityCredentialEntrySchema) }), v.check((o) => new Set(o.entries.map((e) => e.key)).size === o.entries.length, 'capability credential keys must be unique within a workspace'), v.check((o) => o.entries.length <= 100, 'at most 100 capability credentials per workspace'));
|
|
100
|
+
/**
|
|
101
|
+
* What the credential surface returns: what this deployment's capabilities DECLARE joined to what
|
|
102
|
+
* this workspace has STORED, plus any stored key nothing declares.
|
|
103
|
+
*
|
|
104
|
+
* The orphan half is not tidiness. A capability is deployment CODE, so a workspace's stored key
|
|
105
|
+
* stops being declared whenever the deployment retires an integration or renames a variable — and
|
|
106
|
+
* an orphaned credential is a live secret nobody will ever ask for, sitting sealed in a row. It is
|
|
107
|
+
* reported as its own list rather than dropped from the view, for the same reason an unknown
|
|
108
|
+
* generator id is named rather than filtered: the operator is the only one who can decide whether
|
|
109
|
+
* to delete it or whether the deployment regressed.
|
|
110
|
+
*/
|
|
111
|
+
export const capabilityCredentialsViewSchema = v.object({
|
|
112
|
+
declared: v.array(capabilityCredentialStatusSchema),
|
|
113
|
+
/** Stored keys no registered capability declares. */
|
|
114
|
+
orphaned: v.array(capabilityCredentialRefSchema),
|
|
115
|
+
/**
|
|
116
|
+
* Whether the deployment ALSO has an environment-variable fallback behind this store. False
|
|
117
|
+
* when a facade wired a store-only resolver.
|
|
118
|
+
*
|
|
119
|
+
* Stated because it changes what an EMPTY row means: with the fallback, a key nothing is stored
|
|
120
|
+
* for may still resolve from the deployment's environment, so the UI must not report it as
|
|
121
|
+
* missing. "Absent" and "zero" again.
|
|
122
|
+
*/
|
|
123
|
+
environmentFallback: v.boolean(),
|
|
124
|
+
/**
|
|
125
|
+
* Whether the DECLARATION half of this view is known to be incomplete — the generative
|
|
126
|
+
* integrations are read through `BinaryGeneratorSource`, which THROWS rather than answering an
|
|
127
|
+
* empty set when it cannot reach the mothership, and this surface must not turn that outage
|
|
128
|
+
* into "no integration needs a credential".
|
|
129
|
+
*
|
|
130
|
+
* Its own flag rather than a failed request, because the stored half is still perfectly
|
|
131
|
+
* readable and an operator locked out of their own credential list during someone else's
|
|
132
|
+
* outage is a worse answer than a list with a caveat on it.
|
|
133
|
+
*/
|
|
134
|
+
declarationsIncomplete: v.boolean(),
|
|
135
|
+
});
|
|
136
|
+
/** Validate a decrypted blob at the read boundary, so a drifted row fails clearly and early. */
|
|
137
|
+
export const capabilityCredentialEntriesSchema = v.array(capabilityCredentialEntrySchema);
|
|
138
|
+
export function parseCapabilityCredentialEntries(raw) {
|
|
139
|
+
return v.parse(capabilityCredentialEntriesSchema, raw);
|
|
140
|
+
}
|
|
141
|
+
/** The non-secret summary persisted beside the sealed values, so a read decrypts nothing. */
|
|
142
|
+
export function capabilityCredentialsSummary(entries, updatedAt) {
|
|
143
|
+
return entries.map((entry) => ({ key: entry.key, updatedAt }));
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=capability-credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-credentials.js","sourceRoot":"","sources":["../src/capability-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAE/B,8EAA8E;AAC9E,2FAA2F;AAC3F,kCAAkC;AAClC,EAAE;AACF,gGAAgG;AAChG,+FAA+F;AAC/F,kGAAkG;AAClG,+FAA+F;AAC/F,gGAAgG;AAChG,iGAAiG;AACjG,sFAAsF;AACtF,EAAE;AACF,kGAAkG;AAClG,yFAAyF;AACzF,+FAA+F;AAC/F,+FAA+F;AAC/F,4FAA4F;AAC5F,8FAA8F;AAC9F,EAAE;AACF,gGAAgG;AAChG,+FAA+F;AAC/F,yFAAyF;AACzF,yDAAyD;AACzD,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,IAAI,CACjD,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,IAAI,EAAE,EACR,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACd,CAAC,CAAC,SAAS,CAAC,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sB,EAAE,CAAC,CAAC,OAAO,EAAE;CACpC,CAAC,CAAA;AAGF,gGAAgG;AAChG,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;AACzF,MAAM,UAAU,gCAAgC,CAAC,GAAY;IAC3D,OAAO,CAAC,CAAC,KAAK,CAAC,iCAAiC,EAAE,GAAG,CAAC,CAAA;AACxD,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,4BAA4B,CAC1C,OAAoC,EACpC,SAAiB;IAEjB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;AAChE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from './skill-library.js';
|
|
|
19
19
|
export * from './foundational-services.js';
|
|
20
20
|
export * from './binary-modalities.js';
|
|
21
21
|
export * from './binary-generators.js';
|
|
22
|
+
export * from './reserved-env-keys.js';
|
|
23
|
+
export * from './capability-credentials.js';
|
|
22
24
|
export * from './binary-outputs.js';
|
|
23
25
|
export * from './accounts.js';
|
|
24
26
|
export * from './workspace-members.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,0BAA0B,CAAA;AACxC,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,e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;AAChC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,8 @@ export * from './skill-library.js';
|
|
|
19
19
|
export * from './foundational-services.js';
|
|
20
20
|
export * from './binary-modalities.js';
|
|
21
21
|
export * from './binary-generators.js';
|
|
22
|
+
export * from './reserved-env-keys.js';
|
|
23
|
+
export * from './capability-credentials.js';
|
|
22
24
|
export * from './binary-outputs.js';
|
|
23
25
|
export * from './accounts.js';
|
|
24
26
|
export * from './workspace-members.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAA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jC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name PREFIXES the platform's own configuration owns (compared case-insensitively).
|
|
3
|
+
*
|
|
4
|
+
* These carry the drift protection: a variable added inside one of these families is reserved the
|
|
5
|
+
* day it is read, with no edit here. `scripts/check-reserved-env-keys.mjs` fails CI when a
|
|
6
|
+
* variable documented in `docs/environment-variables.md` is covered by neither this list nor
|
|
7
|
+
* {@link PLATFORM_RESERVED_ENV_KEYS}, so the exact-name list below cannot silently fall behind
|
|
8
|
+
* either.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PLATFORM_RESERVED_ENV_PREFIXES: readonly string[];
|
|
11
|
+
/**
|
|
12
|
+
* The platform's own variables that no {@link PLATFORM_RESERVED_ENV_PREFIXES} family covers —
|
|
13
|
+
* every remaining name read by a facade's config loader, a sweeper, or a model provider.
|
|
14
|
+
*
|
|
15
|
+
* Upper-case by convention; the comparison in {@link isReservedPlatformEnvKey} is
|
|
16
|
+
* case-insensitive, which is load-bearing rather than tidy: `process.env` lookup is
|
|
17
|
+
* case-INSENSITIVE on Windows, so a declaration spelled `encryption_key` would otherwise resolve
|
|
18
|
+
* the real key on a developer's laptop while passing a case-sensitive check.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PLATFORM_RESERVED_ENV_KEYS: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* Whether `key` names a variable the platform's own configuration owns, so a tool server or a
|
|
23
|
+
* generative integration declaring it is refused rather than resolved.
|
|
24
|
+
*
|
|
25
|
+
* Binds the LOOKUP name only: the name a resolver is asked for, and therefore the name that could
|
|
26
|
+
* be read off the deployment's environment. It deliberately does NOT bind the name a resolved
|
|
27
|
+
* value is injected UNDER in the agent's process ({@link isToolchainEnvName} is that rule), and
|
|
28
|
+
* conflating the two is what makes a family like `GITHUB_` unusable for the third-party servers
|
|
29
|
+
* that legitimately own names inside it.
|
|
30
|
+
*
|
|
31
|
+
* Case-insensitive and whitespace-tolerant, because both are ways the same variable is reached:
|
|
32
|
+
* see {@link PLATFORM_RESERVED_ENV_KEYS} on Windows, and the schema trims before it validates.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isReservedPlatformEnvKey(key: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The one operator-facing sentence every refusal of a reserved key uses — the schema issue, the
|
|
37
|
+
* boot problem, and the dispatch-time log line alike.
|
|
38
|
+
*
|
|
39
|
+
* Shared so the three cannot describe the same fault three ways, and phrased as the REMEDY it is:
|
|
40
|
+
* an operator who reads "reserved" without being told to declare a variable of the integration's
|
|
41
|
+
* own tends to try `allowKeys` next, which cannot widen this floor.
|
|
42
|
+
*/
|
|
43
|
+
export declare function reservedEnvKeyMessage(key: string): string;
|
|
44
|
+
/** Whether `name` is a toolchain variable, so injecting a value under it would reconfigure the run. */
|
|
45
|
+
export declare function isToolchainEnvName(name: string): boolean;
|
|
46
|
+
/** The one operator-facing sentence every refusal of a toolchain injection name uses. */
|
|
47
|
+
export declare function toolchainEnvNameMessage(name: string): string;
|
|
48
|
+
/** Whether `name` is shaped like an environment variable at all. */
|
|
49
|
+
export declare function isEnvVariableName(name: string): boolean;
|
|
50
|
+
//# sourceMappingURL=reserved-env-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reserved-env-keys.d.ts","sourceRoot":"","sources":["../src/reserved-env-keys.ts"],"names":[],"mappings":"AA4DA;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,EAAE,SAAS,MAAM,EAqC3D,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAiBvD,CAAA;AAKD;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAK7D;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQzD;AAgDD,uGAAuG;AACvG,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKxD;AAED,yFAAyF;AACzF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM5D;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// What a registered capability's credential may be NAMED.
|
|
3
|
+
//
|
|
4
|
+
// A credential has two names and this module holds the rule for each. The LOOKUP name (`key`) is
|
|
5
|
+
// what a `ToolSecretResolver` is asked for, so it can reach the deployment's own environment; it
|
|
6
|
+
// may not name a variable the platform's own configuration owns, which is the first half below.
|
|
7
|
+
// The INJECTED name (`envName`, defaulting to the lookup name) is what the resolved value is set
|
|
8
|
+
// as in the agent's or the MCP server's process; it reads nothing, so it is held only to the
|
|
9
|
+
// narrower toolchain rule in the second half.
|
|
10
|
+
//
|
|
11
|
+
// First half: the environment variable names a DEPLOYMENT'S OWN CONFIGURATION owns, and which a
|
|
12
|
+
// registered capability's credential may therefore never be looked up by.
|
|
13
|
+
//
|
|
14
|
+
// The platform already holds one invariant about its environment: it never reaches an agent
|
|
15
|
+
// process. A container's environment is COMPOSED (the harness is handed exactly the job body's
|
|
16
|
+
// pairs), and the local NATIVE transport — where the harness is a child of the orchestrator and
|
|
17
|
+
// would otherwise inherit `process.env` wholesale — projects through the allow-list in
|
|
18
|
+
// `runtimes/local/src/childEnv.ts`, whose header names the assets at stake: `DATABASE_URL`,
|
|
19
|
+
// `ENCRYPTION_KEY`, `AUTH_SESSION_SECRET`, `GITHUB_PAT`, the provider API keys.
|
|
20
|
+
//
|
|
21
|
+
// The `ToolSecretResolver`'s env-backed default is the SECOND path between those two
|
|
22
|
+
// environments, and it was the one with no such statement. It reads whatever key a registration
|
|
23
|
+
// declares, and a registration names both the key it wants AND the endpoint that key is sent to
|
|
24
|
+
// — so `{ key: 'ENCRYPTION_KEY', usage: 'Authorization: Bearer <value>' }` was a valid tool
|
|
25
|
+
// server / generative integration that booted clean and shipped the deployment's master sealing
|
|
26
|
+
// key into a prompt-injectable agent process. In MOTHERSHIP mode that declaration is authored by
|
|
27
|
+
// the mothership and the environment read is a developer's own laptop, which is what turns a
|
|
28
|
+
// hygiene problem into a boundary one: `ENCRYPTION_KEY` and `HARNESS_SHARED_SECRET` are the keys
|
|
29
|
+
// to the split BETWEEN the two processes, held by the side that is meant to keep them.
|
|
30
|
+
//
|
|
31
|
+
// So: a capability credential may not name a variable the platform itself reads. Refused where
|
|
32
|
+
// the declaration is made (the generative-integration schema, and boot validation for a tool
|
|
33
|
+
// server) and again where a declared key becomes a lookup, because a mothership-mode node never
|
|
34
|
+
// boot-validates the definitions it resolves — they arrive per dispatch over
|
|
35
|
+
// `/internal/binary-generators`, so a check that only ran on the mothership is a check the node
|
|
36
|
+
// cannot rely on.
|
|
37
|
+
//
|
|
38
|
+
// WHY THIS SET IS THE PLATFORM'S WHOLE ENVIRONMENT, not just its secrets. Splitting "secret" from
|
|
39
|
+
// "not secret" needs a judgement per variable, and the judgement is wrong the moment a var gains
|
|
40
|
+
// a sensitive use — while over-reserving costs a deployment nothing, because nobody names an
|
|
41
|
+
// integration credential `PORT`. The provider keys are the case that looks like over-reach and is
|
|
42
|
+
// not: `OPENAI_API_KEY` is billable and exfiltratable, and an integration that wants to call
|
|
43
|
+
// OpenAI on the deployment's account should say so in its own variable rather than silently
|
|
44
|
+
// inherit the one the model router spends.
|
|
45
|
+
//
|
|
46
|
+
// WHY NOT A PREFIX MANDATE ON THE OTHER SIDE (`GEN_…` / `TOOL_…` for every credential, so the
|
|
47
|
+
// platform's names are excluded by construction). It reads as the sounder positive rule and it is
|
|
48
|
+
// not available here: a subject credential's `key` is not only what the resolver is asked for, it
|
|
49
|
+
// is the ENVIRONMENT VARIABLE NAME the agent reads the value from. Mandating a prefix renames the
|
|
50
|
+
// variable inside the agent's process, so an integration whose SDK auto-reads its vendor's
|
|
51
|
+
// documented name stops working, and every deployment renames its `.env` to buy it. The same
|
|
52
|
+
// positive rule applied to the side that ALREADY has a namespace — the platform's own vars, which
|
|
53
|
+
// really do cluster into families — costs nobody a rename and is what {@link
|
|
54
|
+
// PLATFORM_RESERVED_ENV_PREFIXES} is.
|
|
55
|
+
//
|
|
56
|
+
// This lives in `@cat-factory/contracts` because it is the only layer every enforcement point can
|
|
57
|
+
// see: the valibot credential schema here, kernel's capability types, the server's dispatch-time
|
|
58
|
+
// resolution, and orchestration's boot validation.
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
/**
|
|
61
|
+
* Name PREFIXES the platform's own configuration owns (compared case-insensitively).
|
|
62
|
+
*
|
|
63
|
+
* These carry the drift protection: a variable added inside one of these families is reserved the
|
|
64
|
+
* day it is read, with no edit here. `scripts/check-reserved-env-keys.mjs` fails CI when a
|
|
65
|
+
* variable documented in `docs/environment-variables.md` is covered by neither this list nor
|
|
66
|
+
* {@link PLATFORM_RESERVED_ENV_KEYS}, so the exact-name list below cannot silently fall behind
|
|
67
|
+
* either.
|
|
68
|
+
*/
|
|
69
|
+
export const PLATFORM_RESERVED_ENV_PREFIXES = [
|
|
70
|
+
'AGENT_',
|
|
71
|
+
'AUTH_',
|
|
72
|
+
'AWS_',
|
|
73
|
+
'BEDROCK_',
|
|
74
|
+
'BUDGET_',
|
|
75
|
+
'CI_',
|
|
76
|
+
'CLOUDFLARE_',
|
|
77
|
+
'CONSENSUS_',
|
|
78
|
+
'CONTAINER_',
|
|
79
|
+
'CORS_',
|
|
80
|
+
'DB_',
|
|
81
|
+
'DECISION_',
|
|
82
|
+
'EMAIL_SYSTEM_',
|
|
83
|
+
'ENVIRONMENTS_',
|
|
84
|
+
'EXECUTION_',
|
|
85
|
+
'GITHUB_',
|
|
86
|
+
'GITLAB_',
|
|
87
|
+
'GOOGLE_OAUTH_',
|
|
88
|
+
'INFRA_REACHABILITY_',
|
|
89
|
+
'INLINE_WEB_SEARCH_',
|
|
90
|
+
'JOB_',
|
|
91
|
+
'LANGFUSE_',
|
|
92
|
+
'LITELLM_',
|
|
93
|
+
'LLM_',
|
|
94
|
+
'LOCAL_',
|
|
95
|
+
'NOTIFICATION_WEBHOOK_',
|
|
96
|
+
'OBSERVABILITY_',
|
|
97
|
+
'OPENROUTER_',
|
|
98
|
+
'OTEL_',
|
|
99
|
+
'PLATFORM_ALERTS_',
|
|
100
|
+
'REDIS_',
|
|
101
|
+
'RUNNERS_',
|
|
102
|
+
'SLACK_',
|
|
103
|
+
'STALE_RUN_',
|
|
104
|
+
'TOKEN_USAGE_',
|
|
105
|
+
'WEB_SEARCH_',
|
|
106
|
+
];
|
|
107
|
+
/**
|
|
108
|
+
* The platform's own variables that no {@link PLATFORM_RESERVED_ENV_PREFIXES} family covers —
|
|
109
|
+
* every remaining name read by a facade's config loader, a sweeper, or a model provider.
|
|
110
|
+
*
|
|
111
|
+
* Upper-case by convention; the comparison in {@link isReservedPlatformEnvKey} is
|
|
112
|
+
* case-insensitive, which is load-bearing rather than tidy: `process.env` lookup is
|
|
113
|
+
* case-INSENSITIVE on Windows, so a declaration spelled `encryption_key` would otherwise resolve
|
|
114
|
+
* the real key on a developer's laptop while passing a case-sensitive check.
|
|
115
|
+
*/
|
|
116
|
+
export const PLATFORM_RESERVED_ENV_KEYS = [
|
|
117
|
+
'ANTHROPIC_API_KEY',
|
|
118
|
+
'APP_BASE_URL',
|
|
119
|
+
'DATABASE_URL',
|
|
120
|
+
'DEEPSEEK_API_KEY',
|
|
121
|
+
'ENCRYPTION_KEY',
|
|
122
|
+
'ENVIRONMENT',
|
|
123
|
+
'HARNESS_SHARED_SECRET',
|
|
124
|
+
'HOST',
|
|
125
|
+
'LOG_LEVEL',
|
|
126
|
+
'MOONSHOT_API_KEY',
|
|
127
|
+
'OPENAI_API_KEY',
|
|
128
|
+
'PORT',
|
|
129
|
+
'PUBLIC_URL',
|
|
130
|
+
'QWEN_API_KEY',
|
|
131
|
+
'REALTIME_NODE_ID',
|
|
132
|
+
'WORKER_PUBLIC_URL',
|
|
133
|
+
];
|
|
134
|
+
const RESERVED = new Set(PLATFORM_RESERVED_ENV_KEYS.map((key) => key.toUpperCase()));
|
|
135
|
+
const RESERVED_PREFIXES = PLATFORM_RESERVED_ENV_PREFIXES.map((prefix) => prefix.toUpperCase());
|
|
136
|
+
/**
|
|
137
|
+
* Whether `key` names a variable the platform's own configuration owns, so a tool server or a
|
|
138
|
+
* generative integration declaring it is refused rather than resolved.
|
|
139
|
+
*
|
|
140
|
+
* Binds the LOOKUP name only: the name a resolver is asked for, and therefore the name that could
|
|
141
|
+
* be read off the deployment's environment. It deliberately does NOT bind the name a resolved
|
|
142
|
+
* value is injected UNDER in the agent's process ({@link isToolchainEnvName} is that rule), and
|
|
143
|
+
* conflating the two is what makes a family like `GITHUB_` unusable for the third-party servers
|
|
144
|
+
* that legitimately own names inside it.
|
|
145
|
+
*
|
|
146
|
+
* Case-insensitive and whitespace-tolerant, because both are ways the same variable is reached:
|
|
147
|
+
* see {@link PLATFORM_RESERVED_ENV_KEYS} on Windows, and the schema trims before it validates.
|
|
148
|
+
*/
|
|
149
|
+
export function isReservedPlatformEnvKey(key) {
|
|
150
|
+
const upper = key.trim().toUpperCase();
|
|
151
|
+
if (!upper)
|
|
152
|
+
return false;
|
|
153
|
+
if (RESERVED.has(upper))
|
|
154
|
+
return true;
|
|
155
|
+
return RESERVED_PREFIXES.some((prefix) => upper.startsWith(prefix));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The one operator-facing sentence every refusal of a reserved key uses — the schema issue, the
|
|
159
|
+
* boot problem, and the dispatch-time log line alike.
|
|
160
|
+
*
|
|
161
|
+
* Shared so the three cannot describe the same fault three ways, and phrased as the REMEDY it is:
|
|
162
|
+
* an operator who reads "reserved" without being told to declare a variable of the integration's
|
|
163
|
+
* own tends to try `allowKeys` next, which cannot widen this floor.
|
|
164
|
+
*/
|
|
165
|
+
export function reservedEnvKeyMessage(key) {
|
|
166
|
+
return (`"${key}" is an environment variable the platform's own configuration owns, so it cannot be ` +
|
|
167
|
+
`the key a capability credential is looked up by: its value would be read off the deployment's ` +
|
|
168
|
+
`environment and injected into an agent process. Look the credential up under a name of the ` +
|
|
169
|
+
`integration's own (e.g. "ACME_IMAGE_API_KEY"); if the process reading it needs a specific ` +
|
|
170
|
+
`variable name, set "envName" to that name, which is not held to this list.`);
|
|
171
|
+
}
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
// The OTHER half of the rule: names a resolved value may not be INJECTED under.
|
|
174
|
+
//
|
|
175
|
+
// A credential has two names, and only the first is a boundary. The LOOKUP name is what a
|
|
176
|
+
// resolver is asked for, so it can reach the platform's own environment: that one is held to
|
|
177
|
+
// `isReservedPlatformEnvKey` above. The INJECTED name is what the value is set as in the agent's
|
|
178
|
+
// (or the MCP server's) process, and it reads nothing at all, so the reserved list must not bind
|
|
179
|
+
// it. It has its own, narrower rule: a name that RECONFIGURES the process instead of
|
|
180
|
+
// authenticating a call.
|
|
181
|
+
//
|
|
182
|
+
// Keeping them apart is what makes both rules affordable. An `http` tool server has always had the
|
|
183
|
+
// split (`key` is the lookup, `header` is where the value goes), and it is the stdio and
|
|
184
|
+
// generative-integration cases that conflated them: with one name, reserving the `GITHUB_` family
|
|
185
|
+
// also reserved `GITHUB_PERSONAL_ACCESS_TOKEN`, which the platform does not read and the GitHub
|
|
186
|
+
// MCP server requires. Renaming it is not open to a deployment either, since the server's own SDK
|
|
187
|
+
// reads its documented name, which is exactly the argument against mandating a `TOOL_` prefix on
|
|
188
|
+
// the lookup side.
|
|
189
|
+
// ---------------------------------------------------------------------------
|
|
190
|
+
/**
|
|
191
|
+
* Toolchain-critical names, which must never be injected into an agent's environment because
|
|
192
|
+
* doing so reconfigures the process rather than authenticating a call: the loader and search
|
|
193
|
+
* paths, the shell's own hooks, npm's and git's config families.
|
|
194
|
+
*
|
|
195
|
+
* The harness carries its own copy (`RESERVED_ENV_NAMES` in `job.ts`) and drops these
|
|
196
|
+
* defensively at parse, because the image builds from `src/` plus typescript and can depend on no
|
|
197
|
+
* workspace package. That copy stays a pinned-by-convention duplicate. This one is shared across
|
|
198
|
+
* the declaration surfaces INSIDE contracts (the stored credential, the tool-server registration,
|
|
199
|
+
* the generative-integration schema) rather than copied per surface, because refusing at the write
|
|
200
|
+
* boundary is what turns "silently never injected" into an error while the operator is typing.
|
|
201
|
+
*/
|
|
202
|
+
const TOOLCHAIN_ENV_NAMES = new Set([
|
|
203
|
+
'PATH',
|
|
204
|
+
'HOME',
|
|
205
|
+
'NODE_OPTIONS',
|
|
206
|
+
'NODE_PATH',
|
|
207
|
+
'NODE_EXTRA_CA_CERTS',
|
|
208
|
+
'LD_PRELOAD',
|
|
209
|
+
'LD_LIBRARY_PATH',
|
|
210
|
+
'BASH_ENV',
|
|
211
|
+
'ENV',
|
|
212
|
+
'SHELL',
|
|
213
|
+
'IFS',
|
|
214
|
+
]);
|
|
215
|
+
const TOOLCHAIN_ENV_PREFIXES = ['npm_config_', 'git_'];
|
|
216
|
+
/** Whether `name` is a toolchain variable, so injecting a value under it would reconfigure the run. */
|
|
217
|
+
export function isToolchainEnvName(name) {
|
|
218
|
+
const trimmed = name.trim();
|
|
219
|
+
if (TOOLCHAIN_ENV_NAMES.has(trimmed))
|
|
220
|
+
return true;
|
|
221
|
+
const lower = trimmed.toLowerCase();
|
|
222
|
+
return TOOLCHAIN_ENV_PREFIXES.some((prefix) => lower.startsWith(prefix));
|
|
223
|
+
}
|
|
224
|
+
/** The one operator-facing sentence every refusal of a toolchain injection name uses. */
|
|
225
|
+
export function toolchainEnvNameMessage(name) {
|
|
226
|
+
return (`"${name}" is a toolchain environment variable, so a credential injected under it would ` +
|
|
227
|
+
`reconfigure the agent's process instead of authenticating a call. Use the name the ` +
|
|
228
|
+
`integration's own client reads (e.g. "ACME_API_KEY").`);
|
|
229
|
+
}
|
|
230
|
+
/** Whether `name` is shaped like an environment variable at all. */
|
|
231
|
+
export function isEnvVariableName(name) {
|
|
232
|
+
return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=reserved-env-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reserved-env-keys.js","sourceRoot":"","sources":["../src/reserved-env-ke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|
2
|
+
export declare const getCapabilityCredentialsContract: {
|
|
3
|
+
readonly method: "get";
|
|
4
|
+
readonly pathResolver: () => string;
|
|
5
|
+
readonly responsesByStatusCode: {
|
|
6
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
7
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
8
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
9
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
10
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
11
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
12
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
13
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
14
|
+
}, undefined>, undefined>, undefined>;
|
|
15
|
+
}, undefined>;
|
|
16
|
+
}, undefined>;
|
|
17
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
18
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
19
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
20
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
21
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
22
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
23
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
24
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
25
|
+
}, undefined>, undefined>, undefined>;
|
|
26
|
+
}, undefined>;
|
|
27
|
+
}, undefined>;
|
|
28
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
29
|
+
readonly declared: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
30
|
+
readonly key: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TrimAction, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 128, undefined>, import("valibot").RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>]>;
|
|
31
|
+
readonly declaredBy: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
32
|
+
readonly subject: import("valibot").PicklistSchema<["tool-server", "binary-generator"], undefined>;
|
|
33
|
+
readonly id: import("valibot").StringSchema<undefined>;
|
|
34
|
+
readonly label: import("valibot").StringSchema<undefined>;
|
|
35
|
+
readonly usage: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
36
|
+
}, undefined>, undefined>;
|
|
37
|
+
readonly required: import("valibot").BooleanSchema<undefined>;
|
|
38
|
+
readonly stored: import("valibot").BooleanSchema<undefined>;
|
|
39
|
+
readonly updatedAt: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
40
|
+
}, undefined>, undefined>;
|
|
41
|
+
readonly orphaned: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
42
|
+
readonly key: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TrimAction, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 128, undefined>, import("valibot").RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>]>;
|
|
43
|
+
readonly updatedAt: import("valibot").NumberSchema<undefined>;
|
|
44
|
+
}, undefined>, undefined>;
|
|
45
|
+
readonly environmentFallback: import("valibot").BooleanSchema<undefined>;
|
|
46
|
+
readonly declarationsIncomplete: import("valibot").BooleanSchema<undefined>;
|
|
47
|
+
}, undefined>;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export declare const setCapabilityCredentialsContract: {
|
|
51
|
+
readonly method: "put";
|
|
52
|
+
readonly pathResolver: () => string;
|
|
53
|
+
readonly requestBodySchema: import("valibot").SchemaWithPipe<readonly [import("valibot").ObjectSchema<{
|
|
54
|
+
readonly entries: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
55
|
+
readonly key: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TrimAction, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 128, undefined>, import("valibot").RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>]>;
|
|
56
|
+
readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 8192, undefined>]>;
|
|
57
|
+
}, undefined>, undefined>;
|
|
58
|
+
}, undefined>, import("valibot").CheckAction<{
|
|
59
|
+
entries: {
|
|
60
|
+
key: string;
|
|
61
|
+
value: string;
|
|
62
|
+
}[];
|
|
63
|
+
}, "capability credential keys must be unique within a workspace">, import("valibot").CheckAction<{
|
|
64
|
+
entries: {
|
|
65
|
+
key: string;
|
|
66
|
+
value: string;
|
|
67
|
+
}[];
|
|
68
|
+
}, "at most 100 capability credentials per workspace">]>;
|
|
69
|
+
readonly responsesByStatusCode: {
|
|
70
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
71
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
72
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
73
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
74
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
75
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
76
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
77
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
78
|
+
}, undefined>, undefined>, undefined>;
|
|
79
|
+
}, undefined>;
|
|
80
|
+
}, undefined>;
|
|
81
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
82
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
83
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
84
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
85
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
86
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
87
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
88
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
89
|
+
}, undefined>, undefined>, undefined>;
|
|
90
|
+
}, undefined>;
|
|
91
|
+
}, undefined>;
|
|
92
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
93
|
+
readonly declared: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
94
|
+
readonly key: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TrimAction, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 128, undefined>, import("valibot").RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>]>;
|
|
95
|
+
readonly declaredBy: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
96
|
+
readonly subject: import("valibot").PicklistSchema<["tool-server", "binary-generator"], undefined>;
|
|
97
|
+
readonly id: import("valibot").StringSchema<undefined>;
|
|
98
|
+
readonly label: import("valibot").StringSchema<undefined>;
|
|
99
|
+
readonly usage: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
100
|
+
}, undefined>, undefined>;
|
|
101
|
+
readonly required: import("valibot").BooleanSchema<undefined>;
|
|
102
|
+
readonly stored: import("valibot").BooleanSchema<undefined>;
|
|
103
|
+
readonly updatedAt: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
104
|
+
}, undefined>, undefined>;
|
|
105
|
+
readonly orphaned: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
106
|
+
readonly key: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TrimAction, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 128, undefined>, import("valibot").RegexAction<string, "must be a valid environment variable name (letters, digits and underscores, not starting with a digit)">, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>, import("valibot").CheckAction<string, (issue: import("valibot").CheckIssue<string>) => string>]>;
|
|
107
|
+
readonly updatedAt: import("valibot").NumberSchema<undefined>;
|
|
108
|
+
}, undefined>, undefined>;
|
|
109
|
+
readonly environmentFallback: import("valibot").BooleanSchema<undefined>;
|
|
110
|
+
readonly declarationsIncomplete: import("valibot").BooleanSchema<undefined>;
|
|
111
|
+
}, undefined>;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export declare const deleteCapabilityCredentialContract: {
|
|
115
|
+
readonly method: "delete";
|
|
116
|
+
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
117
|
+
key: import("valibot").StringSchema<undefined>;
|
|
118
|
+
}, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
|
|
119
|
+
readonly pathResolver: ({ key }: {
|
|
120
|
+
key: string;
|
|
121
|
+
}) => string;
|
|
122
|
+
readonly responsesByStatusCode: {
|
|
123
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
124
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
125
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
126
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
127
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
128
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
129
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
130
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
131
|
+
}, undefined>, undefined>, undefined>;
|
|
132
|
+
}, undefined>;
|
|
133
|
+
}, undefined>;
|
|
134
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
135
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
136
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
137
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
138
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
139
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
140
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
141
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
142
|
+
}, undefined>, undefined>, undefined>;
|
|
143
|
+
}, undefined>;
|
|
144
|
+
}, undefined>;
|
|
145
|
+
readonly 204: typeof ContractNoBody;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=capability-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-credentials.d.ts","sourceRoot":"","sources":["../../src/routes/capability-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,yBAAyB,CAAA;AAkB3E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI3C,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK3C,CAAA;AAMF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK7C,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ContractNoBody, defineApiContract } from '@toad-contracts/valibot';
|
|
2
|
+
import { capabilityCredentialsViewSchema, upsertCapabilityCredentialsSchema, } from '../capability-credentials.js';
|
|
3
|
+
import { errorResponses, singleStringParam } from './_shared.js';
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
// Per-workspace CAPABILITY CREDENTIAL route contracts. Mounted under
|
|
6
|
+
// `/workspaces/:workspaceId`, so the paths here are relative to that prefix.
|
|
7
|
+
//
|
|
8
|
+
// Values are write-only (never read back); the view returns which credentials this deployment's
|
|
9
|
+
// registered capabilities DECLARE, which of them this workspace has stored, and which stored keys
|
|
10
|
+
// nothing declares any more. See CapabilityCredentialsController.
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
const keyParams = singleStringParam('key');
|
|
13
|
+
export const getCapabilityCredentialsContract = defineApiContract({
|
|
14
|
+
method: 'get',
|
|
15
|
+
pathResolver: () => '/capability-credentials',
|
|
16
|
+
responsesByStatusCode: { 200: capabilityCredentialsViewSchema, ...errorResponses },
|
|
17
|
+
});
|
|
18
|
+
export const setCapabilityCredentialsContract = defineApiContract({
|
|
19
|
+
method: 'put',
|
|
20
|
+
pathResolver: () => '/capability-credentials',
|
|
21
|
+
requestBodySchema: upsertCapabilityCredentialsSchema,
|
|
22
|
+
responsesByStatusCode: { 200: capabilityCredentialsViewSchema, ...errorResponses },
|
|
23
|
+
});
|
|
24
|
+
// A per-KEY delete beside the whole-set PUT, because the two are different operations for an
|
|
25
|
+
// operator: the PUT replaces the set (what a form submit does), while removing one orphaned
|
|
26
|
+
// credential must not require re-sending every other value — which the client cannot do, since
|
|
27
|
+
// it never received them.
|
|
28
|
+
export const deleteCapabilityCredentialContract = defineApiContract({
|
|
29
|
+
method: 'delete',
|
|
30
|
+
requestPathParamsSchema: keyParams,
|
|
31
|
+
pathResolver: ({ key }) => `/capability-credentials/${key}`,
|
|
32
|
+
responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=capability-credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-credentials.js","sourceRoot":"","sources":["../../src/routes/capability-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EACL,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhE,8EAA8E;AAC9E,qEAAqE;AACrE,6EAA6E;AAC7E,EAAE;AACF,gGAAgG;AAChG,kGAAkG;AAClG,kEAAkE;AAClE,8EAA8E;AAE9E,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA;AAE1C,MAAM,CAAC,MAAM,gCAAgC,GAAG,iBAAiB,CAAC;IAChE,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,yBAAyB;IAC7C,qBAAqB,EAAE,EAAE,GAAG,EAAE,+BAA+B,EAAE,GAAG,cAAc,EAAE;CACnF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAG,iBAAiB,CAAC;IAChE,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,yBAAyB;IAC7C,iBAAiB,EAAE,iCAAiC;IACpD,qBAAqB,EAAE,EAAE,GAAG,EAAE,+BAA+B,EAAE,GAAG,cAAc,EAAE;CACnF,CAAC,CAAA;AAEF,6FAA6F;AAC7F,4FAA4F;AAC5F,+FAA+F;AAC/F,0BAA0B;AAC1B,MAAM,CAAC,MAAM,kCAAkC,GAAG,iBAAiB,CAAC;IAClE,MAAM,EAAE,QAAQ;IAChB,uBAAuB,EAAE,SAAS;IAClC,YAAY,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,2BAA2B,GAAG,EAAE;IAC3D,qBAAqB,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;CAClE,CAAC,CAAA"}
|
package/dist/routes/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export * from './sandbox.js';
|
|
|
59
59
|
export * from './service-fragment-defaults.js';
|
|
60
60
|
export * from './services.js';
|
|
61
61
|
export * from './test-secrets.js';
|
|
62
|
+
export * from './capability-credentials.js';
|
|
62
63
|
export * from './validation-checks.js';
|
|
63
64
|
export * from './slack.js';
|
|
64
65
|
export * from './spec.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAA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3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA"}
|
package/dist/routes/index.js
CHANGED
|
@@ -62,6 +62,7 @@ export * from './sandbox.js';
|
|
|
62
62
|
export * from './service-fragment-defaults.js';
|
|
63
63
|
export * from './services.js';
|
|
64
64
|
export * from './test-secrets.js';
|
|
65
|
+
export * from './capability-credentials.js';
|
|
65
66
|
export * from './validation-checks.js';
|
|
66
67
|
export * from './slack.js';
|
|
67
68
|
export * from './spec.js';
|
package/dist/routes/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":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