@hasna/instructions 0.5.5 → 0.6.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 +64 -20
- package/dist/cli/fail-closed-no-env.test.d.ts +2 -0
- package/dist/cli/fail-closed-no-env.test.d.ts.map +1 -0
- package/dist/cli/index.js +1910 -561
- package/dist/data/config-store.d.ts +62 -33
- package/dist/data/config-store.d.ts.map +1 -1
- package/dist/db/database.d.ts.map +1 -1
- package/dist/generated/storage-kit/backend.d.ts +4 -4
- package/dist/generated/storage-kit/backend.d.ts.map +1 -1
- package/dist/generated/storage-kit/index.d.ts +1 -1
- package/dist/generated/storage-kit/index.d.ts.map +1 -1
- package/dist/generated/storage-kit/migrations.d.ts +21 -0
- package/dist/generated/storage-kit/migrations.d.ts.map +1 -1
- package/dist/generated/storage-kit/pool.d.ts +2 -5
- package/dist/generated/storage-kit/pool.d.ts.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2702 -547
- package/dist/lib/app-home.d.ts +9 -0
- package/dist/lib/app-home.d.ts.map +1 -1
- package/dist/lib/client-types.d.ts +130 -0
- package/dist/lib/client-types.d.ts.map +1 -0
- package/dist/lib/client-types.test.d.ts +2 -0
- package/dist/lib/client-types.test.d.ts.map +1 -0
- package/dist/lib/local-opt-in.d.ts +82 -0
- package/dist/lib/local-opt-in.d.ts.map +1 -0
- package/dist/lib/project-context.d.ts +14 -14
- package/dist/lib/project-context.d.ts.map +1 -1
- package/dist/lib/project-dashboard-standard.d.ts +1 -1
- package/dist/lib/project-dashboard-standard.d.ts.map +1 -1
- package/dist/lib/session-apply.d.ts.map +1 -1
- package/dist/lib/session-render-state-hermeticity.test.d.ts +2 -0
- package/dist/lib/session-render-state-hermeticity.test.d.ts.map +1 -0
- package/dist/lib/session-render-state.d.ts +57 -0
- package/dist/lib/session-render-state.d.ts.map +1 -0
- package/dist/lib/session-render-state.test.d.ts +2 -0
- package/dist/lib/session-render-state.test.d.ts.map +1 -0
- package/dist/lib/transport-resolver.d.ts +80 -0
- package/dist/lib/transport-resolver.d.ts.map +1 -0
- package/dist/lib/transport-resolver.test.d.ts +2 -0
- package/dist/lib/transport-resolver.test.d.ts.map +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1442 -192
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/sdk/index.d.ts +22 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +1042 -0
- package/dist/sdk/resolve.d.ts +82 -0
- package/dist/sdk/resolve.d.ts.map +1 -0
- package/dist/sdk/resolve.test.d.ts +2 -0
- package/dist/sdk/resolve.test.d.ts.map +1 -0
- package/dist/sdk/sdk-bundle-self-contained.test.d.ts +2 -0
- package/dist/sdk/sdk-bundle-self-contained.test.d.ts.map +1 -0
- package/dist/sdk/v1.generated.d.ts +288 -0
- package/dist/sdk/v1.generated.d.ts.map +1 -0
- package/dist/server/cloud.d.ts.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +55 -64
- package/dist/test-support/preload-state-home.d.ts +2 -0
- package/dist/test-support/preload-state-home.d.ts.map +1 -0
- package/package.json +12 -12
- package/dashboard/README.md +0 -37
- package/dist/lib/retired-storage-mode.d.ts +0 -8
- package/dist/lib/retired-storage-mode.d.ts.map +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { InstructionsV1Client } from "./v1.generated.js";
|
|
2
|
+
/** The app slug the shared resolver resolves credentials and authority for. */
|
|
3
|
+
export declare const INSTRUCTIONS_SDK_APP = "instructions";
|
|
4
|
+
/** The Keychain-tier controls the SDK forwards to the resolver. */
|
|
5
|
+
export interface InstructionsSdkKeychainOptions {
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
platform?: string;
|
|
8
|
+
hostname?: () => string;
|
|
9
|
+
run?: (argv: readonly string[]) => {
|
|
10
|
+
status: number | null;
|
|
11
|
+
stdout: string;
|
|
12
|
+
stderr: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** An environment as the resolver reads it. */
|
|
16
|
+
export type InstructionsSdkEnv = Record<string, string | undefined>;
|
|
17
|
+
/** Options for resolving the SDK transport and building the `/v1` client. */
|
|
18
|
+
export interface InstructionsSdkResolveOptions {
|
|
19
|
+
/** Tier 1: an explicit authority (origin, with or without a trailing `/v1`). */
|
|
20
|
+
baseUrl?: string;
|
|
21
|
+
/** Tier 1: an explicit credential. Required when `baseUrl` is explicit. */
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
/** Tier 1 profile selection; also used by tests to inject a fake `security` runner. */
|
|
24
|
+
credentials?: {
|
|
25
|
+
apiKey?: string;
|
|
26
|
+
profile?: string;
|
|
27
|
+
keychain?: InstructionsSdkKeychainOptions;
|
|
28
|
+
};
|
|
29
|
+
/** Defaults to `process.env`. */
|
|
30
|
+
env?: InstructionsSdkEnv;
|
|
31
|
+
/** Custom fetch (defaults to global fetch). */
|
|
32
|
+
fetch?: typeof fetch;
|
|
33
|
+
/** Extra headers merged into every request. */
|
|
34
|
+
headers?: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Where the SDK's credential and authority came from — never a resolver-tier
|
|
38
|
+
* key VALUE. The value itself is only ever produced by
|
|
39
|
+
* {@link createInstructionsV1ClientFromEnv}, which hands it straight to the
|
|
40
|
+
* transport; a report or diagnostic can never leak it.
|
|
41
|
+
*/
|
|
42
|
+
export interface InstructionsSdkTransportReport {
|
|
43
|
+
/** `"explicit"` for a caller-selected authority+key pair, `"http"` for a resolver-decided hosted run. */
|
|
44
|
+
mode: "explicit" | "http";
|
|
45
|
+
/** Origin (and any gateway path prefix) WITHOUT the `/v1` suffix. */
|
|
46
|
+
baseUrl: string;
|
|
47
|
+
/** The caller's own key in `"explicit"` mode; null when the chain decided (the value is not reported). */
|
|
48
|
+
apiKey: string | null;
|
|
49
|
+
/** WHERE the key came from: an env key NAME, a Keychain reference, a path, or `"explicit apiKey argument"`. */
|
|
50
|
+
apiKeySource: string | null;
|
|
51
|
+
/** WHERE the authority came from, or `"default"` for the fleet gateway. */
|
|
52
|
+
apiUrlSource: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Resolve the SDK's authority and credential SOURCE.
|
|
56
|
+
*
|
|
57
|
+
* An explicit `baseUrl` + `apiKey` pair is a pin the caller owns and is used
|
|
58
|
+
* verbatim (never resolved around). An explicit `baseUrl` WITHOUT an `apiKey`
|
|
59
|
+
* throws — the SDK must not attach the machine's fleet key to an arbitrary
|
|
60
|
+
* authority (#1794). Otherwise the @hasna/contracts chain decides, and every
|
|
61
|
+
* refusal throws; there is no local mode on this surface.
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveInstructionsSdkTransport(options?: InstructionsSdkResolveOptions): InstructionsSdkTransportReport;
|
|
64
|
+
/**
|
|
65
|
+
* Build the hosted `/v1` client with the fleet resolver behind it, fresh on
|
|
66
|
+
* every request.
|
|
67
|
+
*
|
|
68
|
+
* The generated client stores whatever key it is handed, so a client built
|
|
69
|
+
* once and held for hours would keep sending the key that resolved at
|
|
70
|
+
* construction — the staleness the fresh-per-call chain exists to remove.
|
|
71
|
+
* Rather than forking the generated file, the credential is re-resolved in a
|
|
72
|
+
* `fetch` wrapper: the generated request has already set `x-api-key` from its
|
|
73
|
+
* stored value by the time we see it, and we overwrite that header with the
|
|
74
|
+
* key the chain resolves NOW. A re-resolution that throws or comes back empty
|
|
75
|
+
* leaves the generated header in place, so a transient unreadable Keychain
|
|
76
|
+
* cannot turn a working client into a failing one mid-flight.
|
|
77
|
+
*
|
|
78
|
+
* In `"explicit"` mode (caller-supplied baseUrl + apiKey) the key is a pin the
|
|
79
|
+
* caller owns and is sent verbatim on every request.
|
|
80
|
+
*/
|
|
81
|
+
export declare function createInstructionsV1ClientFromEnv(options?: InstructionsSdkResolveOptions): InstructionsV1Client;
|
|
82
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@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G,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC;IAC1B,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,0GAA0G;IAC1G,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,+GAA+G;IAC/G,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAC;CACtB;AAgBD;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,GAAE,6BAAkC,GAC1C,8BAA8B,CA6BhC;AAqBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,6BAAkC,GAC1C,oBAAoB,CAmCtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.test.d.ts","sourceRoot":"","sources":["../../src/sdk/resolve.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-bundle-self-contained.test.d.ts","sourceRoot":"","sources":["../../src/sdk/sdk-bundle-self-contained.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
export interface Config {
|
|
2
|
+
"id"?: string;
|
|
3
|
+
"name"?: string;
|
|
4
|
+
"slug"?: string;
|
|
5
|
+
"kind"?: string;
|
|
6
|
+
"category"?: string;
|
|
7
|
+
"agent"?: string;
|
|
8
|
+
"target_path"?: string | null;
|
|
9
|
+
"outputs"?: Array<Record<string, unknown>>;
|
|
10
|
+
"format"?: string;
|
|
11
|
+
"content"?: string;
|
|
12
|
+
"description"?: string | null;
|
|
13
|
+
"tags"?: Array<string>;
|
|
14
|
+
"is_template"?: boolean;
|
|
15
|
+
"version"?: number;
|
|
16
|
+
"created_at"?: string;
|
|
17
|
+
"updated_at"?: string;
|
|
18
|
+
"synced_at"?: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface Profile {
|
|
21
|
+
"id"?: string;
|
|
22
|
+
"name"?: string;
|
|
23
|
+
"slug"?: string;
|
|
24
|
+
"description"?: string | null;
|
|
25
|
+
"selectors"?: Record<string, unknown>;
|
|
26
|
+
"variables"?: Record<string, unknown>;
|
|
27
|
+
"created_at"?: string;
|
|
28
|
+
"updated_at"?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CreateConfigInput {
|
|
31
|
+
"name": string;
|
|
32
|
+
"category": string;
|
|
33
|
+
"content": string;
|
|
34
|
+
"kind"?: string;
|
|
35
|
+
"agent"?: string;
|
|
36
|
+
"target_path"?: string;
|
|
37
|
+
"format"?: string;
|
|
38
|
+
"description"?: string;
|
|
39
|
+
"tags"?: Array<string>;
|
|
40
|
+
"is_template"?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface UpdateConfigInput {
|
|
43
|
+
"name"?: string;
|
|
44
|
+
"category"?: string;
|
|
45
|
+
"agent"?: string;
|
|
46
|
+
"content"?: string;
|
|
47
|
+
"description"?: string;
|
|
48
|
+
"tags"?: Array<string>;
|
|
49
|
+
"is_template"?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface CreateProfileInput {
|
|
52
|
+
"name": string;
|
|
53
|
+
"description"?: string;
|
|
54
|
+
"selectors"?: Record<string, unknown>;
|
|
55
|
+
"variables"?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
export interface AddProfileConfigInput {
|
|
58
|
+
"config_id": string;
|
|
59
|
+
}
|
|
60
|
+
export interface ProfileConfigBindingSpec {
|
|
61
|
+
"schema": string;
|
|
62
|
+
"activation": Record<string, unknown>;
|
|
63
|
+
"required": boolean;
|
|
64
|
+
"fallback": "fail" | "flatten" | "promote-always" | "omit";
|
|
65
|
+
"providers"?: Array<Record<string, unknown>>;
|
|
66
|
+
"depends_on"?: Array<string>;
|
|
67
|
+
"replaces"?: Array<string>;
|
|
68
|
+
"conflicts_with"?: Array<string>;
|
|
69
|
+
}
|
|
70
|
+
export interface ProfileConfigBinding {
|
|
71
|
+
"profile_id": string;
|
|
72
|
+
"config_id": string;
|
|
73
|
+
"sort_order": number;
|
|
74
|
+
"binding": ProfileConfigBindingSpec;
|
|
75
|
+
}
|
|
76
|
+
export interface ProfileAssetBindingSpec {
|
|
77
|
+
"schema": string;
|
|
78
|
+
"assetKey": string;
|
|
79
|
+
"kind": "skill" | "workflow" | "plugin" | "extension" | "hook" | "custom-agent";
|
|
80
|
+
"enabled": boolean;
|
|
81
|
+
"required": boolean;
|
|
82
|
+
"selector": {
|
|
83
|
+
"provider": string;
|
|
84
|
+
"versionRange": string;
|
|
85
|
+
"surface": string;
|
|
86
|
+
"scope": "global" | "project" | "session";
|
|
87
|
+
};
|
|
88
|
+
"source": {
|
|
89
|
+
"kind": "skill" | "workflow" | "plugin" | "extension" | "hook" | "custom-agent";
|
|
90
|
+
"locator": string;
|
|
91
|
+
"digest": string;
|
|
92
|
+
"immutable": boolean;
|
|
93
|
+
"allowed": boolean;
|
|
94
|
+
};
|
|
95
|
+
"destination": {
|
|
96
|
+
"strategy": "emit-file" | "install-local" | "install-marketplace" | "unsupported";
|
|
97
|
+
"root": "target-home" | "project-root";
|
|
98
|
+
"relativePath": string;
|
|
99
|
+
};
|
|
100
|
+
"uninstall": "remove-managed" | "retain";
|
|
101
|
+
"rollback": "snapshot" | "installer-receipt" | "none";
|
|
102
|
+
}
|
|
103
|
+
export interface ProfileAssetBinding {
|
|
104
|
+
"profile_id": string;
|
|
105
|
+
"source_config_id": string;
|
|
106
|
+
"sort_order": number;
|
|
107
|
+
"binding": ProfileAssetBindingSpec;
|
|
108
|
+
}
|
|
109
|
+
export interface AddProfileAssetInput {
|
|
110
|
+
"source_config_id": string;
|
|
111
|
+
"binding": ProfileAssetBindingSpec;
|
|
112
|
+
}
|
|
113
|
+
export interface ProfileConfigAddedResponse {
|
|
114
|
+
"added": boolean;
|
|
115
|
+
}
|
|
116
|
+
export interface ProfileConfigRemovedResponse {
|
|
117
|
+
"removed": boolean;
|
|
118
|
+
}
|
|
119
|
+
export interface ProfileWithConfigs {
|
|
120
|
+
"id"?: string;
|
|
121
|
+
"name"?: string;
|
|
122
|
+
"slug"?: string;
|
|
123
|
+
"description"?: string | null;
|
|
124
|
+
"selectors"?: Record<string, unknown>;
|
|
125
|
+
"variables"?: Record<string, unknown>;
|
|
126
|
+
"created_at"?: string;
|
|
127
|
+
"updated_at"?: string;
|
|
128
|
+
"configs"?: Array<Config>;
|
|
129
|
+
}
|
|
130
|
+
export interface BoundedProfilePage {
|
|
131
|
+
"profiles"?: Array<Profile>;
|
|
132
|
+
"items": Array<Profile>;
|
|
133
|
+
"count"?: number;
|
|
134
|
+
"total": number;
|
|
135
|
+
"limit": number;
|
|
136
|
+
"cursor": number;
|
|
137
|
+
"next_cursor": number | null;
|
|
138
|
+
"has_more": boolean;
|
|
139
|
+
"complete": boolean;
|
|
140
|
+
"truncated": boolean;
|
|
141
|
+
"source_bounded": boolean;
|
|
142
|
+
}
|
|
143
|
+
export interface BoundedConfigPage {
|
|
144
|
+
"items": Array<Config>;
|
|
145
|
+
"total": number;
|
|
146
|
+
"limit": number;
|
|
147
|
+
"cursor": number;
|
|
148
|
+
"next_cursor": number | null;
|
|
149
|
+
"has_more": boolean;
|
|
150
|
+
"complete": boolean;
|
|
151
|
+
"truncated": boolean;
|
|
152
|
+
"source_bounded": boolean;
|
|
153
|
+
}
|
|
154
|
+
export interface ProfileShowResponse {
|
|
155
|
+
"profile": ProfileWithConfigs;
|
|
156
|
+
"configs": BoundedConfigPage;
|
|
157
|
+
}
|
|
158
|
+
export interface ProfileResolutionRead {
|
|
159
|
+
"profile": Profile | null;
|
|
160
|
+
"scanned": number | null;
|
|
161
|
+
"total": number | null;
|
|
162
|
+
"batch_limit": number | null;
|
|
163
|
+
"source_bounded": boolean;
|
|
164
|
+
"complete": boolean;
|
|
165
|
+
"truncated": boolean;
|
|
166
|
+
}
|
|
167
|
+
export interface InstructionsV1ClientOptions {
|
|
168
|
+
/** Base URL, e.g. process.env.APP_API_URL. */
|
|
169
|
+
baseUrl: string;
|
|
170
|
+
/** API key, e.g. process.env.APP_API_KEY. Sent as the 'x-api-key' header. */
|
|
171
|
+
apiKey?: string;
|
|
172
|
+
/** Custom fetch (defaults to global fetch). */
|
|
173
|
+
fetch?: typeof fetch;
|
|
174
|
+
/** Extra headers merged into every request. */
|
|
175
|
+
headers?: Record<string, string>;
|
|
176
|
+
}
|
|
177
|
+
export declare class ApiError extends Error {
|
|
178
|
+
readonly status: number;
|
|
179
|
+
readonly body: unknown;
|
|
180
|
+
constructor(status: number, message: string, body: unknown);
|
|
181
|
+
}
|
|
182
|
+
export declare class InstructionsV1Client {
|
|
183
|
+
private readonly baseUrl;
|
|
184
|
+
private readonly apiKey;
|
|
185
|
+
private readonly fetchImpl;
|
|
186
|
+
private readonly baseHeaders;
|
|
187
|
+
constructor(options: InstructionsV1ClientOptions);
|
|
188
|
+
private request;
|
|
189
|
+
/** List configs */
|
|
190
|
+
listConfigs(query?: {
|
|
191
|
+
"category"?: string;
|
|
192
|
+
"agent"?: string;
|
|
193
|
+
"kind"?: string;
|
|
194
|
+
"search"?: string;
|
|
195
|
+
}, init?: RequestInit): Promise<{
|
|
196
|
+
"configs"?: Array<Config>;
|
|
197
|
+
"count"?: number;
|
|
198
|
+
}>;
|
|
199
|
+
/** Create a config */
|
|
200
|
+
createConfig(body: CreateConfigInput, init?: RequestInit): Promise<{
|
|
201
|
+
"config"?: Config;
|
|
202
|
+
}>;
|
|
203
|
+
/** Get a config by id or slug */
|
|
204
|
+
getConfig(id: string, init?: RequestInit): Promise<{
|
|
205
|
+
"config"?: Config;
|
|
206
|
+
}>;
|
|
207
|
+
/** Delete a config */
|
|
208
|
+
deleteConfig(id: string, init?: RequestInit): Promise<{
|
|
209
|
+
"deleted"?: boolean;
|
|
210
|
+
"id"?: string;
|
|
211
|
+
}>;
|
|
212
|
+
/** Update a config */
|
|
213
|
+
updateConfig(id: string, body: UpdateConfigInput, init?: RequestInit): Promise<{
|
|
214
|
+
"config"?: Config;
|
|
215
|
+
}>;
|
|
216
|
+
/** List a config's version snapshots */
|
|
217
|
+
listSnapshots(id: string, init?: RequestInit): Promise<{
|
|
218
|
+
"snapshots"?: Array<Record<string, unknown>>;
|
|
219
|
+
"count"?: number;
|
|
220
|
+
}>;
|
|
221
|
+
/** Snapshot a config's current content */
|
|
222
|
+
createSnapshot(id: string, init?: RequestInit): Promise<{
|
|
223
|
+
"snapshot"?: Record<string, unknown>;
|
|
224
|
+
}>;
|
|
225
|
+
/** List profiles with producer-side bounds */
|
|
226
|
+
listProfiles(query?: {
|
|
227
|
+
"limit"?: number;
|
|
228
|
+
"cursor"?: number;
|
|
229
|
+
}, init?: RequestInit): Promise<BoundedProfilePage>;
|
|
230
|
+
/** Create a profile */
|
|
231
|
+
createProfile(body: CreateProfileInput, init?: RequestInit): Promise<{
|
|
232
|
+
"profile"?: Profile;
|
|
233
|
+
}>;
|
|
234
|
+
/** Resolve a machine profile by scanning producer-bounded batches */
|
|
235
|
+
resolveProfile(query?: {
|
|
236
|
+
"hostname"?: string;
|
|
237
|
+
"os"?: string;
|
|
238
|
+
"arch"?: string;
|
|
239
|
+
"limit"?: number;
|
|
240
|
+
}, init?: RequestInit): Promise<ProfileResolutionRead>;
|
|
241
|
+
/** Get a profile (with its configs) by id or slug */
|
|
242
|
+
getProfile(id: string, query?: {
|
|
243
|
+
"limit"?: number;
|
|
244
|
+
"cursor"?: number;
|
|
245
|
+
}, init?: RequestInit): Promise<ProfileShowResponse>;
|
|
246
|
+
/** Delete a profile */
|
|
247
|
+
deleteProfile(id: string, init?: RequestInit): Promise<{
|
|
248
|
+
"deleted"?: boolean;
|
|
249
|
+
"id"?: string;
|
|
250
|
+
}>;
|
|
251
|
+
/** List typed asset bindings for a profile */
|
|
252
|
+
getProfileAssetBindings(id: string, init?: RequestInit): Promise<{
|
|
253
|
+
"assets"?: Array<ProfileAssetBinding>;
|
|
254
|
+
}>;
|
|
255
|
+
/** Add a content-addressed asset binding to a profile */
|
|
256
|
+
addAssetToProfile(id: string, body: AddProfileAssetInput, init?: RequestInit): Promise<{
|
|
257
|
+
"asset"?: ProfileAssetBinding;
|
|
258
|
+
}>;
|
|
259
|
+
/** Replace one schema-versioned profile asset binding */
|
|
260
|
+
setProfileAssetBinding(id: string, assetKey: string, body: {
|
|
261
|
+
"binding": ProfileAssetBindingSpec;
|
|
262
|
+
}, init?: RequestInit): Promise<{
|
|
263
|
+
"asset"?: ProfileAssetBinding;
|
|
264
|
+
}>;
|
|
265
|
+
/** Remove one managed asset binding from a profile */
|
|
266
|
+
removeAssetFromProfile(id: string, assetKey: string, init?: RequestInit): Promise<{
|
|
267
|
+
"removed"?: boolean;
|
|
268
|
+
}>;
|
|
269
|
+
/** List schema-versioned config bindings for a profile */
|
|
270
|
+
getProfileConfigBindings(id: string, init?: RequestInit): Promise<{
|
|
271
|
+
"bindings"?: Array<ProfileConfigBinding>;
|
|
272
|
+
}>;
|
|
273
|
+
/** Add a config to a profile */
|
|
274
|
+
addConfigToProfile(id: string, body: AddProfileConfigInput, init?: RequestInit): Promise<ProfileConfigAddedResponse>;
|
|
275
|
+
/** Set the schema-versioned binding for one profile config */
|
|
276
|
+
setProfileConfigBinding(id: string, configId: string, body: {
|
|
277
|
+
"binding": ProfileConfigBindingSpec;
|
|
278
|
+
}, init?: RequestInit): Promise<{
|
|
279
|
+
"binding"?: ProfileConfigBinding;
|
|
280
|
+
}>;
|
|
281
|
+
/** Remove a config from a profile */
|
|
282
|
+
removeConfigFromProfile(id: string, configId: string, init?: RequestInit): Promise<ProfileConfigRemovedResponse>;
|
|
283
|
+
/** Aggregate config counts by category */
|
|
284
|
+
getStats(init?: RequestInit): Promise<{
|
|
285
|
+
"total"?: number;
|
|
286
|
+
}>;
|
|
287
|
+
}
|
|
288
|
+
//# sourceMappingURL=v1.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.generated.d.ts","sourceRoot":"","sources":["../../src/sdk/v1.generated.ts"],"names":[],"mappings":"AAMA,M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AAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAQ1H,8DAA8D;IACxD,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,SAAS,EAAE,wBAAwB,CAAA;KAAE,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;QAAE,SAAS,CAAC,EAAE,oBAAoB,CAAA;KAAE,CAAC;IAQ7K,qCAAqC;IAC/B,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAQtH,0CAA0C;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAOpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../../src/server/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAgB,UAAU,EAAE,KAAK,cAAc,EAAE,WAAW,EAAwB,MAAM,uBAAuB,CAAC;AACzH,OAAO,EAAmC,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../../src/server/cloud.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAgB,UAAU,EAAE,KAAK,cAAc,EAAE,WAAW,EAAwB,MAAM,uBAAuB,CAAC;AACzH,OAAO,EAAmC,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAG1G,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD,oFAAoF;AACpF,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAOhG;AAED,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAO7F;AAED,wFAAwF;AACxF,wBAAgB,wBAAwB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAEtF;AA0BD,+EAA+E;AAC/E,wBAAgB,cAAc,IAAI,eAAe,CAEhD;AAkBD,wBAAgB,cAAc,IAAI,WAAW,CAI5C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,cAAc,CAejD;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAkBvD;AAQD,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAmB7F;AAED,iEAAiE;AACjE,wBAAsB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAIlD;AAED,4BAA4B;AAC5B,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAgBhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;;;;AA6HA,wBAAgE"}
|
package/dist/server/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var __export = (target, all) => {
|
|
|
14
14
|
set: __exportSetter.bind(all, name)
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
-
var __require = import.meta.require;
|
|
18
17
|
|
|
19
18
|
// ../../node_modules/.bun/hono@4.13.3/node_modules/hono/dist/compose.js
|
|
20
19
|
var compose = (middleware, onError, onNotFound) => {
|
|
@@ -1793,7 +1792,7 @@ function viewWindow(view) {
|
|
|
1793
1792
|
}
|
|
1794
1793
|
function toBuffer(secret) {
|
|
1795
1794
|
if (typeof secret === "string")
|
|
1796
|
-
return Buffer.from(secret, "utf8");
|
|
1795
|
+
return Buffer.from(secret.trim(), "utf8");
|
|
1797
1796
|
if (ArrayBuffer.isView(secret)) {
|
|
1798
1797
|
const [store, byteOffset, byteLength] = viewWindow(secret);
|
|
1799
1798
|
return Buffer.from(store, byteOffset, byteLength);
|
|
@@ -2100,11 +2099,17 @@ class ApiKeyStore {
|
|
|
2100
2099
|
return status !== "active";
|
|
2101
2100
|
};
|
|
2102
2101
|
}
|
|
2103
|
-
async revoke(kid, reason, atMs = Date.now()) {
|
|
2102
|
+
async revoke(kid, reason, atMs = Date.now(), options = {}) {
|
|
2103
|
+
const params = [kid, new Date(atMs).toISOString(), reason ?? null];
|
|
2104
|
+
let scope = "";
|
|
2105
|
+
if (options.app !== undefined) {
|
|
2106
|
+
params.push(options.app);
|
|
2107
|
+
scope = ` AND app = $${params.length}`;
|
|
2108
|
+
}
|
|
2104
2109
|
const row = await this.client.get(`UPDATE ${this.table}
|
|
2105
2110
|
SET revoked_at = COALESCE(revoked_at, $2), revoked_reason = COALESCE(revoked_reason, $3)
|
|
2106
|
-
WHERE kid = $1
|
|
2107
|
-
RETURNING kid`,
|
|
2111
|
+
WHERE kid = $1${scope}
|
|
2112
|
+
RETURNING kid`, params);
|
|
2108
2113
|
return row !== null;
|
|
2109
2114
|
}
|
|
2110
2115
|
async touchLastUsed(kid, atMs = Date.now()) {
|
|
@@ -2664,35 +2669,13 @@ function instructionsSchemaSql() {
|
|
|
2664
2669
|
];
|
|
2665
2670
|
}
|
|
2666
2671
|
|
|
2667
|
-
// src/lib/retired-storage-mode.ts
|
|
2668
|
-
var LEGACY_STORAGE_MODE_KEYS = [
|
|
2669
|
-
"HASNA_INSTRUCTIONS_STORAGE_MODE",
|
|
2670
|
-
"HASNA_INSTRUCTIONS_MODE",
|
|
2671
|
-
"INSTRUCTIONS_STORAGE_MODE",
|
|
2672
|
-
"INSTRUCTIONS_MODE"
|
|
2673
|
-
];
|
|
2674
|
-
function firstDefinedEnvKey(env, keys) {
|
|
2675
|
-
for (const key of keys) {
|
|
2676
|
-
if (Object.hasOwn(env, key) && env[key] !== undefined)
|
|
2677
|
-
return key;
|
|
2678
|
-
}
|
|
2679
|
-
return null;
|
|
2680
|
-
}
|
|
2681
|
-
function assertNoLegacyStorageMode(env = process.env) {
|
|
2682
|
-
const legacyKey = firstDefinedEnvKey(env, LEGACY_STORAGE_MODE_KEYS);
|
|
2683
|
-
if (!legacyKey)
|
|
2684
|
-
return;
|
|
2685
|
-
throw new Error(`${legacyKey} was removed. Deployment modes no longer exist: delete the storage-mode variable. ` + `The client uses the local SQLite store, or the HTTP API selected by ` + `HASNA_INSTRUCTIONS_API_URL + HASNA_INSTRUCTIONS_API_KEY. ` + `On the server, set HASNA_INSTRUCTIONS_DATABASE_URL to select the postgresql backend, ` + `or leave it unset for sqlite.`);
|
|
2686
|
-
}
|
|
2687
|
-
|
|
2688
2672
|
// src/server/cloud.ts
|
|
2689
2673
|
var INSTRUCTIONS_APP_SLUG = "instructions";
|
|
2690
2674
|
function resolveCloudDatabaseUrl(env = process.env) {
|
|
2691
|
-
assertNoLegacyStorageMode(env);
|
|
2692
2675
|
return env.HASNA_INSTRUCTIONS_DATABASE_URL || env.INSTRUCTIONS_DATABASE_URL || env.DATABASE_URL || undefined;
|
|
2693
2676
|
}
|
|
2694
2677
|
function resolveSigningSecret(env = process.env) {
|
|
2695
|
-
return env.HASNA_INSTRUCTIONS_API_SIGNING_KEY || env.HASNA_API_SIGNING_KEY || env.API_KEY_SIGNING_SECRET || undefined;
|
|
2678
|
+
return env.HASNA_INSTRUCTIONS_API_SIGNING_KEY?.trim() || env.HASNA_API_SIGNING_KEY?.trim() || env.API_KEY_SIGNING_SECRET?.trim() || undefined;
|
|
2696
2679
|
}
|
|
2697
2680
|
function isPostgresBackendEnabled(env = process.env) {
|
|
2698
2681
|
return Boolean(resolveCloudDatabaseUrl(env));
|
|
@@ -2787,7 +2770,9 @@ async function closeCloud() {
|
|
|
2787
2770
|
cachedClient = null;
|
|
2788
2771
|
cachedStore = null;
|
|
2789
2772
|
cachedVerifier = null;
|
|
2773
|
+
honoMiddlewareCache.clear();
|
|
2790
2774
|
schemaEnsured = null;
|
|
2775
|
+
honoMiddlewareCache.clear();
|
|
2791
2776
|
}
|
|
2792
2777
|
|
|
2793
2778
|
// src/storage/cloud-store.ts
|
|
@@ -2839,6 +2824,27 @@ function boundedReadPage(items, total, options = {}) {
|
|
|
2839
2824
|
};
|
|
2840
2825
|
}
|
|
2841
2826
|
|
|
2827
|
+
// ../contracts/dist/client/transport.js
|
|
2828
|
+
import { createRequire } from "module";
|
|
2829
|
+
var MAX_CREDENTIAL_FILE_BYTES = 64 * 1024;
|
|
2830
|
+
var INSPECT_CUSTOM = Symbol.for("nodejs.util.inspect.custom");
|
|
2831
|
+
var CREDENTIAL_SEAL = Symbol.for("hasna:contracts:sealedCredential");
|
|
2832
|
+
var AMBIENT_ENVIRONMENT = Symbol.for("hasna:contracts:ambientClientEnvironment");
|
|
2833
|
+
var SECRETS_PACKAGE_SPECIFIER = "@hasna/" + "secrets";
|
|
2834
|
+
var requireSecretsSdk = createRequire(import.meta.url);
|
|
2835
|
+
var IDEMPOTENT_METHODS = new Set(["GET", "HEAD", "PUT", "DELETE", "OPTIONS"]);
|
|
2836
|
+
var AUTHORITY_OVERRIDE_HEADERS = new Set([
|
|
2837
|
+
"host",
|
|
2838
|
+
":authority",
|
|
2839
|
+
"forwarded",
|
|
2840
|
+
"x-forwarded-host",
|
|
2841
|
+
"x-original-host"
|
|
2842
|
+
]);
|
|
2843
|
+
|
|
2844
|
+
// src/lib/local-opt-in.ts
|
|
2845
|
+
var INSTRUCTIONS_LOCAL_OPT_IN_ENV_KEYS = ["HASNA_INSTRUCTIONS_LOCAL"];
|
|
2846
|
+
var CONTRACTS_AMBIENT_ENVIRONMENT = Symbol.for("hasna:contracts:ambientClientEnvironment");
|
|
2847
|
+
|
|
2842
2848
|
// src/lib/machine.ts
|
|
2843
2849
|
function normalizeOsFamily(os) {
|
|
2844
2850
|
const value = (os ?? "").trim().toLowerCase();
|
|
@@ -3049,6 +3055,26 @@ function booleanValue(value, label) {
|
|
|
3049
3055
|
return value;
|
|
3050
3056
|
}
|
|
3051
3057
|
|
|
3058
|
+
// ../contracts/dist/client/storage.js
|
|
3059
|
+
import { createRequire as createRequire2 } from "module";
|
|
3060
|
+
var MAX_CREDENTIAL_FILE_BYTES2 = 64 * 1024;
|
|
3061
|
+
var INSPECT_CUSTOM2 = Symbol.for("nodejs.util.inspect.custom");
|
|
3062
|
+
var CREDENTIAL_SEAL2 = Symbol.for("hasna:contracts:sealedCredential");
|
|
3063
|
+
var AMBIENT_ENVIRONMENT2 = Symbol.for("hasna:contracts:ambientClientEnvironment");
|
|
3064
|
+
var SECRETS_PACKAGE_SPECIFIER2 = "@hasna/" + "secrets";
|
|
3065
|
+
var requireSecretsSdk2 = createRequire2(import.meta.url);
|
|
3066
|
+
var IDEMPOTENT_METHODS2 = new Set(["GET", "HEAD", "PUT", "DELETE", "OPTIONS"]);
|
|
3067
|
+
var AUTHORITY_OVERRIDE_HEADERS2 = new Set([
|
|
3068
|
+
"host",
|
|
3069
|
+
":authority",
|
|
3070
|
+
"forwarded",
|
|
3071
|
+
"x-forwarded-host",
|
|
3072
|
+
"x-original-host"
|
|
3073
|
+
]);
|
|
3074
|
+
|
|
3075
|
+
// src/lib/transport-resolver.ts
|
|
3076
|
+
var INSTRUCTIONS_LOCAL_OPT_IN_ENV = INSTRUCTIONS_LOCAL_OPT_IN_ENV_KEYS[0];
|
|
3077
|
+
|
|
3052
3078
|
// src/lib/global-agent-rules-standard.ts
|
|
3053
3079
|
var AGENT_OPERATING_RULES_SOURCE_SET_ID = "hasna-global-agent-rules-standard";
|
|
3054
3080
|
var AGENT_OPERATING_RULES_SOURCE_ID = "hasna-agent-operating-rules";
|
|
@@ -9101,8 +9127,6 @@ function buildV1OpenApiDocument(version = getPackageVersion()) {
|
|
|
9101
9127
|
}
|
|
9102
9128
|
|
|
9103
9129
|
// src/server/index.ts
|
|
9104
|
-
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "fs";
|
|
9105
|
-
import { join as join3, extname } from "path";
|
|
9106
9130
|
if (process.argv.includes("migrate")) {
|
|
9107
9131
|
if (!resolveCloudDatabaseUrl()) {
|
|
9108
9132
|
console.error("migrate: no database URL (HASNA_INSTRUCTIONS_DATABASE_URL / INSTRUCTIONS_DATABASE_URL / DATABASE_URL)");
|
|
@@ -9173,41 +9197,8 @@ app.all("/v1/*", async (c) => {
|
|
|
9173
9197
|
const res = await handleV1Request(c.req.raw, new URL(c.req.url));
|
|
9174
9198
|
return res ?? c.json({ error: "Not found" }, 404);
|
|
9175
9199
|
});
|
|
9176
|
-
var MIME = { ".html": "text/html", ".js": "application/javascript", ".css": "text/css", ".json": "application/json", ".svg": "image/svg+xml", ".png": "image/png", ".ico": "image/x-icon" };
|
|
9177
|
-
function findDashboardDir() {
|
|
9178
|
-
const candidates = [
|
|
9179
|
-
join3(import.meta.dir, "../../dashboard/dist"),
|
|
9180
|
-
join3(import.meta.dir, "../dashboard/dist"),
|
|
9181
|
-
join3(import.meta.dir, "../../../dashboard/dist")
|
|
9182
|
-
];
|
|
9183
|
-
for (const dir of candidates) {
|
|
9184
|
-
if (existsSync2(join3(dir, "index.html")))
|
|
9185
|
-
return dir;
|
|
9186
|
-
}
|
|
9187
|
-
return null;
|
|
9188
|
-
}
|
|
9189
|
-
var dashDir = findDashboardDir();
|
|
9190
|
-
if (dashDir) {
|
|
9191
|
-
const resolvedDashDir = __require("path").resolve(dashDir);
|
|
9192
|
-
app.get("/*", (c) => {
|
|
9193
|
-
const url = new URL(c.req.url);
|
|
9194
|
-
let filePath = url.pathname === "/" ? "/index.html" : url.pathname;
|
|
9195
|
-
let absPath = __require("path").resolve(join3(dashDir, filePath));
|
|
9196
|
-
if (!absPath.startsWith(resolvedDashDir))
|
|
9197
|
-
return c.json({ error: "Forbidden" }, 403);
|
|
9198
|
-
if (!existsSync2(absPath))
|
|
9199
|
-
absPath = join3(dashDir, "index.html");
|
|
9200
|
-
if (!existsSync2(absPath))
|
|
9201
|
-
return c.json({ error: "Not found" }, 404);
|
|
9202
|
-
const content = readFileSync3(absPath);
|
|
9203
|
-
const ext = extname(absPath);
|
|
9204
|
-
return new Response(content, {
|
|
9205
|
-
headers: { "Content-Type": MIME[ext] || "application/octet-stream" }
|
|
9206
|
-
});
|
|
9207
|
-
});
|
|
9208
|
-
}
|
|
9209
9200
|
var HOST = process.env["HOST"] ?? process.env["INSTRUCTIONS_HOST"] ?? "localhost";
|
|
9210
|
-
console.log(`instructions-serve listening on http://${HOST}:${PORT} (backend: ${serviceBackend()})
|
|
9201
|
+
console.log(`instructions-serve listening on http://${HOST}:${PORT} (backend: ${serviceBackend()})`);
|
|
9211
9202
|
var server_default = { port: PORT, hostname: HOST, fetch: app.fetch };
|
|
9212
9203
|
export {
|
|
9213
9204
|
server_default as default
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preload-state-home.d.ts","sourceRoot":"","sources":["../../src/test-support/preload-state-home.ts"],"names":[],"mappings":""}
|