@ouispec/agent-core 0.2.0 → 0.4.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.
|
@@ -12,5 +12,56 @@ export declare const DEFAULT_APPROVAL_TTL_MS: number;
|
|
|
12
12
|
/** The longest an action may declare an approval lasts. */
|
|
13
13
|
export declare const MAX_APPROVAL_TTL_MS: number;
|
|
14
14
|
export declare const APPROVAL_CHANNELS: readonly ApprovalChannel[];
|
|
15
|
+
/**
|
|
16
|
+
* How long the store remembers that an approval was asked for and never
|
|
17
|
+
* decided, after it has expired: long enough for a conversation picked up
|
|
18
|
+
* days later to be told its call expired, rather than that it still waits.
|
|
19
|
+
*/
|
|
20
|
+
export declare const EXPIRED_APPROVAL_MEMORY_MS: number;
|
|
21
|
+
/**
|
|
22
|
+
* How long a turn that claimed an expiry has to store it and confirm. A turn
|
|
23
|
+
* that dies in between confirms nothing, and cannot release anything either:
|
|
24
|
+
* its claim lapses on the store's clock and the next turn claims again, so the
|
|
25
|
+
* stored conversation does not say "waiting" for good.
|
|
26
|
+
*/
|
|
27
|
+
export declare const EXPIRY_CLAIM_LEASE_MS: number;
|
|
28
|
+
/**
|
|
29
|
+
* Where an approval stands when a later turn finds its call still stored as
|
|
30
|
+
* waiting, and asks to settle it (`POST /internal/approvals/:id/settle`):
|
|
31
|
+
*
|
|
32
|
+
* - `claimed`: it expired without having run — undecided, or approved and
|
|
33
|
+
* never used (`decided`) — and this caller holds the claim to store
|
|
34
|
+
* that, for `EXPIRY_CLAIM_LEASE_MS`. The caller stores the call's result as
|
|
35
|
+
* expired, then confirms; confirmed, the claim is permanent.
|
|
36
|
+
* - `already`: it expired without having run, and another turn holds the claim
|
|
37
|
+
* or has confirmed it. The caller tells the model so for its own turn, and stores
|
|
38
|
+
* nothing.
|
|
39
|
+
* - `open`: it is still pending, or approved and not yet used. The card is live.
|
|
40
|
+
* - `unknown`: the store cannot say it expired undecided — it was declined, or
|
|
41
|
+
* approved and used, it is another user's or another conversation's, it was
|
|
42
|
+
* asked for before the store kept this memory, or the memory has lapsed.
|
|
43
|
+
* Nothing is changed.
|
|
44
|
+
* - `confirmed`: the answer to a confirmation.
|
|
45
|
+
*
|
|
46
|
+
* Only the store's own clock decides that an approval has expired.
|
|
47
|
+
*/
|
|
48
|
+
export type ApprovalSettleOutcome = 'claimed' | 'already' | 'open' | 'unknown' | 'confirmed';
|
|
49
|
+
export interface ApprovalSettlement {
|
|
50
|
+
approvalId: string;
|
|
51
|
+
outcome: ApprovalSettleOutcome;
|
|
52
|
+
/** When it expired (epoch ms), for `claimed` and `already`. */
|
|
53
|
+
expiresAt?: number;
|
|
54
|
+
/**
|
|
55
|
+
* For `claimed` and `already`: the user had approved it, and it expired
|
|
56
|
+
* before it was used (the turn that would have run it never did). Absent
|
|
57
|
+
* when nobody decided it.
|
|
58
|
+
*/
|
|
59
|
+
decided?: 'approved';
|
|
60
|
+
}
|
|
61
|
+
/** Whose approval is asked about: the same ownership the other approval routes check. */
|
|
62
|
+
export interface ApprovalOwner {
|
|
63
|
+
userId: string;
|
|
64
|
+
conversationId: string;
|
|
65
|
+
}
|
|
15
66
|
export type { ActionRequestApproval, ApprovalChannel, ApprovalContinuation, ApprovalDecidePayload, ApprovalDecideResult, ApprovalDecision, ApprovalEffect, ApprovalGrant, ApprovalPreview, ApprovalPreviewArgument, ApprovalRedeemResult, ApprovalRefusal, ApprovalRefusalReason, ApprovalRequiredEvent, ApprovalStatus, ApprovalTokenClaims, ApprovedCall, PendingApprovalInput, } from '@ouispec/contract';
|
|
16
67
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/approvals/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAyB,eAAe,EAAiB,MAAM,mBAAmB,CAAC;AAE/F;;;;;GAKG;AAEH,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;A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BAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,GACrB,MAAM,mBAAmB,CAAC"}
|
package/dist/approvals/types.js
CHANGED
|
@@ -11,6 +11,19 @@ export const DEFAULT_APPROVAL_TTL_MS = 5 * 60_000;
|
|
|
11
11
|
/** The longest an action may declare an approval lasts. */
|
|
12
12
|
export const MAX_APPROVAL_TTL_MS = 30 * 60_000;
|
|
13
13
|
export const APPROVAL_CHANNELS = ['ui', 'voice', 'phone', 'sms', 'chat'];
|
|
14
|
+
/**
|
|
15
|
+
* How long the store remembers that an approval was asked for and never
|
|
16
|
+
* decided, after it has expired: long enough for a conversation picked up
|
|
17
|
+
* days later to be told its call expired, rather than that it still waits.
|
|
18
|
+
*/
|
|
19
|
+
export const EXPIRED_APPROVAL_MEMORY_MS = 30 * 24 * 60 * 60_000;
|
|
20
|
+
/**
|
|
21
|
+
* How long a turn that claimed an expiry has to store it and confirm. A turn
|
|
22
|
+
* that dies in between confirms nothing, and cannot release anything either:
|
|
23
|
+
* its claim lapses on the store's clock and the next turn claims again, so the
|
|
24
|
+
* stored conversation does not say "waiting" for good.
|
|
25
|
+
*/
|
|
26
|
+
export const EXPIRY_CLAIM_LEASE_MS = 2 * 60_000;
|
|
14
27
|
const requestIsOUIs = true;
|
|
15
28
|
const grantIsOUIs = true;
|
|
16
29
|
void requestIsOUIs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/approvals/types.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD,uFAAuF;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,GAAG,MAAM,CAAC;AAClD,2DAA2D;AAC3D,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,GAAG,MAAM,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAA+B,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/approvals/types.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD,uFAAuF;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,GAAG,MAAM,CAAC;AAClD,2DAA2D;AAC3D,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,GAAG,MAAM,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAA+B,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAErG;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAG,MAAM,CAAC;AAsEhD,MAAM,aAAa,GAAmD,IAAI,CAAC;AAC3E,MAAM,WAAW,GAA0C,IAAI,CAAC;AAChE,KAAK,aAAa,CAAC;AACnB,KAAK,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouispec/agent-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Schema types, entity graph, intent resolution, and protocol definitions for the agent SDK",
|
|
5
5
|
"homepage": "https://github.com/wesreid/oui/tree/main/packages/agent-core#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"ajv": "^8.17.0",
|
|
32
32
|
"yaml": "^2.7.0",
|
|
33
|
-
"@ouispec/agent-events": "^0.2.
|
|
33
|
+
"@ouispec/agent-events": "^0.2.2",
|
|
34
34
|
"@ouispec/contract": "^0.2.0",
|
|
35
|
-
"oui-spec": "^0.
|
|
35
|
+
"oui-spec": "^0.8.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^22.0.0",
|