@adea-ai/contracts 1.16.0 → 1.17.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/README.md +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model-funding.d.ts +181 -0
- package/dist/model-funding.d.ts.map +1 -0
- package/dist/model-funding.js +66 -0
- package/dist/model-funding.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,16 @@ import { EnvelopeSchemas, IdentifierSchemas, PaginationSchemas } from '@adea-ai/
|
|
|
34
34
|
See [`docs/contracts.md`](../../docs/contracts.md) in the repository for the
|
|
35
35
|
full contract reference, including the identifier prefix table.
|
|
36
36
|
|
|
37
|
+
## Model funding display
|
|
38
|
+
|
|
39
|
+
`ModelSelectionFunding{Request,Response,View}Schema` and `ModelFundingOwnerSchema`
|
|
40
|
+
export the additive `model-funding-display/v1` disclosure contract. The request
|
|
41
|
+
uses `model-selection.funding.get` and requires workspace/caller plus accepted
|
|
42
|
+
execution, attempt and immutable selection reference/revision. Ready responses
|
|
43
|
+
include explicit recorded payer metadata; blocked responses contain only the
|
|
44
|
+
binding and a bounded reason code. This is display data, never admission, a
|
|
45
|
+
credential or spending authority. Existing model connection DTOs remain unchanged.
|
|
46
|
+
|
|
37
47
|
## License
|
|
38
48
|
|
|
39
49
|
Apache-2.0
|
package/dist/index.d.ts
CHANGED
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,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AAEtC,eAAO,MAAM,WAAW,cAAc,CAAA;AAEtC,cAAc,wBAAwB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AAEtC,eAAO,MAAM,WAAW,cAAc,CAAA;AAEtC,cAAc,wBAAwB,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AAEtC,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAA;AAEtC,cAAc,wBAAwB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AAEtC,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAA;AAEtC,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Explicit authenticated payer metadata; account owner/connection administrator is not a payer inference. */
|
|
3
|
+
export declare const ModelFundingOwnerSchema: z.ZodObject<{
|
|
4
|
+
ownerRef: z.ZodString;
|
|
5
|
+
kind: z.ZodEnum<{
|
|
6
|
+
adea_account: "adea_account";
|
|
7
|
+
provider_account: "provider_account";
|
|
8
|
+
workspace_account: "workspace_account";
|
|
9
|
+
}>;
|
|
10
|
+
displayName: z.ZodString;
|
|
11
|
+
revision: z.ZodNumber;
|
|
12
|
+
evidenceRef: z.ZodString;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
/** Disclosure only. This response is never a credential, admission or spending capability. */
|
|
15
|
+
export declare const ModelSelectionFundingViewSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
16
|
+
schemaVersion: z.ZodLiteral<"model-funding-display/v1">;
|
|
17
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
|
|
18
|
+
executionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"execution ID">, string>>;
|
|
19
|
+
attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"attempt ID">, string>>;
|
|
20
|
+
selectionRef: z.ZodString;
|
|
21
|
+
selectionRevision: z.ZodNumber;
|
|
22
|
+
state: z.ZodLiteral<"ready">;
|
|
23
|
+
provider: z.ZodString;
|
|
24
|
+
providerModel: z.ZodString;
|
|
25
|
+
accountRef: z.ZodString;
|
|
26
|
+
authKind: z.ZodEnum<{
|
|
27
|
+
api_key: "api_key";
|
|
28
|
+
local_runtime: "local_runtime";
|
|
29
|
+
provider_subscription: "provider_subscription";
|
|
30
|
+
}>;
|
|
31
|
+
fundingSource: z.ZodEnum<{
|
|
32
|
+
byo_api: "byo_api";
|
|
33
|
+
external_subscription: "external_subscription";
|
|
34
|
+
hq_managed: "hq_managed";
|
|
35
|
+
}>;
|
|
36
|
+
fundingOwner: z.ZodObject<{
|
|
37
|
+
ownerRef: z.ZodString;
|
|
38
|
+
kind: z.ZodEnum<{
|
|
39
|
+
adea_account: "adea_account";
|
|
40
|
+
provider_account: "provider_account";
|
|
41
|
+
workspace_account: "workspace_account";
|
|
42
|
+
}>;
|
|
43
|
+
displayName: z.ZodString;
|
|
44
|
+
revision: z.ZodNumber;
|
|
45
|
+
evidenceRef: z.ZodString;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
authorizationRef: z.ZodString;
|
|
48
|
+
authorityRevision: z.ZodNumber;
|
|
49
|
+
expiresAt: z.ZodISODateTime;
|
|
50
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
51
|
+
schemaVersion: z.ZodLiteral<"model-funding-display/v1">;
|
|
52
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
|
|
53
|
+
executionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"execution ID">, string>>;
|
|
54
|
+
attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"attempt ID">, string>>;
|
|
55
|
+
selectionRef: z.ZodString;
|
|
56
|
+
selectionRevision: z.ZodNumber;
|
|
57
|
+
state: z.ZodLiteral<"blocked">;
|
|
58
|
+
reasonCode: z.ZodEnum<{
|
|
59
|
+
AUTH_MODE_UNSUPPORTED: "AUTH_MODE_UNSUPPORTED";
|
|
60
|
+
CONNECTION_MISSING: "CONNECTION_MISSING";
|
|
61
|
+
CONNECTION_REVOKED: "CONNECTION_REVOKED";
|
|
62
|
+
CREDENTIAL_EXPIRED: "CREDENTIAL_EXPIRED";
|
|
63
|
+
CREDENTIAL_MISSING: "CREDENTIAL_MISSING";
|
|
64
|
+
CREDENTIAL_REVISION_CHANGED: "CREDENTIAL_REVISION_CHANGED";
|
|
65
|
+
CREDENTIAL_REVOKED: "CREDENTIAL_REVOKED";
|
|
66
|
+
INCOMPATIBLE_HARNESS: "INCOMPATIBLE_HARNESS";
|
|
67
|
+
INCOMPATIBLE_LOCATION: "INCOMPATIBLE_LOCATION";
|
|
68
|
+
MODEL_UNAVAILABLE: "MODEL_UNAVAILABLE";
|
|
69
|
+
PROVIDER_POLICY_DENIED: "PROVIDER_POLICY_DENIED";
|
|
70
|
+
QUOTA_EXHAUSTED: "QUOTA_EXHAUSTED";
|
|
71
|
+
READINESS_UNAVAILABLE: "READINESS_UNAVAILABLE";
|
|
72
|
+
SELECTION_CHANGED: "SELECTION_CHANGED";
|
|
73
|
+
WORKSPACE_GRANT_EXPIRED: "WORKSPACE_GRANT_EXPIRED";
|
|
74
|
+
WORKSPACE_GRANT_REVOKED: "WORKSPACE_GRANT_REVOKED";
|
|
75
|
+
}>;
|
|
76
|
+
}, z.core.$strict>], "state">;
|
|
77
|
+
export declare const ModelSelectionFundingRequestSchema: z.ZodObject<{
|
|
78
|
+
contractVersion: z.ZodObject<{
|
|
79
|
+
major: z.ZodNumber;
|
|
80
|
+
minor: z.ZodNumber;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
|
|
83
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
|
|
84
|
+
correlation: z.ZodObject<{
|
|
85
|
+
traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
|
|
86
|
+
causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
|
|
87
|
+
parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
requestedAt: z.ZodISODateTime;
|
|
90
|
+
caller: z.ZodObject<{
|
|
91
|
+
servicePrincipalId: z.ZodString;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
operation: z.ZodLiteral<"model-selection.funding.get">;
|
|
94
|
+
parameters: z.ZodObject<{
|
|
95
|
+
executionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"execution ID">, string>>;
|
|
96
|
+
attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"attempt ID">, string>>;
|
|
97
|
+
selectionRef: z.ZodString;
|
|
98
|
+
selectionRevision: z.ZodNumber;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
export declare const ModelSelectionFundingResponseSchema: z.ZodObject<{
|
|
102
|
+
contractVersion: z.ZodObject<{
|
|
103
|
+
major: z.ZodNumber;
|
|
104
|
+
minor: z.ZodNumber;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
requestId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"request ID">, string>>;
|
|
107
|
+
correlation: z.ZodObject<{
|
|
108
|
+
traceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"trace ID">, string>>;
|
|
109
|
+
causationCommandId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"command ID">, string>>>;
|
|
110
|
+
parentEventId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"event ID">, string>>>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
data: z.ZodObject<{
|
|
113
|
+
funding: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
114
|
+
schemaVersion: z.ZodLiteral<"model-funding-display/v1">;
|
|
115
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
|
|
116
|
+
executionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"execution ID">, string>>;
|
|
117
|
+
attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"attempt ID">, string>>;
|
|
118
|
+
selectionRef: z.ZodString;
|
|
119
|
+
selectionRevision: z.ZodNumber;
|
|
120
|
+
state: z.ZodLiteral<"ready">;
|
|
121
|
+
provider: z.ZodString;
|
|
122
|
+
providerModel: z.ZodString;
|
|
123
|
+
accountRef: z.ZodString;
|
|
124
|
+
authKind: z.ZodEnum<{
|
|
125
|
+
api_key: "api_key";
|
|
126
|
+
local_runtime: "local_runtime";
|
|
127
|
+
provider_subscription: "provider_subscription";
|
|
128
|
+
}>;
|
|
129
|
+
fundingSource: z.ZodEnum<{
|
|
130
|
+
byo_api: "byo_api";
|
|
131
|
+
external_subscription: "external_subscription";
|
|
132
|
+
hq_managed: "hq_managed";
|
|
133
|
+
}>;
|
|
134
|
+
fundingOwner: z.ZodObject<{
|
|
135
|
+
ownerRef: z.ZodString;
|
|
136
|
+
kind: z.ZodEnum<{
|
|
137
|
+
adea_account: "adea_account";
|
|
138
|
+
provider_account: "provider_account";
|
|
139
|
+
workspace_account: "workspace_account";
|
|
140
|
+
}>;
|
|
141
|
+
displayName: z.ZodString;
|
|
142
|
+
revision: z.ZodNumber;
|
|
143
|
+
evidenceRef: z.ZodString;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
authorizationRef: z.ZodString;
|
|
146
|
+
authorityRevision: z.ZodNumber;
|
|
147
|
+
expiresAt: z.ZodISODateTime;
|
|
148
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
149
|
+
schemaVersion: z.ZodLiteral<"model-funding-display/v1">;
|
|
150
|
+
workspaceId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"workspace ID">, string>>;
|
|
151
|
+
executionId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"execution ID">, string>>;
|
|
152
|
+
attemptId: z.ZodPipe<z.ZodString, z.ZodTransform<import("./identifiers.js").OpaqueIdentifier<"attempt ID">, string>>;
|
|
153
|
+
selectionRef: z.ZodString;
|
|
154
|
+
selectionRevision: z.ZodNumber;
|
|
155
|
+
state: z.ZodLiteral<"blocked">;
|
|
156
|
+
reasonCode: z.ZodEnum<{
|
|
157
|
+
AUTH_MODE_UNSUPPORTED: "AUTH_MODE_UNSUPPORTED";
|
|
158
|
+
CONNECTION_MISSING: "CONNECTION_MISSING";
|
|
159
|
+
CONNECTION_REVOKED: "CONNECTION_REVOKED";
|
|
160
|
+
CREDENTIAL_EXPIRED: "CREDENTIAL_EXPIRED";
|
|
161
|
+
CREDENTIAL_MISSING: "CREDENTIAL_MISSING";
|
|
162
|
+
CREDENTIAL_REVISION_CHANGED: "CREDENTIAL_REVISION_CHANGED";
|
|
163
|
+
CREDENTIAL_REVOKED: "CREDENTIAL_REVOKED";
|
|
164
|
+
INCOMPATIBLE_HARNESS: "INCOMPATIBLE_HARNESS";
|
|
165
|
+
INCOMPATIBLE_LOCATION: "INCOMPATIBLE_LOCATION";
|
|
166
|
+
MODEL_UNAVAILABLE: "MODEL_UNAVAILABLE";
|
|
167
|
+
PROVIDER_POLICY_DENIED: "PROVIDER_POLICY_DENIED";
|
|
168
|
+
QUOTA_EXHAUSTED: "QUOTA_EXHAUSTED";
|
|
169
|
+
READINESS_UNAVAILABLE: "READINESS_UNAVAILABLE";
|
|
170
|
+
SELECTION_CHANGED: "SELECTION_CHANGED";
|
|
171
|
+
WORKSPACE_GRANT_EXPIRED: "WORKSPACE_GRANT_EXPIRED";
|
|
172
|
+
WORKSPACE_GRANT_REVOKED: "WORKSPACE_GRANT_REVOKED";
|
|
173
|
+
}>;
|
|
174
|
+
}, z.core.$strict>], "state">;
|
|
175
|
+
}, z.core.$strict>;
|
|
176
|
+
}, z.core.$strict>;
|
|
177
|
+
export type ModelFundingOwner = z.output<typeof ModelFundingOwnerSchema>;
|
|
178
|
+
export type ModelSelectionFundingView = z.output<typeof ModelSelectionFundingViewSchema>;
|
|
179
|
+
export type ModelSelectionFundingRequest = z.output<typeof ModelSelectionFundingRequestSchema>;
|
|
180
|
+
export type ModelSelectionFundingResponse = z.output<typeof ModelSelectionFundingResponseSchema>;
|
|
181
|
+
//# sourceMappingURL=model-funding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-funding.d.ts","sourceRoot":"","sources":["../src/model-funding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAiBvB,8GAA8G;AAC9G,eAAO,MAAM,uBAAuB;;;;;;;;;;kBAMlC,CAAA;AASF,8FAA8F;AAC9F,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAmB1C,CAAA;AACF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;kBAapC,CAAA;AACX,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAErC,CAAA;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA;AACxE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,+BAA+B,CAAC,CAAA;AACxF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAC9F,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mCAAmC,CAAC,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IdentifierSchemas } from './identifiers.js';
|
|
3
|
+
import { ReadRequestEnvelopeSchema, SuccessResponseEnvelopeSchema } from './envelopes.js';
|
|
4
|
+
import { ServiceCallerAssertionSchema } from './authentication.js';
|
|
5
|
+
import { ModelConnectionSchema, ModelFundingSourceSchema, ModelReadinessReasonSchema, ModelSelectionRefSchema, } from './model-connections.js';
|
|
6
|
+
const Ref = z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1)
|
|
9
|
+
.max(256)
|
|
10
|
+
.regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/);
|
|
11
|
+
const Revision = z.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
12
|
+
/** Explicit authenticated payer metadata; account owner/connection administrator is not a payer inference. */
|
|
13
|
+
export const ModelFundingOwnerSchema = z.strictObject({
|
|
14
|
+
ownerRef: Ref,
|
|
15
|
+
kind: z.enum(['provider_account', 'workspace_account', 'adea_account']),
|
|
16
|
+
displayName: z.string().min(1).max(128),
|
|
17
|
+
revision: Revision,
|
|
18
|
+
evidenceRef: Ref,
|
|
19
|
+
});
|
|
20
|
+
const Binding = {
|
|
21
|
+
schemaVersion: z.literal('model-funding-display/v1'),
|
|
22
|
+
workspaceId: IdentifierSchemas.workspaceId,
|
|
23
|
+
executionId: IdentifierSchemas.executionId,
|
|
24
|
+
attemptId: IdentifierSchemas.attemptId,
|
|
25
|
+
selectionRef: ModelSelectionRefSchema,
|
|
26
|
+
selectionRevision: Revision,
|
|
27
|
+
};
|
|
28
|
+
/** Disclosure only. This response is never a credential, admission or spending capability. */
|
|
29
|
+
export const ModelSelectionFundingViewSchema = z.discriminatedUnion('state', [
|
|
30
|
+
z.strictObject({
|
|
31
|
+
...Binding,
|
|
32
|
+
state: z.literal('ready'),
|
|
33
|
+
provider: ModelConnectionSchema.shape.provider,
|
|
34
|
+
providerModel: z.string().min(1).max(256),
|
|
35
|
+
accountRef: ModelConnectionSchema.shape.accountRef,
|
|
36
|
+
authKind: ModelConnectionSchema.shape.authKind,
|
|
37
|
+
fundingSource: ModelFundingSourceSchema,
|
|
38
|
+
fundingOwner: ModelFundingOwnerSchema,
|
|
39
|
+
authorizationRef: Ref,
|
|
40
|
+
authorityRevision: Revision,
|
|
41
|
+
expiresAt: z.iso.datetime(),
|
|
42
|
+
}),
|
|
43
|
+
z.strictObject({
|
|
44
|
+
...Binding,
|
|
45
|
+
state: z.literal('blocked'),
|
|
46
|
+
reasonCode: ModelReadinessReasonSchema.exclude(['READY']),
|
|
47
|
+
}),
|
|
48
|
+
]);
|
|
49
|
+
export const ModelSelectionFundingRequestSchema = ReadRequestEnvelopeSchema.omit({
|
|
50
|
+
projectId: true,
|
|
51
|
+
})
|
|
52
|
+
.extend({
|
|
53
|
+
caller: ServiceCallerAssertionSchema,
|
|
54
|
+
operation: z.literal('model-selection.funding.get'),
|
|
55
|
+
parameters: z.strictObject({
|
|
56
|
+
executionId: Binding.executionId,
|
|
57
|
+
attemptId: Binding.attemptId,
|
|
58
|
+
selectionRef: Binding.selectionRef,
|
|
59
|
+
selectionRevision: Binding.selectionRevision,
|
|
60
|
+
}),
|
|
61
|
+
})
|
|
62
|
+
.strict();
|
|
63
|
+
export const ModelSelectionFundingResponseSchema = SuccessResponseEnvelopeSchema.extend({
|
|
64
|
+
data: z.strictObject({ funding: ModelSelectionFundingViewSchema }),
|
|
65
|
+
}).strict();
|
|
66
|
+
//# sourceMappingURL=model-funding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-funding.js","sourceRoot":"","sources":["../src/model-funding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAE/B,MAAM,GAAG,GAAG,CAAC;KACV,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CAAC,gCAAgC,CAAC,CAAA;AAC1C,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACzE,8GAA8G;AAC9G,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC;IACpD,QAAQ,EAAE,GAAG;IACb,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,cAAc,CAAC,CAAC;IACvE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACvC,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,GAAG;CACjB,CAAC,CAAA;AACF,MAAM,OAAO,GAAG;IACd,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC;IACpD,WAAW,EAAE,iBAAiB,CAAC,WAAW;IAC1C,WAAW,EAAE,iBAAiB,CAAC,WAAW;IAC1C,SAAS,EAAE,iBAAiB,CAAC,SAAS;IACtC,YAAY,EAAE,uBAAuB;IACrC,iBAAiB,EAAE,QAAQ;CAC5B,CAAA;AACD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE;IAC3E,CAAC,CAAC,YAAY,CAAC;QACb,GAAG,OAAO;QACV,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QACzB,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,QAAQ;QAC9C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACzC,UAAU,EAAE,qBAAqB,CAAC,KAAK,CAAC,UAAU;QAClD,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,QAAQ;QAC9C,aAAa,EAAE,wBAAwB;QACvC,YAAY,EAAE,uBAAuB;QACrC,gBAAgB,EAAE,GAAG;QACrB,iBAAiB,EAAE,QAAQ;QAC3B,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;KAC5B,CAAC;IACF,CAAC,CAAC,YAAY,CAAC;QACb,GAAG,OAAO;QACV,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC3B,UAAU,EAAE,0BAA0B,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;KAC1D,CAAC;CACH,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,kCAAkC,GAAG,yBAAyB,CAAC,IAAI,CAAC;IAC/E,SAAS,EAAE,IAAI;CAChB,CAAC;KACC,MAAM,CAAC;IACN,MAAM,EAAE,4BAA4B;IACpC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,6BAA6B,CAAC;IACnD,UAAU,EAAE,CAAC,CAAC,YAAY,CAAC;QACzB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;KAC7C,CAAC;CACH,CAAC;KACD,MAAM,EAAE,CAAA;AACX,MAAM,CAAC,MAAM,mCAAmC,GAAG,6BAA6B,CAAC,MAAM,CAAC;IACtF,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC;CACnE,CAAC,CAAC,MAAM,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/contracts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Runtime-independent service boundary between Adea and the Control Plane: canonical identifiers, envelopes, Control API schemas, pagination, and versioning.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|