@deliverd/sdk 0.40.0 → 0.41.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/gates.d.ts +18 -1
- package/dist/gates.d.ts.map +1 -1
- package/dist/gates.js +29 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -3
- package/dist/released.d.ts +1 -1
- package/dist/released.d.ts.map +1 -1
- package/dist/released.js +1564 -0
- package/dist/types.d.ts +24 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/gates.ts +38 -0
- package/src/index.ts +17 -3
- package/src/released.ts +1564 -0
- package/src/types.ts +25 -0
package/src/types.ts
CHANGED
|
@@ -188,6 +188,18 @@ export interface CreateGateInput {
|
|
|
188
188
|
callbackUrl?: string;
|
|
189
189
|
/** Anything else a person deciding should see. Read by no rule. */
|
|
190
190
|
metadata?: Record<string, unknown>;
|
|
191
|
+
/**
|
|
192
|
+
* The model doing the work, `claude-sonnet-4-5` or `openai/gpt-5`. Optional.
|
|
193
|
+
* When it is not the model on the agent's register record, the record says
|
|
194
|
+
* so: a model change nobody recorded.
|
|
195
|
+
*/
|
|
196
|
+
model?: string;
|
|
197
|
+
/**
|
|
198
|
+
* The W3C `traceparent` of the span this runs in. Optional. Where the
|
|
199
|
+
* organisation sends decisions to its own OpenTelemetry collector, the
|
|
200
|
+
* decision's span joins this trace.
|
|
201
|
+
*/
|
|
202
|
+
traceparent?: string;
|
|
191
203
|
}
|
|
192
204
|
|
|
193
205
|
export interface GateData {
|
|
@@ -273,8 +285,21 @@ export interface GateDecision {
|
|
|
273
285
|
/** The signed yes, for the code that performs the action to verify. Null unless it may be acted on now. */
|
|
274
286
|
decisionToken: string | null;
|
|
275
287
|
gate: unknown;
|
|
288
|
+
/**
|
|
289
|
+
* True when Deliverd could not be reached and `onUnavailable` answered
|
|
290
|
+
* instead of a rule or a person. Then `id` is empty and nothing was recorded.
|
|
291
|
+
*/
|
|
292
|
+
unavailable?: boolean;
|
|
276
293
|
}
|
|
277
294
|
|
|
295
|
+
/**
|
|
296
|
+
* What `gate()` does when Deliverd cannot be reached (a network failure or a
|
|
297
|
+
* 5xx), per call: `throw` (the default) raises the error, `deny` returns a
|
|
298
|
+
* refusal, `allow` returns a yes without a token. Never applied to a 4xx: an
|
|
299
|
+
* unknown action or a bad input is a bug to fix, not an outage to ride out.
|
|
300
|
+
*/
|
|
301
|
+
export type GateOnUnavailable = "throw" | "deny" | "allow";
|
|
302
|
+
|
|
278
303
|
/** One field an approver corrected before approving. */
|
|
279
304
|
export interface FieldChange {
|
|
280
305
|
field: string;
|