@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
package/dist/lib/app-home.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export type PathKind = "config" | "data" | "state" | "cache";
|
|
2
|
+
export interface PathsResolverOptions {
|
|
3
|
+
app: string;
|
|
4
|
+
internal?: boolean;
|
|
5
|
+
platform?: string;
|
|
6
|
+
home?: string;
|
|
7
|
+
env?: Record<string, string | undefined>;
|
|
8
|
+
}
|
|
9
|
+
export declare function configDir(options: PathsResolverOptions): string;
|
|
1
10
|
/**
|
|
2
11
|
* Configs-app store-home resolution via the @hasna/paths resolver (XDG / macOS
|
|
3
12
|
* home layout). The "configs" app is the @hasna/instructions package surface
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-home.d.ts","sourceRoot":"","sources":["../../src/lib/app-home.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-home.d.ts","sourceRoot":"","sources":["../../src/lib/app-home.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAS7D,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AA0DD,wBAAgB,SAAS,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAE/D;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAM3D,yGAAyG;AACzG,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAE5E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAE9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAIT;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAGvF;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAKhF;AAED,uEAAuE;AACvE,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAElF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAI9E"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/** Which tier of the credential chain supplied a key (@hasna/contracts `CredentialTier`). */
|
|
2
|
+
export type InstructionsCredentialTier = "argument" | "override" | "pointer" | "profile" | "keychain" | "disk" | "env";
|
|
3
|
+
/** A resolved client transport: authority + credential SOURCE, never a value (@hasna/contracts `ClientTransportResolution`). */
|
|
4
|
+
export interface InstructionsClientTransportResolution {
|
|
5
|
+
/** Where the client should read/write from. */
|
|
6
|
+
transport: string;
|
|
7
|
+
/** What selected the transport (an env key NAME, a Keychain reference, a file PATH, or `"default"`). */
|
|
8
|
+
transportSource: string;
|
|
9
|
+
/** `<origin>/v1` base for the server API. */
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
/** WHERE the API URL came from: an env key NAME, a Keychain reference, a file PATH, or `"default"`. */
|
|
12
|
+
apiUrlSource: string | null;
|
|
13
|
+
/** Whether an API key is present (value never exposed). */
|
|
14
|
+
apiKeyPresent: boolean;
|
|
15
|
+
/** WHERE the API key came from: an env key NAME or an absolute file path. Never the value. */
|
|
16
|
+
apiKeySource: string | null;
|
|
17
|
+
/** Which tier of the credential chain supplied the key. */
|
|
18
|
+
apiKeyTier: InstructionsCredentialTier;
|
|
19
|
+
/** Diagnostic shape compatibility: a successful resolution is never misconfigured. */
|
|
20
|
+
misconfigured: boolean;
|
|
21
|
+
/** Human-readable warning, or null. Never contains secret values. */
|
|
22
|
+
warning: string | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* An environment as the client resolver reads it.
|
|
26
|
+
*/
|
|
27
|
+
export type InstructionsClientEnv = Record<string, string | undefined>;
|
|
28
|
+
/** The Keychain-tier controls (@hasna/contracts `KeychainTierOptions`). */
|
|
29
|
+
export interface InstructionsKeychainOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Whether the Keychain is consulted for a caller-built env object. Ambient
|
|
32
|
+
* for `process.env`; `true` turns the tier on for a caller-built env; `false`
|
|
33
|
+
* turns it off even for the live environment. Injecting `run` implies `true`.
|
|
34
|
+
*/
|
|
35
|
+
enabled?: boolean;
|
|
36
|
+
/** Defaults to `process.platform`; the tier exists only on `"darwin"`. */
|
|
37
|
+
platform?: string;
|
|
38
|
+
/** The machine's host name (`hostname -s`). Defaults to `os.hostname()`. */
|
|
39
|
+
hostname?: () => string;
|
|
40
|
+
/** The `security` runner. Defaults to spawning `/usr/bin/security` by argv. */
|
|
41
|
+
run?: (argv: readonly string[]) => {
|
|
42
|
+
status: number | null;
|
|
43
|
+
stdout: string;
|
|
44
|
+
stderr: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** Tier-1 credential inputs and Keychain-tier controls (@hasna/contracts `CredentialChainOptions`). */
|
|
48
|
+
export interface InstructionsCredentialChainOptions {
|
|
49
|
+
/** Tier 1: an explicit key, e.g. from `--api-key`. */
|
|
50
|
+
apiKey?: string;
|
|
51
|
+
/** Tier 1: an explicit profile name, e.g. from `--profile`. Beats `HASNA_PROFILE`. */
|
|
52
|
+
profile?: string;
|
|
53
|
+
/** Tier 3: Keychain controls — a fake `security` runner in tests, an opt-out on CI. */
|
|
54
|
+
keychain?: InstructionsKeychainOptions;
|
|
55
|
+
}
|
|
56
|
+
/** Query params (@hasna/contracts `QueryParams`). */
|
|
57
|
+
export type InstructionsQueryParams = URLSearchParams | Record<string, string | number | boolean | null | undefined | ReadonlyArray<string | number | boolean>>;
|
|
58
|
+
/** Retry policy for transient failures (@hasna/contracts `HasnaRetryOptions`). */
|
|
59
|
+
export interface InstructionsRetryOptions {
|
|
60
|
+
/** Max RETRY attempts after the first try. Default 2 (=> up to 3 total tries). */
|
|
61
|
+
retries?: number;
|
|
62
|
+
/** Base backoff in ms for exponential backoff. Default 200. */
|
|
63
|
+
baseDelayMs?: number;
|
|
64
|
+
/** Backoff ceiling in ms. Default 2000. */
|
|
65
|
+
maxDelayMs?: number;
|
|
66
|
+
/** HTTP statuses that trigger a retry. Default 408, 425, 429, 500, 502, 503, 504. */
|
|
67
|
+
retryStatuses?: number[];
|
|
68
|
+
}
|
|
69
|
+
/** Per-request transport options the store forwards (@hasna/contracts `HasnaRequestOptions`). */
|
|
70
|
+
export interface InstructionsRequestOptions {
|
|
71
|
+
/** Query string params appended to the URL. */
|
|
72
|
+
query?: InstructionsQueryParams;
|
|
73
|
+
/** Idempotency key sent as `Idempotency-Key` (retry-safe POST). */
|
|
74
|
+
idempotencyKey?: string;
|
|
75
|
+
/** Override the transport timeout for this call (ms). */
|
|
76
|
+
timeoutMs?: number;
|
|
77
|
+
/** Extra headers merged into this call. */
|
|
78
|
+
headers?: Record<string, string>;
|
|
79
|
+
/** Override or disable retry. `false` disables retries. */
|
|
80
|
+
retry?: InstructionsRetryOptions | false;
|
|
81
|
+
/** Caller abort signal, combined with the internal timeout. */
|
|
82
|
+
signal?: AbortSignal;
|
|
83
|
+
}
|
|
84
|
+
/** The authenticated HTTP transport surface the store dials (@hasna/contracts `HasnaHttpTransport`). */
|
|
85
|
+
export interface InstructionsStorageTransport {
|
|
86
|
+
readonly baseUrl: string;
|
|
87
|
+
request<T = unknown>(method: string, path: string, body?: unknown, opts?: InstructionsRequestOptions): Promise<T>;
|
|
88
|
+
get<T = unknown>(path: string, opts?: InstructionsRequestOptions): Promise<T>;
|
|
89
|
+
post<T = unknown>(path: string, body?: unknown, opts?: InstructionsRequestOptions): Promise<T>;
|
|
90
|
+
put<T = unknown>(path: string, body?: unknown, opts?: InstructionsRequestOptions): Promise<T>;
|
|
91
|
+
patch<T = unknown>(path: string, body?: unknown, opts?: InstructionsRequestOptions): Promise<T>;
|
|
92
|
+
del<T = unknown>(path: string, body?: unknown, opts?: InstructionsRequestOptions): Promise<T>;
|
|
93
|
+
}
|
|
94
|
+
/** Response of a storage list() call (@hasna/contracts `StorageListResult`). */
|
|
95
|
+
export interface InstructionsStorageListResult<T> {
|
|
96
|
+
items: T[];
|
|
97
|
+
/** Total count when the server reports one (`total`/`count`), else null. */
|
|
98
|
+
total: number | null;
|
|
99
|
+
/** Opaque pagination cursor when the server reports one, else null. */
|
|
100
|
+
cursor: string | null;
|
|
101
|
+
/** The full parsed response body (envelope preserved). */
|
|
102
|
+
raw: unknown;
|
|
103
|
+
}
|
|
104
|
+
/** The resolved storage client the store wraps (@hasna/contracts `HasnaStorageClient`). */
|
|
105
|
+
export interface InstructionsStorageClient {
|
|
106
|
+
/** App slug this client targets. */
|
|
107
|
+
readonly name: string;
|
|
108
|
+
/** `<origin>/v1` base URL. */
|
|
109
|
+
readonly baseUrl: string;
|
|
110
|
+
/** The underlying HTTP transport (escape hatch for non-CRUD routes). */
|
|
111
|
+
readonly transport: InstructionsStorageTransport;
|
|
112
|
+
/** List a collection. Returns extracted `items` plus the raw envelope. */
|
|
113
|
+
list<T = unknown>(resource: string, options?: InstructionsRequestOptions & {
|
|
114
|
+
query?: InstructionsQueryParams;
|
|
115
|
+
}): Promise<InstructionsStorageListResult<T>>;
|
|
116
|
+
/** Fetch one entity by id. Returns `null` on 404. */
|
|
117
|
+
get<T = unknown>(resource: string, id: string, options?: InstructionsRequestOptions): Promise<T | null>;
|
|
118
|
+
/** Create one entity. Retry-safe via an auto `Idempotency-Key`. */
|
|
119
|
+
create<T = unknown>(resource: string, body: unknown, options?: InstructionsRequestOptions & {
|
|
120
|
+
idempotencyKey?: string;
|
|
121
|
+
}): Promise<T>;
|
|
122
|
+
/** Update one entity by id (PATCH by default). */
|
|
123
|
+
update<T = unknown>(resource: string, id: string, patch: unknown, options?: InstructionsRequestOptions & {
|
|
124
|
+
method?: "PATCH" | "PUT";
|
|
125
|
+
idempotencyKey?: string;
|
|
126
|
+
}): Promise<T>;
|
|
127
|
+
/** Delete one entity by id. Resolves for 2xx and 404 (already gone). */
|
|
128
|
+
delete(resource: string, id: string, options?: InstructionsRequestOptions): Promise<void>;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=client-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-types.d.ts","sourceRoot":"","sources":["../../src/lib/client-types.ts"],"names":[],"mappings":"AAwBA,6FAA6F;AAC7F,MAAM,MAAM,0BAA0B,GAClC,UAAU,GACV,UAAU,GACV,SAAS,GACT,SAAS,GACT,UAAU,GACV,MAAM,GACN,KAAK,CAAC;AAEV,gIAAgI;AAChI,MAAM,WAAW,qCAAqC;IACpD,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,wGAAwG;IACxG,eAAe,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,uGAAuG;IACvG,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2DAA2D;IAC3D,aAAa,EAAE,OAAO,CAAC;IACvB,8FAA8F;IAC9F,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2DAA2D;IAC3D,UAAU,EAAE,0BAA0B,CAAC;IACvC,sFAAsF;IACtF,aAAa,EAAE,OAAO,CAAC;IACvB,qEAAqE;IACrE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEvE,2EAA2E;AAC3E,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;IACxB,+EAA+E;IAC/E,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK;QAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,C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@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-types.test.d.ts","sourceRoot":"","sources":["../../src/lib/client-types.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { InstructionsClientEnv, InstructionsCredentialChainOptions } from "./client-types.js";
|
|
2
|
+
/** The deliberate unhosted opt-in. `INSTRUCTIONS_LOCAL` was never a name here. */
|
|
3
|
+
export declare const INSTRUCTIONS_LOCAL_OPT_IN_ENV_KEYS: readonly ["HASNA_INSTRUCTIONS_LOCAL"];
|
|
4
|
+
/** Local-mode notice text, asserted verbatim by the CLI-level tests. */
|
|
5
|
+
export declare function instructionsLocalModeNotice(): string;
|
|
6
|
+
/** True when the operator deliberately asked for the unhosted local store. */
|
|
7
|
+
export declare function isInstructionsLocalOptIn(env?: InstructionsClientEnv): boolean;
|
|
8
|
+
/** Every env name that can configure an Instructions authority or credential, resolver-derived. */
|
|
9
|
+
export declare function instructionsAuthorityEnvKeys(): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Does the ENVIRONMENT itself configure an Instructions authority or credential?
|
|
12
|
+
*
|
|
13
|
+
* Deliberately narrower than "does a credential resolve": answering it must not
|
|
14
|
+
* touch the Keychain or the filesystem, because doing so would defeat the
|
|
15
|
+
* isolation the opt-in short-circuit exists to provide. It reads the env
|
|
16
|
+
* dictionary and nothing else.
|
|
17
|
+
*
|
|
18
|
+
* A DECLARED-BUT-BLANK variable counts as absent HERE — a blank has always been
|
|
19
|
+
* this package's spelling for "not configured", and helpers in the wild blank
|
|
20
|
+
* rather than delete. It is NOT absent once we do go hosted: the resolver
|
|
21
|
+
* refuses a blank loudly rather than falling through to another identity, which
|
|
22
|
+
* is the behaviour that matters at that point.
|
|
23
|
+
*/
|
|
24
|
+
export declare function hasInstructionsEnvAuthorityIntent(env?: InstructionsClientEnv): boolean;
|
|
25
|
+
/** True when this environment should be served by the on-box SQLite store. */
|
|
26
|
+
export declare function selectsInstructionsLocalStore(env?: InstructionsClientEnv): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The environment as the resolver should see it: every authority/credential
|
|
29
|
+
* variable that is DECLARED BUT BLANK removed.
|
|
30
|
+
*
|
|
31
|
+
* A blank has always been this package's spelling for "not configured" — it is
|
|
32
|
+
* how fixtures scrub an inherited environment. @hasna/contracts takes the
|
|
33
|
+
* opposite view: a declared-but-blank credential is a misconfiguration it
|
|
34
|
+
* refuses loudly rather than resolving around. Both are right at their own
|
|
35
|
+
* layer, and the mismatch is not hypothetical: an environment carrying a real
|
|
36
|
+
* `HASNA_INSTRUCTIONS_API_KEY` alongside a blank legacy alias is a complete,
|
|
37
|
+
* unambiguous configuration that would otherwise be refused for the alias
|
|
38
|
+
* nobody set. Normalising here keeps "blank means unset" true at the
|
|
39
|
+
* Instructions seam while leaving the resolver's stricter rule intact for
|
|
40
|
+
* everything it does receive.
|
|
41
|
+
*/
|
|
42
|
+
export declare function instructionsResolverEnv<T extends InstructionsClientEnv>(env: T): T;
|
|
43
|
+
/** The env object and credential options a surface hands @hasna/contracts. */
|
|
44
|
+
export interface InstructionsResolverInputs<T extends InstructionsClientEnv> {
|
|
45
|
+
/** The environment with every declared-but-blank authority variable removed. */
|
|
46
|
+
env: T;
|
|
47
|
+
/** The chain options, with the Keychain tier's ambient gate already decided. */
|
|
48
|
+
credentials: InstructionsCredentialChainOptions;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Build the resolver's inputs: the normalised environment AND the credential
|
|
52
|
+
* options that keep the machine's Keychain tier reachable across it.
|
|
53
|
+
*
|
|
54
|
+
* WHY THIS IS NOT JUST {@link instructionsResolverEnv}. Blanking a variable and
|
|
55
|
+
* deleting it are not the same operation to @hasna/contracts, because dropping
|
|
56
|
+
* a key forces us to hand the resolver a COPY, and the resolver gates its
|
|
57
|
+
* ambient tiers on OBJECT IDENTITY (`env === process.env`, or the registry
|
|
58
|
+
* symbol its own snapshot carries). A copy is, by that test, a caller-built
|
|
59
|
+
* world — the hermetic seam — so the Keychain is outside it and tier 3 turns
|
|
60
|
+
* itself off. Silently: there is no error, no warning and no diagnostic,
|
|
61
|
+
* because from the resolver's side nothing went wrong (hasna/apps#1788).
|
|
62
|
+
*
|
|
63
|
+
* The consequence is the one failure this whole ruling exists to prevent. On a
|
|
64
|
+
* station whose Keychain holds `hasna.credentials.instructions.api-key`, ONE
|
|
65
|
+
* declared-but-blank authority variable — any name in
|
|
66
|
+
* {@link instructionsAuthorityEnvKeys}, canonical or legacy; the shape a
|
|
67
|
+
* scrubbed fixture leaves behind — dropped the run from the Keychain identity
|
|
68
|
+
* to whatever came next: to `~/.hasna/instructions/config/credentials`, a
|
|
69
|
+
* DIFFERENT principal, with no notice; or, with nothing on disk, to a bare
|
|
70
|
+
* fail-closed error on a station that is in fact configured. A deliberate tier
|
|
71
|
+
* must never fall through to another identity, so the gate is decided HERE, on
|
|
72
|
+
* the original env, and carried across the copy as the documented
|
|
73
|
+
* `keychain.enabled` control rather than being left to an identity test the
|
|
74
|
+
* copy cannot pass.
|
|
75
|
+
*
|
|
76
|
+
* An explicit `enabled` from the caller still wins, and an injected `run`
|
|
77
|
+
* (which @hasna/contracts already treats as "enabled") is left alone, so the
|
|
78
|
+
* hermetic seam tests rely on is untouched. When there is no blank to remove
|
|
79
|
+
* the inputs pass through by identity, exactly as before.
|
|
80
|
+
*/
|
|
81
|
+
export declare function instructionsResolverInputs<T extends InstructionsClientEnv>(env: T, credentials?: InstructionsCredentialChainOptions): InstructionsResolverInputs<T>;
|
|
82
|
+
//# sourceMappingURL=local-opt-in.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-opt-in.d.ts","sourceRoot":"","sources":["../../src/lib/local-opt-in.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,qBAAqB,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAC;AAEnG,kFAAkF;AAClF,eAAO,MAAM,kCAAkC,uCAAwC,CAAC;AAExF,wEAAwE;AACxE,wBAAgB,2BAA2B,IAAI,MAAM,CAMpD;AAED,8EAA8E;AAC9E,wBAAgB,wBAAwB,CAAC,GAAG,GAAE,qBAAmC,GAAG,OAAO,CAI1F;AAED,mGAAmG;AACnG,wBAAgB,4BAA4B,IAAI,MAAM,EAAE,CASvD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iCAAiC,CAAC,GAAG,GAAE,qBAAmC,GAAG,OAAO,CAEnG;AAED,8EAA8E;AAC9E,wBAAgB,6BAA6B,CAAC,GAAG,GAAE,qBAAmC,GAAG,OAAO,CAE/F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,qBAAqB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAQlF;AAiBD,8EAA8E;AAC9E,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,qBAAqB;IACzE,gFAAgF;IAChF,GAAG,EAAE,CAAC,CAAC;IACP,gFAAgF;IAChF,WAAW,EAAE,kCAAkC,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,qBAAqB,EACxE,GAAG,EAAE,CAAC,EACN,WAAW,GAAE,kCAAuC,GACnD,0BAA0B,CAAC,CAAC,CAAC,CAS/B"}
|
|
@@ -8,10 +8,10 @@ export declare const PROJECT_CONTEXT_MAX_APPROX_TOKENS = 1000;
|
|
|
8
8
|
export declare const PROJECT_CONTEXT_MAX_COMMANDS = 6;
|
|
9
9
|
export declare const PROJECT_CONTEXT_MAX_WARNINGS = 3;
|
|
10
10
|
export declare const PROJECT_CONTEXT_FRAGMENT_PATH = ".hasna/instructions/project-context.md";
|
|
11
|
-
export declare const PROJECT_CONTEXT_MANIFEST_PATH = ".hasna/project-context-manifest.json";
|
|
12
|
-
export declare const PROJECT_CONTEXT_CACHE_PATH = ".hasna/project-context-cache.json";
|
|
13
|
-
export declare const PROJECT_CONTEXT_LOCK_PATH = ".hasna/project-context.lock";
|
|
14
|
-
export declare const PROJECT_CONTEXT_SNAPSHOT_DIR = ".hasna/project-context-snapshots";
|
|
11
|
+
export declare const PROJECT_CONTEXT_MANIFEST_PATH = ".hasna/projects/project-context-manifest.json";
|
|
12
|
+
export declare const PROJECT_CONTEXT_CACHE_PATH = ".hasna/projects/project-context-cache.json";
|
|
13
|
+
export declare const PROJECT_CONTEXT_LOCK_PATH = ".hasna/projects/project-context.lock";
|
|
14
|
+
export declare const PROJECT_CONTEXT_SNAPSHOT_DIR = ".hasna/projects/project-context-snapshots";
|
|
15
15
|
export declare const PROJECT_CONTEXT_CACHE_SCHEMA: "hasna.instructions.project-context-cache/v1";
|
|
16
16
|
export declare const PROJECT_CONTEXT_MANAGED_COMMENT = "Managed by @hasna/configs project context";
|
|
17
17
|
export declare const FOREIGN_INPUT_MAX_BYTES: number;
|
|
@@ -105,7 +105,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
105
105
|
jurisdiction: string;
|
|
106
106
|
legal_entities: string[];
|
|
107
107
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
108
|
-
data_classification: "
|
|
108
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
109
109
|
retention_policy: string;
|
|
110
110
|
ledger_authority: string;
|
|
111
111
|
evidence_store: string;
|
|
@@ -117,7 +117,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
117
117
|
jurisdiction: string;
|
|
118
118
|
legal_entities: string[];
|
|
119
119
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
120
|
-
data_classification: "
|
|
120
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
121
121
|
retention_policy: string;
|
|
122
122
|
ledger_authority: string;
|
|
123
123
|
evidence_store: string;
|
|
@@ -129,7 +129,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
129
129
|
jurisdiction: string;
|
|
130
130
|
legal_entities: string[];
|
|
131
131
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
132
|
-
data_classification: "
|
|
132
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
133
133
|
retention_policy: string;
|
|
134
134
|
ledger_authority: string;
|
|
135
135
|
evidence_store: string;
|
|
@@ -141,7 +141,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
141
141
|
jurisdiction: string;
|
|
142
142
|
legal_entities: string[];
|
|
143
143
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
144
|
-
data_classification: "
|
|
144
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
145
145
|
retention_policy: string;
|
|
146
146
|
ledger_authority: string;
|
|
147
147
|
evidence_store: string;
|
|
@@ -162,7 +162,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
162
162
|
jurisdiction: string;
|
|
163
163
|
legal_entities: string[];
|
|
164
164
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
165
|
-
data_classification: "
|
|
165
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
166
166
|
retention_policy: string;
|
|
167
167
|
ledger_authority: string;
|
|
168
168
|
evidence_store: string;
|
|
@@ -183,7 +183,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
183
183
|
jurisdiction: string;
|
|
184
184
|
legal_entities: string[];
|
|
185
185
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
186
|
-
data_classification: "
|
|
186
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
187
187
|
retention_policy: string;
|
|
188
188
|
ledger_authority: string;
|
|
189
189
|
evidence_store: string;
|
|
@@ -294,7 +294,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
294
294
|
jurisdiction: string;
|
|
295
295
|
legal_entities: string[];
|
|
296
296
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
297
|
-
data_classification: "
|
|
297
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
298
298
|
retention_policy: string;
|
|
299
299
|
ledger_authority: string;
|
|
300
300
|
evidence_store: string;
|
|
@@ -357,7 +357,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
357
357
|
jurisdiction: string;
|
|
358
358
|
legal_entities: string[];
|
|
359
359
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
360
|
-
data_classification: "
|
|
360
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
361
361
|
retention_policy: string;
|
|
362
362
|
ledger_authority: string;
|
|
363
363
|
evidence_store: string;
|
|
@@ -420,7 +420,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
420
420
|
jurisdiction: string;
|
|
421
421
|
legal_entities: string[];
|
|
422
422
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
423
|
-
data_classification: "
|
|
423
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
424
424
|
retention_policy: string;
|
|
425
425
|
ledger_authority: string;
|
|
426
426
|
evidence_store: string;
|
|
@@ -483,7 +483,7 @@ declare const projectContextBundleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
483
483
|
jurisdiction: string;
|
|
484
484
|
legal_entities: string[];
|
|
485
485
|
fiscal_cycle: "monthly" | "quarterly" | "annual" | "event-driven";
|
|
486
|
-
data_classification: "
|
|
486
|
+
data_classification: "internal" | "public" | "confidential" | "restricted";
|
|
487
487
|
retention_policy: string;
|
|
488
488
|
ledger_authority: string;
|
|
489
489
|
evidence_store: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-context.d.ts","sourceRoot":"","sources":["../../src/lib/project-context.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,CAAC,EAAE,MAAM,K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wBAAgB,gCAAgC,IAAI;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAOA"}
|
|
@@ -2,6 +2,6 @@ import type { Config, ProfileVariables } from "../types/index.js";
|
|
|
2
2
|
import { type ConfigStore } from "../data/config-store.js";
|
|
3
3
|
export declare const PROJECT_DASHBOARD_STANDARD_SLUG = "agent-managed-project-dashboard-standard";
|
|
4
4
|
export declare const PROJECT_DASHBOARD_PROFILE_VARIABLES: ProfileVariables;
|
|
5
|
-
export declare const PROJECT_DASHBOARD_STANDARD_CONTENT = "# Agent-Managed Project Dashboard Standard\n\nThis standard applies to Hasna work projects under `Workspace/<division>/project/<slug>`.\nHumans do not work directly inside these folders; agents keep structure,\nevidence, tasks, knowledge, and dashboard output consistent.\n\n## Canonical Files\n\n-
|
|
5
|
+
export declare const PROJECT_DASHBOARD_STANDARD_CONTENT = "# Agent-Managed Project Dashboard Standard\n\nThis standard applies to Hasna work projects under `Workspace/<division>/project/<slug>`.\nHumans do not work directly inside these folders; agents keep structure,\nevidence, tasks, knowledge, and dashboard output consistent.\n\n## Canonical Files\n\nThere is exactly one project-layout convention: the canonical per-workspace\nstore `~/.hasna/projects/workspaces/<workspace_id>/`. Never create a project\nlayout directory inside the project folder itself.\n\n- Per-workspace store root: `~/.hasna/projects/workspaces/<workspace_id>/`\n- Dashboard render manifest: `~/.hasna/projects/workspaces/<workspace_id>/dashboard/render.json`\n- Latest snapshot: `~/.hasna/projects/workspaces/<workspace_id>/dashboard/snapshots/latest.snapshot.json`\n- Dashboard schema ids come from `@hasna/contracts`.\n- Project folders may contain private documents, but render JSON must contain\n only ids, counts, statuses, resource refs, evidence refs, and redacted\n summaries.\n\n## Viewer Commands\n\nUse the Projects-owned viewer. Do not invent a separate per-project app unless\n`open-projects` cannot express the surface.\n\n```bash\nprojects dashboard snapshot <project> --write --json\nprojects dashboard render <project> --json\nprojects dashboard validate <project> --json\nPROJECTS_DASHBOARD_TOKEN=<token> projects dashboard serve <project> --host 0.0.0.0 --port <port>\n```\n\nNon-loopback serving must use `--token`, `PROJECTS_DASHBOARD_TOKEN`, or an\nexplicit `--trust-network` choice. Never put the token in a URL, task\nevidence, render spec, or report.\n\n## Provider Panels\n\nProvider CLIs emit bounded `hasna.project_panel.v1` summaries:\n\n```bash\ntodos project-panel --project <project> --json --contract\nfiles project-panel --project <project> --json --contract\nmailery project-panel --project <project> --limit 20 --json --contract\nconversations project-panel --project <project> --limit 30 --json --contract\nknowledge project-panel --project <project> --scope project --limit 30 --json --contract\nmementos --json project-panel --project <project> --contract\nreports project-panel --project <project> --json --contract\n```\n\nProviders must degrade to unavailable/error panels instead of dumping raw\ncontent. Mailery is workspace-scoped until explicit project-email mapping is\nconfigured; Knowledge must run from the project cwd or with the correct store\ncontext.\n\n## Coordination\n\n- Project conversation channels use the normalized project slug in the CLI and\n are displayed to humans as `#<project-slug>`.\n- Todos tasks are the source of truth for work; messages are only coordination.\n- Durable Codewith goal plans should own long-running implementation.\n- New implementation/verification work should route through task-triggered fresh\n agent runs, not by opening or pasting into existing tmux panes.\n- Agent handoff should reference task ids, project ids, commit ids, evidence\n paths, and dashboard URLs without exposing secrets or raw private documents.\n\n## Report Rules\n\nReports and dashboards should use JSON Render/React Flow through\n`projects dashboard render`. Include decisions, open questions, bank/document\nids, tasks, and evidence refs. Exclude raw email bodies, account numbers, tax\nids, passport numbers, credentials, and contract clauses unless an explicit\napproved storage policy exists.\n";
|
|
6
6
|
export declare function ensureProjectDashboardStandardConfig(store?: ConfigStore): Promise<Config>;
|
|
7
7
|
//# sourceMappingURL=project-dashboard-standard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-dashboard-standard.d.ts","sourceRoot":"","sources":["../../src/lib/project-dashboard-standard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE/E,eAAO,MAAM,+BAA+B,6CAA6C,CAAC;AAE1F,eAAO,MAAM,mCAAmC,EAAE,
|
|
1
|
+
{"version":3,"file":"project-dashboard-standard.d.ts","sourceRoot":"","sources":["../../src/lib/project-dashboard-standard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE/E,eAAO,MAAM,+BAA+B,6CAA6C,CAAC;AAE1F,eAAO,MAAM,mCAAmC,EAAE,gBAEjD,CAAC;AAEF,eAAO,MAAM,kCAAkC,q0GAyE9C,CAAC;AAEF,wBAAsB,oCAAoC,CAAC,KAAK,GAAE,WAAkC,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BrH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-apply.d.ts","sourceRoot":"","sources":["../../src/lib/session-apply.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session-apply.d.ts","sourceRoot":"","sources":["../../src/lib/session-apply.ts"],"names":[],"mappings":"AAqBA,OAAO,EAIL,KAAK,qBAAqB,EAE1B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAE3F,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,qBAAqB,CAAC;IAC5B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO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;CACnC;AAyCD,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CAMpB;AA6KD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAoDpG;AAED,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CA2CtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-render-state-hermeticity.test.d.ts","sourceRoot":"","sources":["../../src/lib/session-render-state-hermeticity.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type PathKind = "config" | "data" | "state" | "cache";
|
|
2
|
+
export interface PathsResolverOptions {
|
|
3
|
+
app: string;
|
|
4
|
+
internal?: boolean;
|
|
5
|
+
platform?: string;
|
|
6
|
+
home?: string;
|
|
7
|
+
env?: Record<string, string | undefined>;
|
|
8
|
+
}
|
|
9
|
+
export declare function stateDir(options: PathsResolverOptions): string;
|
|
10
|
+
/** Pre-XDG default snapshot dir under a session target home. */
|
|
11
|
+
export declare function legacySnapshotDir(targetHome: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* The @hasna/paths-resolved instructions state dir (XDG layout). A state-kind
|
|
14
|
+
* override whose base does not exist falls back to the default HOME-based
|
|
15
|
+
* resolution rather than failing closed on a path that cannot be created.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolverSnapshotDir(env?: NodeJS.ProcessEnv): string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the resolver (XDG) state dir should be adopted as the snapshot dir.
|
|
20
|
+
* Adoption requires the state-kind override `HASNA_STATE_HOME` pointing at an
|
|
21
|
+
* existing base, or a store already physically migrated there (the resolved
|
|
22
|
+
* dir holds at least one snapshot file). An empty pre-created dir does NOT
|
|
23
|
+
* adopt — the legacy store must never become invisible merely because a
|
|
24
|
+
* directory exists — and an override whose base does not exist falls through
|
|
25
|
+
* to the default migration check instead of failing closed.
|
|
26
|
+
*/
|
|
27
|
+
export declare function adoptResolverSnapshotDir(resolved: string, env?: NodeJS.ProcessEnv): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The effective snapshot location for a target home: the directory snapshots
|
|
30
|
+
* are written to, the workspace root the atomic-write containment guards must
|
|
31
|
+
* anchor to, and whether the resolver (XDG) state dir was adopted. Resolved
|
|
32
|
+
* once per call so a write or restore never re-reads the state dir.
|
|
33
|
+
*/
|
|
34
|
+
export interface SessionRenderSnapshotLocation {
|
|
35
|
+
/** The directory pre-render snapshots are written to. */
|
|
36
|
+
dir: string;
|
|
37
|
+
/** The workspace root the atomic-write containment guards anchor to. */
|
|
38
|
+
workspaceRoot: string;
|
|
39
|
+
/** Whether the resolver (XDG) state dir was adopted. */
|
|
40
|
+
adopted: boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare function resolveSessionRenderSnapshotLocation(targetHome: string, env?: NodeJS.ProcessEnv): SessionRenderSnapshotLocation;
|
|
43
|
+
/**
|
|
44
|
+
* Effective session-render snapshot dir for a target home: the resolver
|
|
45
|
+
* instructions state dir once adopted (`HASNA_STATE_HOME` set with an existing
|
|
46
|
+
* base, or the store migrated there), otherwise the legacy per-target-home
|
|
47
|
+
* default.
|
|
48
|
+
*/
|
|
49
|
+
export declare function getSessionRenderSnapshotDir(targetHome: string, env?: NodeJS.ProcessEnv): string;
|
|
50
|
+
/**
|
|
51
|
+
* The workspace root the managed-file snapshot write must anchor to — the
|
|
52
|
+
* containing root so the atomic-write containment guards accept the path.
|
|
53
|
+
* Legacy: the target home (unchanged). Resolver: the state dir's parent
|
|
54
|
+
* (`~/.local/state/hasna`), which exists and contains the snapshot dir.
|
|
55
|
+
*/
|
|
56
|
+
export declare function sessionRenderSnapshotWorkspaceRoot(targetHome: string, env?: NodeJS.ProcessEnv): string;
|
|
57
|
+
//# sourceMappingURL=session-render-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-render-state.d.ts","sourceRoot":"","sources":["../../src/lib/session-render-state.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAS7D,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AA0DD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAE9D;AAkCD,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAUhF;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAOT;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC5C,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,MAAM,EAClB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,6BAA6B,CAO/B;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,MAAM,EAClB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAER"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-render-state.test.d.ts","sourceRoot":"","sources":["../../src/lib/session-render-state.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { InstructionsClientEnv, InstructionsClientTransportResolution, InstructionsCredentialChainOptions, InstructionsStorageClient } from "./client-types.js";
|
|
2
|
+
import { INSTRUCTIONS_LOCAL_OPT_IN_ENV_KEYS, instructionsLocalModeNotice, isInstructionsLocalOptIn } from "./local-opt-in.js";
|
|
3
|
+
/** The app slug: the Keychain service, the `~/.hasna/instructions` folder, the gateway path. */
|
|
4
|
+
export declare const INSTRUCTIONS_APP = "instructions";
|
|
5
|
+
/** The explicit opt-in env, for messages that have to name exactly one name. */
|
|
6
|
+
export declare const INSTRUCTIONS_LOCAL_OPT_IN_ENV: string;
|
|
7
|
+
export { INSTRUCTIONS_LOCAL_OPT_IN_ENV_KEYS, instructionsLocalModeNotice, isInstructionsLocalOptIn };
|
|
8
|
+
/** Injectable seam controls: tier-1 credential inputs and the Keychain runner tests use. */
|
|
9
|
+
export interface InstructionsResolverOptions {
|
|
10
|
+
credentials?: InstructionsCredentialChainOptions;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Re-throw a `@hasna/contracts` resolution failure as the Instructions app's
|
|
14
|
+
* own fail-closed diagnostic, preserving the resolver's message (which names
|
|
15
|
+
* every tier it consulted) behind the stable `REMOTE_API_*` code callers match
|
|
16
|
+
* on. Nothing here ever returns a client or a local store: every arm throws.
|
|
17
|
+
*/
|
|
18
|
+
export declare function rethrowInstructionsAuthorityFailure(error: unknown): never;
|
|
19
|
+
/**
|
|
20
|
+
* Resolve the client transport (authority + credential source) through the one
|
|
21
|
+
* shared resolver. Throws {@link rethrowInstructionsAuthorityFailure} on every
|
|
22
|
+
* refusal; never returns a transport without a credential.
|
|
23
|
+
*
|
|
24
|
+
* Fresh on every call: the CLI calls it per command, the MCP server per tool
|
|
25
|
+
* call, and the SDK per client construction — and the contracts transport
|
|
26
|
+
* additionally re-resolves the credential on every REQUEST.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveInstructionsClientTransport(env?: InstructionsClientEnv, options?: InstructionsResolverOptions): InstructionsClientTransportResolution;
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the authenticated `/v1` storage client through the one shared
|
|
31
|
+
* resolver. Missing or invalid configuration throws; there is no local-data
|
|
32
|
+
* return branch. Every request re-resolves the credential through the
|
|
33
|
+
* transport's binding provider, so a rotation heals a long-lived process
|
|
34
|
+
* without a rebuild.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveInstructionsStorageClient(env?: InstructionsClientEnv, options?: InstructionsResolverOptions): {
|
|
37
|
+
transport: "http";
|
|
38
|
+
client: InstructionsStorageClient;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Machine-readable transport report, for surfaces that report refusals as data
|
|
42
|
+
* (a status line, `whoami`) rather than as an exception.
|
|
43
|
+
*
|
|
44
|
+
* `local_fallback` is ALWAYS false: nothing in this app ever silently demotes
|
|
45
|
+
* a hosted configuration to the on-box store, and no local-fallback event
|
|
46
|
+
* exists.
|
|
47
|
+
*/
|
|
48
|
+
export interface InstructionsTransportStatus {
|
|
49
|
+
/** True when a configured transport is in effect (every non-opt-in run). */
|
|
50
|
+
selected: boolean;
|
|
51
|
+
ok: boolean;
|
|
52
|
+
transport: "http" | "local" | "invalid";
|
|
53
|
+
api_url_configured: boolean;
|
|
54
|
+
api_key_configured: boolean;
|
|
55
|
+
/** WHERE the authority came from: an env key NAME, a Keychain reference, a file PATH, or "default". */
|
|
56
|
+
api_url_source: string | null;
|
|
57
|
+
/** WHERE the credential came from: an env key NAME, a Keychain reference, or a file PATH. Never a value. */
|
|
58
|
+
api_key_source: string | null;
|
|
59
|
+
/** Which tier of the @hasna/contracts chain supplied the credential. */
|
|
60
|
+
api_key_tier: string | null;
|
|
61
|
+
v1_base_url: string | null;
|
|
62
|
+
issues: string[];
|
|
63
|
+
local_fallback: false;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Resolve the current transport and report it. Never throws: a refused
|
|
67
|
+
* configuration is reported as `ok: false` with the failure in `issues`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getInstructionsTransportStatus(env?: InstructionsClientEnv, options?: InstructionsResolverOptions): InstructionsTransportStatus;
|
|
70
|
+
/** Test seam: forget that the local-mode line was printed. */
|
|
71
|
+
export declare function __resetLocalInstructionsModeNotice(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Say — once per process, on stderr — that this run is using the on-box
|
|
74
|
+
* SQLite store. Local mode is legitimate (the explicit opt-in), but "no
|
|
75
|
+
* credential resolved" and "deliberately offline" look identical in the output
|
|
76
|
+
* otherwise, and the first one is usually a misconfiguration (owner rulings
|
|
77
|
+
* 2026-09-04).
|
|
78
|
+
*/
|
|
79
|
+
export declare function announceLocalInstructionsMode(write?: (line: string) => void): boolean;
|
|
80
|
+
//# sourceMappingURL=transport-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-resolver.d.ts","sourceRoot":"","sources":["../../src/lib/transport-resolver.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EACV,qBAAqB,EACrB,qCAAqC,EACrC,kCAAkC,EAClC,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kCAAkC,EAClC,2BAA2B,EAE3B,wBAAwB,EAEzB,MAAM,mBAAmB,CAAC;AAE3B,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,gFAAgF;AAChF,eAAO,MAAM,6BAA6B,EAA4C,MAAM,CAAC;AAE7F,OAAO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