@hasna/skills 0.8.0 → 0.8.2

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.
@@ -0,0 +1,8 @@
1
+ /** Bounded canonical JSON for portable integrity checks, not an authority token.
2
+ * Object keys use JavaScript code-unit order. Values that JSON would silently
3
+ * drop or transform are refused, including accessors and sparse array slots. */
4
+ export declare function canonicalJson(value: unknown, maximumBytes?: number): string;
5
+ /** Internal parser bound: response wrappers consume depth independently of the
6
+ * immutable payload. The public canonical helpers retain their 64-level bound. */
7
+ export declare function canonicalJsonAtDepth(value: unknown, maximumBytes: number, maximumDepth: number): string;
8
+ export declare function canonicalJsonSha256(value: unknown, maximumBytes?: number): string;
@@ -1,4 +1,4 @@
1
- export type SkillsCliMcpParityDomain = "discovery" | "portable-skills" | "runtime" | "tool-primitives" | "validation";
1
+ export type SkillsCliMcpParityDomain = "recurring-consent" | "discovery" | "portable-skills" | "runtime" | "tool-primitives" | "validation";
2
2
  export interface SkillsCliMcpParityEntry {
3
3
  domain: SkillsCliMcpParityDomain;
4
4
  operation: string;
@@ -0,0 +1,40 @@
1
+ import type { ResolvedSkillSelection } from "../types/skill-selection.js";
2
+ export interface SelectedSecretBindings {
3
+ schema: "hasna.skills-secret-bindings.v1";
4
+ selection: Pick<ResolvedSkillSelection, "authority" | "workspaceId" | "profileRevision" | "slug" | "version" | "bundleDigest"> & {
5
+ profileId: string;
6
+ };
7
+ consumer: {
8
+ stationId: string;
9
+ workspaceDirectory: string;
10
+ };
11
+ /** Exact canonical /v1 authority of the independently configured Secrets client. */
12
+ secretsAuthority: string;
13
+ /** Declared environment name -> vault key. Values are resolved freshly for each run. */
14
+ bindings: Record<string, string>;
15
+ }
16
+ export interface SelectedSecretsClient {
17
+ readonly baseUrl: string;
18
+ getSecret(query: {
19
+ key: string;
20
+ }, init?: RequestInit): Promise<{
21
+ key: string;
22
+ value: string;
23
+ expires_at?: string | null;
24
+ }>;
25
+ }
26
+ export interface SelectedSecretScope {
27
+ selection: ResolvedSkillSelection;
28
+ profileId: string;
29
+ cwd: string;
30
+ }
31
+ export declare function selectedSecretBindingsTemplate(scope: SelectedSecretScope, names: string[], createClient?: () => SelectedSecretsClient): SelectedSecretBindings;
32
+ /** Runtime controls must not be supplied as credentials, even by a reviewed binding. */
33
+ export declare function declaredSecretNames(value: unknown): string[];
34
+ /** Reading is bounded and rejects symlinks/devices. Parsing errors never echo file contents. */
35
+ export declare function readSelectedSecretBindings(path: string): SelectedSecretBindings;
36
+ /** Validate every grant before constructing a client or reading any secret. */
37
+ export declare function validateSelectedSecretBindings(value: unknown, scope: SelectedSecretScope, names: string[]): SelectedSecretBindings;
38
+ export declare function resolveSelectedSecrets(bindings: SelectedSecretBindings, createClient?: () => SelectedSecretsClient): Promise<Record<string, string>>;
39
+ /** Limit accidental disclosure in child output. This is not a sandbox for hostile code. */
40
+ export declare function redactExecutionSecrets(text: string, env: Record<string, string>): string;
@@ -21,7 +21,7 @@ export interface JsonSchemaObject {
21
21
  oneOf?: JsonSchemaObject[];
22
22
  }
23
23
  export type McpToolCategory = "agent-session" | "discovery" | "execution" | "feedback" | "metadata" | "pinning" | "scaffolding" | "scheduling" | "storage" | "validation";
24
- export type McpToolSideEffect = "filesystem" | "local-process-or-remote-run" | "none" | "schedule-state";
24
+ export type McpToolSideEffect = "filesystem" | "remote-state" | "remote-state-and-filesystem" | "local-process-or-remote-run" | "none" | "schedule-state";
25
25
  export interface McpToolContract {
26
26
  name: string;
27
27
  title: string;
@@ -0,0 +1,29 @@
1
+ import { type RemoteWorkspaceContext } from "./remote-workspace-selection.js";
2
+ import { type RecurringAction, type RecurringInputs, type RecurringResults } from "./remote-recurring.js";
3
+ type Env = Record<string, string | undefined>;
4
+ export declare class RecurringCustomerError extends Error {
5
+ readonly code: string;
6
+ constructor(code: string, message: string);
7
+ }
8
+ export interface RecurringCustomer {
9
+ readonly apiOrigin: string;
10
+ readonly profile: string | null;
11
+ readonly context: RemoteWorkspaceContext | undefined;
12
+ /** Present only after actual fresh session and selected-workspace verification. */
13
+ readonly organizationId: string | undefined;
14
+ assertCurrent(): Promise<void>;
15
+ call<A extends RecurringAction>(action: A, input: RecurringInputs[A]): Promise<RecurringResults[A]>;
16
+ requestCode(email: string): Promise<void>;
17
+ fresh(email: string, code: string): Promise<RecurringCustomer>;
18
+ }
19
+ /** Capture before prompting. Fresh authority comes only from the existing OTP and
20
+ * workspace session verifier; a profile/context never grants that authority. */
21
+ export declare function prepareRecurringCustomer(requested?: RemoteWorkspaceContext, source?: Env): Promise<RecurringCustomer>;
22
+ /** Never echo authentication/transport bodies or caller-supplied credentials. */
23
+ export declare function recurringCustomerError(error: unknown): {
24
+ status?: number | undefined;
25
+ code: string;
26
+ error: string;
27
+ outcomeUnknown: boolean;
28
+ };
29
+ export {};
@@ -0,0 +1,82 @@
1
+ import { z } from "zod/v4";
2
+ import { type RecurringActivation, type RecurringPreview, type RecurringConsentView } from "./remote-recurring.js";
3
+ import { type RecurringCustomer } from "./recurring-customer.js";
4
+ declare const intentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5
+ contractVersion: z.ZodLiteral<1>;
6
+ apiOrigin: z.ZodString;
7
+ profile: z.ZodNullable<z.ZodString>;
8
+ organizationId: z.ZodString;
9
+ userId: z.ZodString;
10
+ membershipId: z.ZodString;
11
+ operation: z.ZodLiteral<"activate">;
12
+ draftId: z.ZodString;
13
+ termsSha256: z.ZodString;
14
+ approvalDeadline: z.ZodString;
15
+ approval: z.ZodObject<{
16
+ contractVersion: z.ZodLiteral<1>;
17
+ acceptedTermsSha256: z.ZodString;
18
+ acceptance: z.ZodLiteral<"authorize-recurring-credit-use">;
19
+ idempotencyKey: z.ZodString;
20
+ }, z.core.$strict>;
21
+ }, z.core.$strict>, z.ZodObject<{
22
+ contractVersion: z.ZodLiteral<1>;
23
+ apiOrigin: z.ZodString;
24
+ profile: z.ZodNullable<z.ZodString>;
25
+ organizationId: z.ZodString;
26
+ userId: z.ZodString;
27
+ membershipId: z.ZodString;
28
+ operation: z.ZodLiteral<"revoke">;
29
+ consentId: z.ZodString;
30
+ }, z.core.$strict>], "operation">;
31
+ type Intent = z.infer<typeof intentSchema>;
32
+ /** Refuse a substituted target before displaying saved terms or requesting OTP.
33
+ * The recovery executor repeats this fence while holding the original record. */
34
+ export declare function bindRecurringRecovery(customer: RecurringCustomer, intent: Intent): void;
35
+ export declare function prepareRecurringActivation(customer: RecurringCustomer, directory: string, draftId: string, approval: RecurringActivation): Promise<RecurringPreview>;
36
+ export declare function prepareRecurringRevocation(customer: RecurringCustomer, directory: string, consentId: string): Promise<RecurringConsentView>;
37
+ export declare function readRecurringRecovery(directory: string): {
38
+ intent: {
39
+ contractVersion: 1;
40
+ apiOrigin: string;
41
+ profile: string | null;
42
+ organizationId: string;
43
+ userId: string;
44
+ membershipId: string;
45
+ operation: "activate";
46
+ draftId: string;
47
+ termsSha256: string;
48
+ approvalDeadline: string;
49
+ approval: {
50
+ contractVersion: 1;
51
+ acceptedTermsSha256: string;
52
+ acceptance: "authorize-recurring-credit-use";
53
+ idempotencyKey: string;
54
+ };
55
+ } | {
56
+ contractVersion: 1;
57
+ apiOrigin: string;
58
+ profile: string | null;
59
+ organizationId: string;
60
+ userId: string;
61
+ membershipId: string;
62
+ operation: "revoke";
63
+ consentId: string;
64
+ };
65
+ phase: "pending" | "prepared" | "observed";
66
+ consentId: string | null;
67
+ };
68
+ export interface RecurringRecoveryOptions {
69
+ confirm: boolean;
70
+ email?: string;
71
+ code?: string;
72
+ }
73
+ /** One explicit action, never an internal POST retry. Pending remains uncertain
74
+ * even when later verification, local persistence or custody checks fail. */
75
+ export declare function continueRecurringRecovery(customer: RecurringCustomer, directory: string, options: RecurringRecoveryOptions): Promise<{
76
+ recoveryDirectory: string;
77
+ operation: "activate" | "revoke";
78
+ outcomeUnknown: boolean;
79
+ phase: "pending" | "prepared" | "observed";
80
+ result: unknown;
81
+ }>;
82
+ export {};
@@ -0,0 +1,252 @@
1
+ import { z } from "zod/v4";
2
+ import { type RecurringPreview } from "./remote-recurring.js";
3
+ export declare const recurringSurfaceSchemas: {
4
+ preview: z.ZodObject<{
5
+ request: z.ZodObject<{
6
+ contractVersion: z.ZodLiteral<1>;
7
+ skill: z.ZodString;
8
+ input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
9
+ args: z.ZodArray<z.ZodString>;
10
+ runtime: z.ZodObject<{
11
+ timeoutMs: z.ZodNumber;
12
+ maxOutputBytes: z.ZodNumber;
13
+ maxAttempts: z.ZodNumber;
14
+ connectorOperations: z.ZodArray<z.ZodObject<{
15
+ connectorSlug: z.ZodString;
16
+ operationName: z.ZodString;
17
+ }, z.core.$strict>>;
18
+ }, z.core.$strict>;
19
+ everyMinutes: z.ZodNumber;
20
+ startsAt: z.ZodString;
21
+ expiresAt: z.ZodString;
22
+ dispatchGraceSeconds: z.ZodNumber;
23
+ period: z.ZodLiteral<"utc-day">;
24
+ inFlightPolicy: z.ZodLiteral<"finish-authorized-attempt">;
25
+ maxCreditsPerRun: z.ZodNumber;
26
+ maxCreditsPerPeriod: z.ZodNumber;
27
+ maxCreditsTotal: z.ZodNumber;
28
+ maxOccurrencesPerPeriod: z.ZodNumber;
29
+ maxOccurrencesTotal: z.ZodNumber;
30
+ }, z.core.$strict>;
31
+ userId: z.ZodOptional<z.ZodString>;
32
+ membershipId: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strict>;
34
+ draft: z.ZodObject<{
35
+ draftId: z.ZodString;
36
+ userId: z.ZodOptional<z.ZodString>;
37
+ membershipId: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strict>;
39
+ activate: z.ZodObject<{
40
+ draftId: z.ZodString;
41
+ approval: z.ZodObject<{
42
+ contractVersion: z.ZodLiteral<1>;
43
+ acceptedTermsSha256: z.ZodString;
44
+ acceptance: z.ZodLiteral<"authorize-recurring-credit-use">;
45
+ idempotencyKey: z.ZodString;
46
+ }, z.core.$strict>;
47
+ recoveryDirectory: z.ZodString;
48
+ email: z.ZodString;
49
+ code: z.ZodOptional<z.ZodString>;
50
+ confirm: z.ZodOptional<z.ZodBoolean>;
51
+ userId: z.ZodOptional<z.ZodString>;
52
+ membershipId: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strict>;
54
+ list: z.ZodObject<{
55
+ limit: z.ZodOptional<z.ZodNumber>;
56
+ cursor: z.ZodOptional<z.ZodString>;
57
+ userId: z.ZodOptional<z.ZodString>;
58
+ membershipId: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strict>;
60
+ get: z.ZodObject<{
61
+ consentId: z.ZodString;
62
+ userId: z.ZodOptional<z.ZodString>;
63
+ membershipId: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$strict>;
65
+ occurrences: z.ZodObject<{
66
+ consentId: z.ZodString;
67
+ limit: z.ZodOptional<z.ZodNumber>;
68
+ cursor: z.ZodOptional<z.ZodString>;
69
+ userId: z.ZodOptional<z.ZodString>;
70
+ membershipId: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strict>;
72
+ revoke: z.ZodObject<{
73
+ consentId: z.ZodString;
74
+ recoveryDirectory: z.ZodString;
75
+ confirm: z.ZodLiteral<true>;
76
+ userId: z.ZodOptional<z.ZodString>;
77
+ membershipId: z.ZodOptional<z.ZodString>;
78
+ }, z.core.$strict>;
79
+ recover: z.ZodObject<{
80
+ recoveryDirectory: z.ZodString;
81
+ confirm: z.ZodOptional<z.ZodBoolean>;
82
+ email: z.ZodOptional<z.ZodString>;
83
+ code: z.ZodOptional<z.ZodString>;
84
+ userId: z.ZodOptional<z.ZodString>;
85
+ membershipId: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strict>;
87
+ verification: z.ZodObject<{
88
+ draftId: z.ZodString;
89
+ email: z.ZodString;
90
+ confirm: z.ZodLiteral<true>;
91
+ userId: z.ZodOptional<z.ZodString>;
92
+ membershipId: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$strict>;
94
+ };
95
+ export type RecurringSurfaceAction = keyof typeof recurringSurfaceSchemas;
96
+ export declare const recurringSurfaceOperations: readonly [{
97
+ readonly action: "preview";
98
+ readonly name: "preview_recurring_consent";
99
+ readonly title: "Preview recurring consent";
100
+ readonly cli: "preview";
101
+ readonly read: false;
102
+ readonly recovery: false;
103
+ }, {
104
+ readonly action: "draft";
105
+ readonly name: "get_recurring_draft";
106
+ readonly title: "Read original recurring draft";
107
+ readonly cli: "draft";
108
+ readonly read: true;
109
+ readonly recovery: false;
110
+ }, {
111
+ readonly action: "activate";
112
+ readonly name: "activate_recurring_consent";
113
+ readonly title: "Authorize recurring credit use";
114
+ readonly cli: "activate";
115
+ readonly read: false;
116
+ readonly recovery: true;
117
+ }, {
118
+ readonly action: "list";
119
+ readonly name: "list_recurring_consents";
120
+ readonly title: "List recurring consents";
121
+ readonly cli: "list";
122
+ readonly read: true;
123
+ readonly recovery: false;
124
+ }, {
125
+ readonly action: "get";
126
+ readonly name: "get_recurring_consent";
127
+ readonly title: "Inspect recurring consent and budgets";
128
+ readonly cli: "get";
129
+ readonly read: true;
130
+ readonly recovery: false;
131
+ }, {
132
+ readonly action: "occurrences";
133
+ readonly name: "list_recurring_occurrences";
134
+ readonly title: "Inspect recurring occurrence history";
135
+ readonly cli: "occurrences";
136
+ readonly read: true;
137
+ readonly recovery: false;
138
+ }, {
139
+ readonly action: "revoke";
140
+ readonly name: "revoke_recurring_consent";
141
+ readonly title: "Revoke recurring authority";
142
+ readonly cli: "revoke";
143
+ readonly read: false;
144
+ readonly recovery: true;
145
+ }, {
146
+ readonly action: "recover";
147
+ readonly name: "recover_recurring_consent";
148
+ readonly title: "Reconcile original recurring request";
149
+ readonly cli: "recover";
150
+ readonly read: false;
151
+ readonly recovery: true;
152
+ }, {
153
+ readonly action: "verification";
154
+ readonly name: "request_recurring_verification";
155
+ readonly title: "Request recurring approval verification";
156
+ readonly cli: "verification";
157
+ readonly read: false;
158
+ readonly recovery: false;
159
+ }];
160
+ /** The host must obtain explicit acceptance and a real human OTP. A boolean alone
161
+ * never grants recurring authority. Host request history may retain supplied OTPs. */
162
+ export declare function recurringMcpSchema(action: RecurringSurfaceAction): z.ZodObject<{
163
+ request: z.ZodObject<{
164
+ contractVersion: z.ZodLiteral<1>;
165
+ skill: z.ZodString;
166
+ input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
167
+ args: z.ZodArray<z.ZodString>;
168
+ runtime: z.ZodObject<{
169
+ timeoutMs: z.ZodNumber;
170
+ maxOutputBytes: z.ZodNumber;
171
+ maxAttempts: z.ZodNumber;
172
+ connectorOperations: z.ZodArray<z.ZodObject<{
173
+ connectorSlug: z.ZodString;
174
+ operationName: z.ZodString;
175
+ }, z.core.$strict>>;
176
+ }, z.core.$strict>;
177
+ everyMinutes: z.ZodNumber;
178
+ startsAt: z.ZodString;
179
+ expiresAt: z.ZodString;
180
+ dispatchGraceSeconds: z.ZodNumber;
181
+ period: z.ZodLiteral<"utc-day">;
182
+ inFlightPolicy: z.ZodLiteral<"finish-authorized-attempt">;
183
+ maxCreditsPerRun: z.ZodNumber;
184
+ maxCreditsPerPeriod: z.ZodNumber;
185
+ maxCreditsTotal: z.ZodNumber;
186
+ maxOccurrencesPerPeriod: z.ZodNumber;
187
+ maxOccurrencesTotal: z.ZodNumber;
188
+ }, z.core.$strict>;
189
+ userId: z.ZodOptional<z.ZodString>;
190
+ membershipId: z.ZodOptional<z.ZodString>;
191
+ }, z.core.$strict> | z.ZodObject<{
192
+ draftId: z.ZodString;
193
+ userId: z.ZodOptional<z.ZodString>;
194
+ membershipId: z.ZodOptional<z.ZodString>;
195
+ }, z.core.$strict> | z.ZodObject<{
196
+ limit: z.ZodOptional<z.ZodNumber>;
197
+ cursor: z.ZodOptional<z.ZodString>;
198
+ userId: z.ZodOptional<z.ZodString>;
199
+ membershipId: z.ZodOptional<z.ZodString>;
200
+ }, z.core.$strict> | z.ZodObject<{
201
+ consentId: z.ZodString;
202
+ userId: z.ZodOptional<z.ZodString>;
203
+ membershipId: z.ZodOptional<z.ZodString>;
204
+ }, z.core.$strict> | z.ZodObject<{
205
+ recoveryDirectory: z.ZodString;
206
+ confirm: z.ZodOptional<z.ZodBoolean>;
207
+ email: z.ZodOptional<z.ZodString>;
208
+ code: z.ZodOptional<z.ZodString>;
209
+ userId: z.ZodOptional<z.ZodString>;
210
+ membershipId: z.ZodOptional<z.ZodString>;
211
+ }, z.core.$strict>;
212
+ export interface RecurringInteraction {
213
+ accept(draft: RecurringPreview): Promise<boolean>;
214
+ verification(email: string, requestCode: () => Promise<void>): Promise<string | null>;
215
+ }
216
+ /** Shared CLI/MCP orchestration only. The SDK owns wire validation/transport; the
217
+ * selected server owns grants, freshness, prices, financial state and execution. */
218
+ export declare function executeRecurringSurface(action: RecurringSurfaceAction, raw: unknown, env?: Record<string, string | undefined>, interaction?: RecurringInteraction): Promise<RecurringPreview | import("./remote-recurring-contract.js").RecurringConsentView | import("./remote-recurring-contract.js").RecurringPage<import("./remote-recurring-contract.js").RecurringConsentView> | import("./remote-recurring-contract.js").RecurringPage<import("./remote-recurring-contract.js").RecurringOccurrenceView> | {
219
+ recoveryDirectory: string;
220
+ operation: "activate" | "revoke";
221
+ outcomeUnknown: boolean;
222
+ phase: "pending" | "prepared" | "observed";
223
+ result: unknown;
224
+ } | {
225
+ cancelled: boolean;
226
+ activated: boolean;
227
+ } | {
228
+ verificationRequested: boolean;
229
+ deliveryConfirmed: boolean;
230
+ draftId: string;
231
+ activated: boolean;
232
+ cancelled?: undefined;
233
+ outcomeUnknown?: undefined;
234
+ recoveryDirectory?: undefined;
235
+ } | {
236
+ recoveryDirectory: string;
237
+ phase: string;
238
+ outcomeUnknown: boolean;
239
+ cancelled: boolean;
240
+ activated: boolean;
241
+ verificationRequested?: undefined;
242
+ deliveryConfirmed?: undefined;
243
+ draftId?: undefined;
244
+ } | {
245
+ cancelled: boolean;
246
+ outcomeUnknown: boolean;
247
+ recoveryDirectory: string;
248
+ verificationRequested?: undefined;
249
+ deliveryConfirmed?: undefined;
250
+ draftId?: undefined;
251
+ activated?: undefined;
252
+ } | null>;
@@ -1,3 +1,4 @@
1
+ import { type RecurringRequest, type RecurringActivation, type RecurringListOptions, type RecurringCapability, type RecurringConsentView, type RecurringOccurrenceView, type RecurringPage } from "./remote-recurring.js";
1
2
  import { type ListRemoteWorkspaceInvitations, type IssueRemoteWorkspaceInvitation, type ResendRemoteWorkspaceInvitation, type RevokeRemoteWorkspaceInvitation, type AcceptRemoteWorkspaceInvitation } from "./remote-invitations.js";
2
3
  import { type LeaveRemoteWorkspace, type RemoteWorkspaceLeaveResult } from "./remote-workspace-leave.js";
3
4
  import { type RemoteWorkspaceContext, type RemoteAccountWorkspaces, type RemoteWorkspaceSession, type RemoteWorkspaceSelectionErrorCode } from "./remote-workspace-selection.js";
@@ -130,6 +131,7 @@ export declare class RemoteSkillsClient {
130
131
  boundedRunApproval?: boolean;
131
132
  unit?: string;
132
133
  };
134
+ recurringConsents?: RecurringCapability;
133
135
  }>;
134
136
  /** Quote first and fail closed when the caller has not approved the required credits. */
135
137
  submitQuotedRun(slug: string, input?: Record<string, unknown>, args?: string[], approval?: RemoteRunApproval): Promise<RemoteSkillRunContract>;
@@ -167,6 +169,17 @@ export declare class RemoteSkillsClient {
167
169
  /** One bounded operation, bound to the observed current incarnation. No retries,
168
170
  * key/session persistence or post-acceptance selection of another workspace. */
169
171
  private requestWorkspaceInvitation;
172
+ previewRecurringConsent(request: RecurringRequest, context?: RemoteWorkspaceContext): Promise<import("./remote-recurring-contract.js").RecurringPreview>;
173
+ getRecurringDraft(draftId: string, context?: RemoteWorkspaceContext): Promise<import("./remote-recurring-contract.js").RecurringPreview | null>;
174
+ activateRecurringConsent(draftId: string, approval: RecurringActivation, context?: RemoteWorkspaceContext): Promise<import("./remote-recurring-contract.js").RecurringActivationResult>;
175
+ listRecurringConsents(options?: RecurringListOptions, context?: RemoteWorkspaceContext): Promise<RecurringPage<RecurringConsentView>>;
176
+ getRecurringConsent(consentId: string, context?: RemoteWorkspaceContext): Promise<RecurringConsentView | null>;
177
+ listRecurringOccurrences(consentId: string, options?: RecurringListOptions, context?: RemoteWorkspaceContext): Promise<RecurringPage<RecurringOccurrenceView>>;
178
+ revokeRecurringConsent(consentId: string, context?: RemoteWorkspaceContext): Promise<import("./remote-recurring-contract.js").RecurringRevocation>;
179
+ /** One explicit operation on a captured connection. No policy inference,
180
+ * credential persistence, POST retries or replacement idempotency keys. */
181
+ private requestRecurring;
182
+ private dispatchRecurring;
170
183
  listApiKeys(): Promise<Record<string, unknown>[]>;
171
184
  createApiKey(name: string, scopes?: string[]): Promise<{
172
185
  key: string;
@@ -19,6 +19,7 @@ export declare const REMOTE_CUSTOMER_OPERATIONS: readonly [{
19
19
  boundedRunApproval?: boolean;
20
20
  unit?: string;
21
21
  };
22
+ recurringConsents?: import("./remote-recurring.js").RecurringCapability;
22
23
  }>;
23
24
  }, {
24
25
  readonly name: "list_remote_skills";
@@ -84,7 +84,7 @@ export declare class RemoteWorkspaceInvitationReadError extends Error {
84
84
  readonly code = "INVITATION_READ_FAILED";
85
85
  constructor();
86
86
  }
87
- export declare function invitationFailure(value: unknown, status: number): "INVALID_REQUEST" | "ACCOUNT_UNAVAILABLE" | "INTERACTIVE_SESSION_REQUIRED" | "WORKSPACE_ADMIN_REQUIRED" | "INVITATION_FORBIDDEN" | "INVITATION_UNAVAILABLE" | "INVITATION_CHANGED" | "INVITATION_EXISTS" | "ALREADY_MEMBER" | "IDEMPOTENCY_CONFLICT" | "INVITATION_LIMIT" | "INVITATION_BUSY" | "INVITATION_DELIVERY_UNAVAILABLE" | null;
87
+ export declare function invitationFailure(value: unknown, status: number): "ACCOUNT_UNAVAILABLE" | "INTERACTIVE_SESSION_REQUIRED" | "INVALID_REQUEST" | "WORKSPACE_ADMIN_REQUIRED" | "INVITATION_FORBIDDEN" | "INVITATION_UNAVAILABLE" | "INVITATION_CHANGED" | "INVITATION_EXISTS" | "ALREADY_MEMBER" | "IDEMPOTENCY_CONFLICT" | "INVITATION_LIMIT" | "INVITATION_BUSY" | "INVITATION_DELIVERY_UNAVAILABLE" | null;
88
88
  export type InvitationAction = "list" | "get" | "issue" | "resend" | "revoke" | "accept";
89
89
  export type InvitationInputs = {
90
90
  list: ListRemoteWorkspaceInvitations;
@@ -0,0 +1,165 @@
1
+ import { z } from "zod/v4";
2
+ /** Portable versioned wire values only. Eligibility, repricing, freshness, budgets
3
+ * and execution authority are verified by the configured server. */
4
+ export declare const RECURRING_CONTRACT_VERSION: 1;
5
+ export declare const MAX_RECURRING_CREDITS = 2147483647;
6
+ export declare const recurringRequestSchema: z.ZodObject<{
7
+ contractVersion: z.ZodLiteral<1>;
8
+ skill: z.ZodString;
9
+ input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
10
+ args: z.ZodArray<z.ZodString>;
11
+ runtime: z.ZodObject<{
12
+ timeoutMs: z.ZodNumber;
13
+ maxOutputBytes: z.ZodNumber;
14
+ maxAttempts: z.ZodNumber;
15
+ connectorOperations: z.ZodArray<z.ZodObject<{
16
+ connectorSlug: z.ZodString;
17
+ operationName: z.ZodString;
18
+ }, z.core.$strict>>;
19
+ }, z.core.$strict>;
20
+ everyMinutes: z.ZodNumber;
21
+ startsAt: z.ZodString;
22
+ expiresAt: z.ZodString;
23
+ dispatchGraceSeconds: z.ZodNumber;
24
+ period: z.ZodLiteral<"utc-day">;
25
+ inFlightPolicy: z.ZodLiteral<"finish-authorized-attempt">;
26
+ maxCreditsPerRun: z.ZodNumber;
27
+ maxCreditsPerPeriod: z.ZodNumber;
28
+ maxCreditsTotal: z.ZodNumber;
29
+ maxOccurrencesPerPeriod: z.ZodNumber;
30
+ maxOccurrencesTotal: z.ZodNumber;
31
+ }, z.core.$strict>;
32
+ export type RecurringRequest = z.infer<typeof recurringRequestSchema>;
33
+ export interface RecurringTerms extends RecurringRequest {
34
+ deploymentId: string;
35
+ organizationId: string;
36
+ approvedByUserId: string;
37
+ approvedMembershipId: string;
38
+ policyId: string;
39
+ policyRevision: number;
40
+ skillId: string;
41
+ skillVersionId: string;
42
+ runtimeApprovalDigest: string;
43
+ payloadSha256: string;
44
+ }
45
+ export declare const recurringTermsSchema: z.ZodObject<{
46
+ contractVersion: z.ZodLiteral<1>;
47
+ skill: z.ZodString;
48
+ input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
49
+ args: z.ZodArray<z.ZodString>;
50
+ runtime: z.ZodObject<{
51
+ timeoutMs: z.ZodNumber;
52
+ maxOutputBytes: z.ZodNumber;
53
+ maxAttempts: z.ZodNumber;
54
+ connectorOperations: z.ZodArray<z.ZodObject<{
55
+ connectorSlug: z.ZodString;
56
+ operationName: z.ZodString;
57
+ }, z.core.$strict>>;
58
+ }, z.core.$strict>;
59
+ everyMinutes: z.ZodNumber;
60
+ startsAt: z.ZodString;
61
+ expiresAt: z.ZodString;
62
+ dispatchGraceSeconds: z.ZodNumber;
63
+ period: z.ZodLiteral<"utc-day">;
64
+ inFlightPolicy: z.ZodLiteral<"finish-authorized-attempt">;
65
+ maxCreditsPerRun: z.ZodNumber;
66
+ maxCreditsPerPeriod: z.ZodNumber;
67
+ maxCreditsTotal: z.ZodNumber;
68
+ maxOccurrencesPerPeriod: z.ZodNumber;
69
+ maxOccurrencesTotal: z.ZodNumber;
70
+ deploymentId: z.ZodString;
71
+ organizationId: z.ZodUUID;
72
+ approvedByUserId: z.ZodUUID;
73
+ approvedMembershipId: z.ZodUUID;
74
+ policyId: z.ZodUUID;
75
+ policyRevision: z.ZodNumber;
76
+ skillId: z.ZodUUID;
77
+ skillVersionId: z.ZodUUID;
78
+ runtimeApprovalDigest: z.ZodString;
79
+ payloadSha256: z.ZodString;
80
+ }, z.core.$strict>;
81
+ export interface RecurringQuote {
82
+ costCredits: number;
83
+ quotedAt: string;
84
+ /** Quote is informational: admission always reprices under authority locks. */
85
+ admissionReprices: true;
86
+ }
87
+ export interface RecurringPreview {
88
+ contractVersion: typeof RECURRING_CONTRACT_VERSION;
89
+ draftId: string;
90
+ terms: RecurringTerms;
91
+ termsSha256: string;
92
+ quote: RecurringQuote;
93
+ approvalDeadline: string;
94
+ firstDueInstants: string[];
95
+ firstPeriod: {
96
+ startsAt: string;
97
+ endsAt: string;
98
+ };
99
+ additionalBudget: true;
100
+ }
101
+ export declare const recurringActivationSchema: z.ZodObject<{
102
+ contractVersion: z.ZodLiteral<1>;
103
+ acceptedTermsSha256: z.ZodString;
104
+ acceptance: z.ZodLiteral<"authorize-recurring-credit-use">;
105
+ idempotencyKey: z.ZodString;
106
+ }, z.core.$strict>;
107
+ export type RecurringActivation = z.infer<typeof recurringActivationSchema>;
108
+ export interface RecurringBudget {
109
+ reservedCredits: number;
110
+ settledCredits: number;
111
+ admittedOccurrences: number;
112
+ }
113
+ export interface RecurringConsentView {
114
+ contractVersion: typeof RECURRING_CONTRACT_VERSION;
115
+ consentId: string;
116
+ scheduleId: string;
117
+ terms: RecurringTerms;
118
+ termsSha256: string;
119
+ state: "active" | "revoked" | "expired";
120
+ activatedAt: string;
121
+ revokedAt: string | null;
122
+ total: RecurringBudget;
123
+ currentPeriod: (RecurringBudget & {
124
+ startsAt: string;
125
+ endsAt: string;
126
+ }) | null;
127
+ nextDueAt: string | null;
128
+ }
129
+ export interface RecurringActivationResult {
130
+ replayed: boolean;
131
+ consent: RecurringConsentView;
132
+ }
133
+ export interface RecurringPage<T> {
134
+ contractVersion: typeof RECURRING_CONTRACT_VERSION;
135
+ items: T[];
136
+ nextCursor: string | null;
137
+ }
138
+ export type RecurringRefusal = "consent-inactive" | "authority-revoked" | "policy-disabled" | "policy-changed" | "skill-changed" | "quote-unavailable" | "per-run-ceiling" | "period-ceiling" | "total-ceiling" | "period-count" | "total-count" | "insufficient-credits" | "input-quota" | "runtime-unavailable";
139
+ export interface RecurringOccurrenceView {
140
+ occurrenceId: string;
141
+ scheduleId: string;
142
+ dueAt: string;
143
+ periodStartsAt: string;
144
+ periodEndsAt: string;
145
+ outcome: "admitted" | "skipped" | "refused";
146
+ reason: RecurringRefusal | "dispatch-grace-elapsed" | null;
147
+ runId: string | null;
148
+ quotedCredits: number | null;
149
+ allocationState: "reserved" | "captured" | "released" | null;
150
+ }
151
+ export interface RecurringRevocation {
152
+ contractVersion: typeof RECURRING_CONTRACT_VERSION;
153
+ consentId: string;
154
+ revokedAt: string;
155
+ /** Bounded snapshot; separate paginated occurrences contains every run. */
156
+ authorizedRuns: {
157
+ runId: string;
158
+ attempt: number;
159
+ reservedCredits: number;
160
+ }[];
161
+ authorizedRunCount: number;
162
+ residualReservedCredits: number;
163
+ inFlightPolicy: "finish-authorized-attempt";
164
+ cancellationIsSeparate: true;
165
+ }