@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.
- package/README.md +155 -1
- package/bin/index.js +6201 -3429
- package/bin/mcp.js +8189 -5616
- package/bin/migrate.js +1 -1
- package/bin/server.js +1 -1
- package/bin/worker.js +1 -1
- package/dist/cli/commands/recurring.d.ts +2 -0
- package/dist/index.js +3853 -3288
- package/dist/lib/canonical-json.d.ts +8 -0
- package/dist/lib/cli-mcp-parity.d.ts +1 -1
- package/dist/lib/execution-secrets.d.ts +40 -0
- package/dist/lib/mcp-contracts.d.ts +1 -1
- package/dist/lib/recurring-customer.d.ts +29 -0
- package/dist/lib/recurring-recovery.d.ts +82 -0
- package/dist/lib/recurring-surface.d.ts +252 -0
- package/dist/lib/remote-client.d.ts +13 -0
- package/dist/lib/remote-customer-operations.d.ts +1 -0
- package/dist/lib/remote-invitations.d.ts +1 -1
- package/dist/lib/remote-recurring-contract.d.ts +165 -0
- package/dist/lib/remote-recurring.d.ts +95 -0
- package/dist/lib/selected-run.d.ts +19 -0
- package/dist/mcp/remote-recurring-tools.d.ts +2 -0
- package/dist/sdk/index.d.ts +6 -0
- package/dist/sdk/index.js +121512 -88656
- package/package.json +1 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type RecurringRequest, type RecurringActivation, type RecurringPreview, type RecurringConsentView, type RecurringActivationResult, type RecurringPage, type RecurringOccurrenceView, type RecurringRevocation } from "./remote-recurring-contract.js";
|
|
2
|
+
import type { RemoteWorkspaceIdentity } from "./remote-workspace-selection.js";
|
|
3
|
+
export * from "./remote-recurring-contract.js";
|
|
4
|
+
export interface RecurringCapability {
|
|
5
|
+
contractVersion: 1;
|
|
6
|
+
available: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type RecurringListOptions = Readonly<{
|
|
9
|
+
limit?: number;
|
|
10
|
+
cursor?: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type RecurringAction = "preview" | "draft" | "activate" | "list" | "get" | "occurrences" | "revoke";
|
|
13
|
+
export type RecurringInputs = {
|
|
14
|
+
preview: RecurringRequest;
|
|
15
|
+
draft: {
|
|
16
|
+
draftId: string;
|
|
17
|
+
};
|
|
18
|
+
activate: {
|
|
19
|
+
draftId: string;
|
|
20
|
+
approval: RecurringActivation;
|
|
21
|
+
};
|
|
22
|
+
list: RecurringListOptions;
|
|
23
|
+
get: {
|
|
24
|
+
consentId: string;
|
|
25
|
+
};
|
|
26
|
+
occurrences: RecurringListOptions & {
|
|
27
|
+
consentId: string;
|
|
28
|
+
};
|
|
29
|
+
revoke: {
|
|
30
|
+
consentId: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type RecurringResults = {
|
|
34
|
+
preview: RecurringPreview;
|
|
35
|
+
draft: RecurringPreview | null;
|
|
36
|
+
activate: RecurringActivationResult;
|
|
37
|
+
list: RecurringPage<RecurringConsentView>;
|
|
38
|
+
get: RecurringConsentView | null;
|
|
39
|
+
occurrences: RecurringPage<RecurringOccurrenceView>;
|
|
40
|
+
revoke: RecurringRevocation;
|
|
41
|
+
};
|
|
42
|
+
export declare class RecurringInputError extends Error {
|
|
43
|
+
readonly code = "RECURRING_INPUT_INVALID";
|
|
44
|
+
constructor();
|
|
45
|
+
}
|
|
46
|
+
export declare class RemoteRecurringUnavailableError extends Error {
|
|
47
|
+
readonly code = "RECURRING_UNAVAILABLE";
|
|
48
|
+
constructor();
|
|
49
|
+
}
|
|
50
|
+
export declare class RemoteRecurringReadError extends Error {
|
|
51
|
+
readonly code = "RECURRING_READ_FAILED";
|
|
52
|
+
constructor();
|
|
53
|
+
}
|
|
54
|
+
export declare class RemoteRecurringUnconfirmedError extends Error {
|
|
55
|
+
readonly code = "RECURRING_OUTCOME_UNKNOWN";
|
|
56
|
+
readonly outcomeUnknown = true;
|
|
57
|
+
constructor();
|
|
58
|
+
}
|
|
59
|
+
declare const failures: {
|
|
60
|
+
readonly RECURRING_INVALID_REQUEST: readonly [400, "Recurring parameters were refused."];
|
|
61
|
+
readonly RECURRING_INVALID_CURSOR: readonly [400, "Recurring page cursor was refused."];
|
|
62
|
+
readonly RECURRING_BODY_TOO_LARGE: readonly [413, "Recurring input exceeds the server limit."];
|
|
63
|
+
readonly RECURRING_UNAUTHENTICATED: readonly [401, "A current authenticated membership is required."];
|
|
64
|
+
readonly RECURRING_HUMAN_APPROVAL_REQUIRED: readonly [403, "A fresh human sign-in is required to activate recurring consent."];
|
|
65
|
+
readonly RECURRING_IMPERSONATION_DENIED: readonly [403, "Recurring changes are unavailable while impersonating."];
|
|
66
|
+
readonly RECURRING_AUTHORITY_REFUSED: readonly [403, "Current recurring authority was refused."];
|
|
67
|
+
readonly RECURRING_DEPLOYMENT_MISMATCH: readonly [403, "The recurring draft belongs to another deployment."];
|
|
68
|
+
readonly RECURRING_SKILL_CHANGED: readonly [409, "The recurring skill has changed."];
|
|
69
|
+
readonly RECURRING_TERMS_UNAVAILABLE: readonly [409, "The original recurring terms are unavailable."];
|
|
70
|
+
readonly RECURRING_QUOTE_EXCEEDS_CEILING: readonly [409, "The current quote exceeds the approved recurring ceiling."];
|
|
71
|
+
readonly RECURRING_NOT_FOUND: readonly [404, "Recurring state is unavailable for this account."];
|
|
72
|
+
readonly RECURRING_METHOD_NOT_ALLOWED: readonly [405, "The recurring operation is unsupported."];
|
|
73
|
+
readonly RECURRING_UNAVAILABLE: readonly [503, "Recurring operations are unavailable on this server."];
|
|
74
|
+
readonly INSUFFICIENT_SCOPE: readonly [403, "The credential lacks the required recurring scope."];
|
|
75
|
+
readonly RATE_LIMITED: readonly [429, "The recurring request limit was reached. Wait before another explicit request."];
|
|
76
|
+
};
|
|
77
|
+
export type RemoteRecurringErrorCode = keyof typeof failures;
|
|
78
|
+
export declare class RemoteRecurringError extends Error {
|
|
79
|
+
readonly code: RemoteRecurringErrorCode;
|
|
80
|
+
readonly status: number;
|
|
81
|
+
constructor(code: RemoteRecurringErrorCode);
|
|
82
|
+
}
|
|
83
|
+
export declare function recurringFailure(value: unknown, status: number): RemoteRecurringErrorCode | null;
|
|
84
|
+
/** Snapshot before any await. Validation does not substitute for server policy. */
|
|
85
|
+
export declare function recurringInput<A extends RecurringAction>(action: A, raw: RecurringInputs[A]): RecurringInputs[A];
|
|
86
|
+
export declare function parseRecurringCapability(value: unknown): RecurringCapability | undefined;
|
|
87
|
+
export declare function assertRecurringCapability(value: unknown, action: RecurringAction): void;
|
|
88
|
+
export declare function recurringRequest<A extends RecurringAction>(action: A, input: RecurringInputs[A]): {
|
|
89
|
+
path: string;
|
|
90
|
+
read: boolean;
|
|
91
|
+
method: string;
|
|
92
|
+
body: string | undefined;
|
|
93
|
+
};
|
|
94
|
+
/** Projects known response fields. Immutable terms remain exact and hash-bound. */
|
|
95
|
+
export declare function parseRecurringResult<A extends RecurringAction>(action: A, value: unknown, input: RecurringInputs[A], identity: RemoteWorkspaceIdentity): RecurringResults[A];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ResolvedSkillSelection } from "../types/skill-selection.js";
|
|
2
2
|
import type { SkillBundleEntry } from "./skill-bundle.js";
|
|
3
3
|
import { type SelectionResolverOptions } from "./selection-resolver.js";
|
|
4
|
+
import { type SelectedSecretBindings, type SelectedSecretsClient } from "./execution-secrets.js";
|
|
4
5
|
export interface ResolvedSelectedRun {
|
|
5
6
|
selection: ResolvedSkillSelection;
|
|
7
|
+
profileId: string;
|
|
6
8
|
kind: "instruction" | "executable";
|
|
7
9
|
entries: SkillBundleEntry[];
|
|
8
10
|
manifest: Record<string, any>;
|
|
@@ -17,12 +19,29 @@ export interface SelectedLocalRunOptions {
|
|
|
17
19
|
timeoutMs?: number;
|
|
18
20
|
/** Only explicitly supplied environment values are available to declared secret references. */
|
|
19
21
|
env?: Record<string, string>;
|
|
22
|
+
/** Explicit value-free vault grants; mutually exclusive with env. */
|
|
23
|
+
secretBindings?: SelectedSecretBindings;
|
|
24
|
+
/** SDK injection seam. The default uses the independently configured Secrets SDK. */
|
|
25
|
+
createSecretsClient?: () => SelectedSecretsClient;
|
|
20
26
|
}
|
|
27
|
+
export declare function prepareSelectedSecretBindings(selected: ResolvedSelectedRun, cwd?: string): Promise<SelectedSecretBindings>;
|
|
21
28
|
export declare function executeSelectedLocal(selected: ResolvedSelectedRun, options?: SelectedLocalRunOptions): Promise<{
|
|
22
29
|
exitCode: number;
|
|
23
30
|
stdout: string;
|
|
24
31
|
stderr: string;
|
|
25
32
|
error?: string;
|
|
33
|
+
secretBinding?: {
|
|
34
|
+
schema: "hasna.skills-secret-bindings.v1";
|
|
35
|
+
selection: Pick<ResolvedSkillSelection, "slug" | "version" | "bundleDigest" | "workspaceId" | "authority" | "profileRevision"> & {
|
|
36
|
+
profileId: string;
|
|
37
|
+
};
|
|
38
|
+
consumer: {
|
|
39
|
+
stationId: string;
|
|
40
|
+
workspaceDirectory: string;
|
|
41
|
+
};
|
|
42
|
+
secretsAuthority: string;
|
|
43
|
+
bindings: Record<string, string>;
|
|
44
|
+
} | undefined;
|
|
26
45
|
selection: ResolvedSkillSelection;
|
|
27
46
|
target: "local";
|
|
28
47
|
runtime: any;
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* variable of its own. See lib/fleet-credentials.ts.
|
|
17
17
|
*/
|
|
18
18
|
export { HttpProfileClient, createProfileClient, type ProfileClient } from "../lib/profile-client.js";
|
|
19
|
+
export { resolveSelectedRun, executeSelectedLocal, prepareSelectedSecretBindings, type ResolvedSelectedRun, type SelectedLocalRunOptions } from "../lib/selected-run.js";
|
|
20
|
+
export { readSelectedSecretBindings, type SelectedSecretBindings, type SelectedSecretsClient } from "../lib/execution-secrets.js";
|
|
19
21
|
export type { SkillSelection, SkillProfile, ResolvedSkillSelection, ResolvedSkillProfile, StationSkillStateInput, StationSkillState } from "../types/skill-selection.js";
|
|
20
22
|
export { MissingSkillsFleetError, SkillsFleetCredentialError, SKILLS_API_KEY_ENV, SKILLS_API_URL_ENV, SKILLS_APP, SKILLS_LOCAL_OPT_IN_ENV_KEYS, configuredSkillsApiUrl, isSkillsLocalOptIn, noticeLocalSkillsMode, normalizeSkillsApiOrigin, requireSkillsApiOrigin, requireSkillsFleet, resolveSkillsApiOrigin, resolveSkillsFleet, selectsSkillsLocalMode, skillsCredentialFilePath, skillsCredentialFiles, skillsCredentialOrReason, type HostedSkillsFleet, type LocalSkillsFleet, type SkillsFleet, type SkillsFleetErrorCode, type SkillsFleetOptions, } from "../lib/fleet-credentials.js";
|
|
21
23
|
export * from "./server.js";
|
|
@@ -33,6 +35,10 @@ export * from "./spend.js";
|
|
|
33
35
|
export * from "./offline.js";
|
|
34
36
|
export * from "./execution/index.js";
|
|
35
37
|
export { RemoteSkillsClient, createRemoteSkillsClient, RemoteRequestError, RemoteRouteUnsupportedError, RemoteCapabilityUnavailableError, RemoteQuoteUnavailableError, RemoteWorkspaceMemberError } from "../lib/remote-client.js";
|
|
38
|
+
export * from "../lib/remote-recurring-contract.js";
|
|
39
|
+
export { RecurringInputError, RemoteRecurringError, RemoteRecurringUnavailableError, RemoteRecurringReadError, RemoteRecurringUnconfirmedError } from "../lib/remote-recurring.js";
|
|
40
|
+
export type { RecurringCapability, RecurringListOptions, RemoteRecurringErrorCode } from "../lib/remote-recurring.js";
|
|
41
|
+
export { canonicalJson, canonicalJsonSha256 } from "../lib/canonical-json.js";
|
|
36
42
|
export type { RemoteQuoteUnavailableCode } from "../lib/remote-client.js";
|
|
37
43
|
export { RemoteCreditApprovalError, type RemoteRunApproval, type RemoteRunQuote, type RemoteCreditPack } from "../lib/remote-account.js";
|
|
38
44
|
export { type RemoteInputFile, type RemoteInputFileDescriptor } from "../lib/remote-files.js";
|