@haven_ai/signer 0.6.0-alpha.0 → 0.8.0-alpha.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 +25 -10
- package/dist/cli.cjs +287 -30
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +288 -31
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +288 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -4
- package/dist/index.d.ts +46 -4
- package/dist/index.js +289 -32
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -258,6 +258,13 @@ interface SignerCompatibility {
|
|
|
258
258
|
* discipline as `direct_sign_context_versions`.
|
|
259
259
|
*/
|
|
260
260
|
task_sign_context_versions: number[];
|
|
261
|
+
/**
|
|
262
|
+
* #3506: `sub_budget_sign_context_version`s this signer will fetch and
|
|
263
|
+
* verify from `GET /sub-budgets/:id/sign-context` — derived from
|
|
264
|
+
* `SUPPORTED_SUB_BUDGET_SIGN_CONTEXT_VERSIONS`, never a second literal.
|
|
265
|
+
* Additive: 0.7.0 already signed sub-budgets but did not say so here.
|
|
266
|
+
*/
|
|
267
|
+
sub_budget_sign_context_versions: number[];
|
|
261
268
|
}
|
|
262
269
|
/** The supported sets this signer enforces, as a plain serialisable object. */
|
|
263
270
|
declare function signerCompatibility(): SignerCompatibility;
|
|
@@ -486,8 +493,36 @@ declare const SIGNER_HOSTED_HANDOFF_SHAPES: {
|
|
|
486
493
|
readonly haven_get_payment_status: {
|
|
487
494
|
readonly payment_id: z.ZodString;
|
|
488
495
|
};
|
|
496
|
+
readonly 'haven_submit#task_budget': {
|
|
497
|
+
readonly task_budget_id: z.ZodString;
|
|
498
|
+
readonly signature: z.ZodString;
|
|
499
|
+
};
|
|
500
|
+
readonly 'haven_submit#sub_budget': {
|
|
501
|
+
readonly sub_budget_id: z.ZodString;
|
|
502
|
+
readonly signature: z.ZodString;
|
|
503
|
+
};
|
|
489
504
|
};
|
|
490
505
|
|
|
506
|
+
/**
|
|
507
|
+
* The signer's wire identity. Declared HERE, in the tools/handlers module —
|
|
508
|
+
* `server.ts` (the MCP wiring) imports them from this module, keeping the
|
|
509
|
+
* import graph one-directional (tools.ts ← server.ts, never the reverse);
|
|
510
|
+
* `server.ts` re-exports them, so the package's public API is unchanged.
|
|
511
|
+
*/
|
|
512
|
+
declare const SIGNER_NAME = "@haven_ai/signer";
|
|
513
|
+
declare const SIGNER_VERSION = "0.8.0-alpha.0";
|
|
514
|
+
/**
|
|
515
|
+
* #3419: the marker the tool layer prefixes the undeclared-argument refusal
|
|
516
|
+
* with. The strict re-parse lives in THIS module (`parseStrictFor`, below) —
|
|
517
|
+
* the same module as the `normalizeError` branch that shapes the refusal — so
|
|
518
|
+
* the marker, the message and the structured fields are one unit and cannot
|
|
519
|
+
* drift. The registration in `server.ts` is passthrough (the issue's "schema
|
|
520
|
+
* that keeps unknown keys"): the SDK layer lets an undeclared key through and
|
|
521
|
+
* the tool layer refuses it here, where the full structured refusal
|
|
522
|
+
* (`UNSUPPORTED_ARGUMENT` with `unknown_arguments`, `signer_version`,
|
|
523
|
+
* `fallback`) is still expressible as JSON on the result.
|
|
524
|
+
*/
|
|
525
|
+
declare const UNSUPPORTED_ARGUMENT_MARKER = "HavenSignerUnsupportedArgument:";
|
|
491
526
|
/**
|
|
492
527
|
* Local signer tool set. These run on the agent's machine, next to the key,
|
|
493
528
|
* and pair with the hosted server's construct/relay tools (#183). They sign;
|
|
@@ -612,6 +647,7 @@ declare const toolSchemas: {
|
|
|
612
647
|
readonly typed_data: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
613
648
|
readonly typed_data_b64: z$1.ZodOptional<z$1.ZodString>;
|
|
614
649
|
readonly task_budget_id: z$1.ZodOptional<z$1.ZodString>;
|
|
650
|
+
readonly sub_budget_id: z$1.ZodOptional<z$1.ZodString>;
|
|
615
651
|
};
|
|
616
652
|
readonly haven_x402_sign_header: {
|
|
617
653
|
readonly payment_required: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
@@ -727,6 +763,14 @@ interface ToolFailure {
|
|
|
727
763
|
* field for every sign-context refusal (`'typed_data_b64'`).
|
|
728
764
|
*/
|
|
729
765
|
fallback?: string;
|
|
766
|
+
/**
|
|
767
|
+
* #3419: present on `UNSUPPORTED_ARGUMENT` — the undeclared top-level
|
|
768
|
+
* argument names the caller sent (the strict schema's `unrecognized_keys`),
|
|
769
|
+
* so an agent can see exactly what this signer does not accept.
|
|
770
|
+
*/
|
|
771
|
+
unknown_arguments?: string[];
|
|
772
|
+
/** #3419: present on `UNSUPPORTED_ARGUMENT` — this signer's own package version. */
|
|
773
|
+
signer_version?: string;
|
|
730
774
|
/**
|
|
731
775
|
* #3001: present on `SIGN_CONTEXT_REFUSED` — the HTTP status the backend
|
|
732
776
|
* answered the sign-context fetch with (404, 410, …) — the x402 fetch, or
|
|
@@ -735,7 +779,7 @@ interface ToolFailure {
|
|
|
735
779
|
http_status?: number;
|
|
736
780
|
/** #3001: the backend's own `error_code` on `SIGN_CONTEXT_REFUSED` (`expired`, `already_executed`, `not_signable`, `sign_context_unavailable`, and since #3303 `client_outdated`). */
|
|
737
781
|
backend_error_code?: string;
|
|
738
|
-
/** #3303: on `client_outdated`, the backend's update hint — `upgrade_command`
|
|
782
|
+
/** #3303: on `client_outdated`, the backend's update hint — `upgrade_command` starts the update (the doctor, then its repair line — #3412). */
|
|
739
783
|
client_update?: HavenClientUpdate;
|
|
740
784
|
}
|
|
741
785
|
type ToolPayload<T = unknown> = ToolSuccess<T> | ToolFailure;
|
|
@@ -783,8 +827,6 @@ declare function computeSignerConsentHash(input: SignerConsentInput): string;
|
|
|
783
827
|
declare function renderSignerConsentBlock(input: SignerConsentInput, hash: string): string;
|
|
784
828
|
declare function ensureSignerConsent(input: SignerConsentInput, options?: SignerConsentOptions): Promise<SignerConsentDecision>;
|
|
785
829
|
|
|
786
|
-
declare const SIGNER_NAME = "@haven_ai/signer";
|
|
787
|
-
declare const SIGNER_VERSION = "0.6.0-alpha.0";
|
|
788
830
|
interface SignerOptions {
|
|
789
831
|
/** Path to a Haven credential JSON file (delegate_key is read from it). */
|
|
790
832
|
credentialsPath?: string;
|
|
@@ -849,4 +891,4 @@ declare function assertSupportedNodeVersion(nodeVersion?: string): void;
|
|
|
849
891
|
declare function runSignerStdioServer(options?: SignerOptions): Promise<void>;
|
|
850
892
|
declare function runSignerConsentGate(signer: EdgeSigner, credentials: SignerCredentials | undefined, options: SignerOptions): Promise<SignerConsentDecision>;
|
|
851
893
|
|
|
852
|
-
export { AUDIT_ROTATE_BYTES, type AppendAuditOptions, type EdgeSigner, OWNER_ONLY_MODE, type PermissionLog, type PermissiveFile, type ResolvedSignerRuntime, SIGNER_ACK_ENV, SIGNER_CAPABILITY_KEY, SIGNER_HOSTED_HANDOFF_SHAPES, SIGNER_NAME, SIGNER_VERSION, SUPPORTED_SWEEP_BINDING_VERSIONS, SUPPORTED_X402_EXPECTED_VERSIONS, type SignerCompatibility, type SignerConsentDecision, type SignerConsentInput, type SignerConsentOptions, type SignerCredentials, type SignerOptions, type SignerToolName, type SigningAuditContext, type SigningAuditEntry, type TightenOutcome, type ToolFailure, type ToolPayload, type ToolSuccess, type X402ExpectedPayment, type X402FundingSignatureResult, type X402HeaderResult, appendSigningAuditEntry, assertSupportedBindingVersion, assertSupportedNodeVersion, assertX402MatchesExpected, buildSignerMcpServer, computeSignerConsentHash, createEdgeSigner, createSigningAuditEntry, createToolHandlers, defaultSigningAuditPath, ensureSignerConsent, hashPayloadForAudit, loadSignerCredentials, permissiveMode, readAccountAddressEnv, readAccountAddressField, renderSignerConsentBlock, resolveEdgeSigner, resolveSignerRuntime, runSignerConsentGate, runSignerStdioServer, signerCapabilityAdvertisement, signerCompatibility, signerInstructions, tightenIfFilePermissive, toolDescriptions, toolSchemas, warnIfCredentialFilePermissive, warnIfFilePermissive };
|
|
894
|
+
export { AUDIT_ROTATE_BYTES, type AppendAuditOptions, type EdgeSigner, OWNER_ONLY_MODE, type PermissionLog, type PermissiveFile, type ResolvedSignerRuntime, SIGNER_ACK_ENV, SIGNER_CAPABILITY_KEY, SIGNER_HOSTED_HANDOFF_SHAPES, SIGNER_NAME, SIGNER_VERSION, SUPPORTED_SWEEP_BINDING_VERSIONS, SUPPORTED_X402_EXPECTED_VERSIONS, type SignerCompatibility, type SignerConsentDecision, type SignerConsentInput, type SignerConsentOptions, type SignerCredentials, type SignerOptions, type SignerToolName, type SigningAuditContext, type SigningAuditEntry, type TightenOutcome, type ToolFailure, type ToolPayload, type ToolSuccess, UNSUPPORTED_ARGUMENT_MARKER, type X402ExpectedPayment, type X402FundingSignatureResult, type X402HeaderResult, appendSigningAuditEntry, assertSupportedBindingVersion, assertSupportedNodeVersion, assertX402MatchesExpected, buildSignerMcpServer, computeSignerConsentHash, createEdgeSigner, createSigningAuditEntry, createToolHandlers, defaultSigningAuditPath, ensureSignerConsent, hashPayloadForAudit, loadSignerCredentials, permissiveMode, readAccountAddressEnv, readAccountAddressField, renderSignerConsentBlock, resolveEdgeSigner, resolveSignerRuntime, runSignerConsentGate, runSignerStdioServer, signerCapabilityAdvertisement, signerCompatibility, signerInstructions, tightenIfFilePermissive, toolDescriptions, toolSchemas, warnIfCredentialFilePermissive, warnIfFilePermissive };
|
package/dist/index.d.ts
CHANGED
|
@@ -258,6 +258,13 @@ interface SignerCompatibility {
|
|
|
258
258
|
* discipline as `direct_sign_context_versions`.
|
|
259
259
|
*/
|
|
260
260
|
task_sign_context_versions: number[];
|
|
261
|
+
/**
|
|
262
|
+
* #3506: `sub_budget_sign_context_version`s this signer will fetch and
|
|
263
|
+
* verify from `GET /sub-budgets/:id/sign-context` — derived from
|
|
264
|
+
* `SUPPORTED_SUB_BUDGET_SIGN_CONTEXT_VERSIONS`, never a second literal.
|
|
265
|
+
* Additive: 0.7.0 already signed sub-budgets but did not say so here.
|
|
266
|
+
*/
|
|
267
|
+
sub_budget_sign_context_versions: number[];
|
|
261
268
|
}
|
|
262
269
|
/** The supported sets this signer enforces, as a plain serialisable object. */
|
|
263
270
|
declare function signerCompatibility(): SignerCompatibility;
|
|
@@ -486,8 +493,36 @@ declare const SIGNER_HOSTED_HANDOFF_SHAPES: {
|
|
|
486
493
|
readonly haven_get_payment_status: {
|
|
487
494
|
readonly payment_id: z.ZodString;
|
|
488
495
|
};
|
|
496
|
+
readonly 'haven_submit#task_budget': {
|
|
497
|
+
readonly task_budget_id: z.ZodString;
|
|
498
|
+
readonly signature: z.ZodString;
|
|
499
|
+
};
|
|
500
|
+
readonly 'haven_submit#sub_budget': {
|
|
501
|
+
readonly sub_budget_id: z.ZodString;
|
|
502
|
+
readonly signature: z.ZodString;
|
|
503
|
+
};
|
|
489
504
|
};
|
|
490
505
|
|
|
506
|
+
/**
|
|
507
|
+
* The signer's wire identity. Declared HERE, in the tools/handlers module —
|
|
508
|
+
* `server.ts` (the MCP wiring) imports them from this module, keeping the
|
|
509
|
+
* import graph one-directional (tools.ts ← server.ts, never the reverse);
|
|
510
|
+
* `server.ts` re-exports them, so the package's public API is unchanged.
|
|
511
|
+
*/
|
|
512
|
+
declare const SIGNER_NAME = "@haven_ai/signer";
|
|
513
|
+
declare const SIGNER_VERSION = "0.8.0-alpha.0";
|
|
514
|
+
/**
|
|
515
|
+
* #3419: the marker the tool layer prefixes the undeclared-argument refusal
|
|
516
|
+
* with. The strict re-parse lives in THIS module (`parseStrictFor`, below) —
|
|
517
|
+
* the same module as the `normalizeError` branch that shapes the refusal — so
|
|
518
|
+
* the marker, the message and the structured fields are one unit and cannot
|
|
519
|
+
* drift. The registration in `server.ts` is passthrough (the issue's "schema
|
|
520
|
+
* that keeps unknown keys"): the SDK layer lets an undeclared key through and
|
|
521
|
+
* the tool layer refuses it here, where the full structured refusal
|
|
522
|
+
* (`UNSUPPORTED_ARGUMENT` with `unknown_arguments`, `signer_version`,
|
|
523
|
+
* `fallback`) is still expressible as JSON on the result.
|
|
524
|
+
*/
|
|
525
|
+
declare const UNSUPPORTED_ARGUMENT_MARKER = "HavenSignerUnsupportedArgument:";
|
|
491
526
|
/**
|
|
492
527
|
* Local signer tool set. These run on the agent's machine, next to the key,
|
|
493
528
|
* and pair with the hosted server's construct/relay tools (#183). They sign;
|
|
@@ -612,6 +647,7 @@ declare const toolSchemas: {
|
|
|
612
647
|
readonly typed_data: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
613
648
|
readonly typed_data_b64: z$1.ZodOptional<z$1.ZodString>;
|
|
614
649
|
readonly task_budget_id: z$1.ZodOptional<z$1.ZodString>;
|
|
650
|
+
readonly sub_budget_id: z$1.ZodOptional<z$1.ZodString>;
|
|
615
651
|
};
|
|
616
652
|
readonly haven_x402_sign_header: {
|
|
617
653
|
readonly payment_required: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
@@ -727,6 +763,14 @@ interface ToolFailure {
|
|
|
727
763
|
* field for every sign-context refusal (`'typed_data_b64'`).
|
|
728
764
|
*/
|
|
729
765
|
fallback?: string;
|
|
766
|
+
/**
|
|
767
|
+
* #3419: present on `UNSUPPORTED_ARGUMENT` — the undeclared top-level
|
|
768
|
+
* argument names the caller sent (the strict schema's `unrecognized_keys`),
|
|
769
|
+
* so an agent can see exactly what this signer does not accept.
|
|
770
|
+
*/
|
|
771
|
+
unknown_arguments?: string[];
|
|
772
|
+
/** #3419: present on `UNSUPPORTED_ARGUMENT` — this signer's own package version. */
|
|
773
|
+
signer_version?: string;
|
|
730
774
|
/**
|
|
731
775
|
* #3001: present on `SIGN_CONTEXT_REFUSED` — the HTTP status the backend
|
|
732
776
|
* answered the sign-context fetch with (404, 410, …) — the x402 fetch, or
|
|
@@ -735,7 +779,7 @@ interface ToolFailure {
|
|
|
735
779
|
http_status?: number;
|
|
736
780
|
/** #3001: the backend's own `error_code` on `SIGN_CONTEXT_REFUSED` (`expired`, `already_executed`, `not_signable`, `sign_context_unavailable`, and since #3303 `client_outdated`). */
|
|
737
781
|
backend_error_code?: string;
|
|
738
|
-
/** #3303: on `client_outdated`, the backend's update hint — `upgrade_command`
|
|
782
|
+
/** #3303: on `client_outdated`, the backend's update hint — `upgrade_command` starts the update (the doctor, then its repair line — #3412). */
|
|
739
783
|
client_update?: HavenClientUpdate;
|
|
740
784
|
}
|
|
741
785
|
type ToolPayload<T = unknown> = ToolSuccess<T> | ToolFailure;
|
|
@@ -783,8 +827,6 @@ declare function computeSignerConsentHash(input: SignerConsentInput): string;
|
|
|
783
827
|
declare function renderSignerConsentBlock(input: SignerConsentInput, hash: string): string;
|
|
784
828
|
declare function ensureSignerConsent(input: SignerConsentInput, options?: SignerConsentOptions): Promise<SignerConsentDecision>;
|
|
785
829
|
|
|
786
|
-
declare const SIGNER_NAME = "@haven_ai/signer";
|
|
787
|
-
declare const SIGNER_VERSION = "0.6.0-alpha.0";
|
|
788
830
|
interface SignerOptions {
|
|
789
831
|
/** Path to a Haven credential JSON file (delegate_key is read from it). */
|
|
790
832
|
credentialsPath?: string;
|
|
@@ -849,4 +891,4 @@ declare function assertSupportedNodeVersion(nodeVersion?: string): void;
|
|
|
849
891
|
declare function runSignerStdioServer(options?: SignerOptions): Promise<void>;
|
|
850
892
|
declare function runSignerConsentGate(signer: EdgeSigner, credentials: SignerCredentials | undefined, options: SignerOptions): Promise<SignerConsentDecision>;
|
|
851
893
|
|
|
852
|
-
export { AUDIT_ROTATE_BYTES, type AppendAuditOptions, type EdgeSigner, OWNER_ONLY_MODE, type PermissionLog, type PermissiveFile, type ResolvedSignerRuntime, SIGNER_ACK_ENV, SIGNER_CAPABILITY_KEY, SIGNER_HOSTED_HANDOFF_SHAPES, SIGNER_NAME, SIGNER_VERSION, SUPPORTED_SWEEP_BINDING_VERSIONS, SUPPORTED_X402_EXPECTED_VERSIONS, type SignerCompatibility, type SignerConsentDecision, type SignerConsentInput, type SignerConsentOptions, type SignerCredentials, type SignerOptions, type SignerToolName, type SigningAuditContext, type SigningAuditEntry, type TightenOutcome, type ToolFailure, type ToolPayload, type ToolSuccess, type X402ExpectedPayment, type X402FundingSignatureResult, type X402HeaderResult, appendSigningAuditEntry, assertSupportedBindingVersion, assertSupportedNodeVersion, assertX402MatchesExpected, buildSignerMcpServer, computeSignerConsentHash, createEdgeSigner, createSigningAuditEntry, createToolHandlers, defaultSigningAuditPath, ensureSignerConsent, hashPayloadForAudit, loadSignerCredentials, permissiveMode, readAccountAddressEnv, readAccountAddressField, renderSignerConsentBlock, resolveEdgeSigner, resolveSignerRuntime, runSignerConsentGate, runSignerStdioServer, signerCapabilityAdvertisement, signerCompatibility, signerInstructions, tightenIfFilePermissive, toolDescriptions, toolSchemas, warnIfCredentialFilePermissive, warnIfFilePermissive };
|
|
894
|
+
export { AUDIT_ROTATE_BYTES, type AppendAuditOptions, type EdgeSigner, OWNER_ONLY_MODE, type PermissionLog, type PermissiveFile, type ResolvedSignerRuntime, SIGNER_ACK_ENV, SIGNER_CAPABILITY_KEY, SIGNER_HOSTED_HANDOFF_SHAPES, SIGNER_NAME, SIGNER_VERSION, SUPPORTED_SWEEP_BINDING_VERSIONS, SUPPORTED_X402_EXPECTED_VERSIONS, type SignerCompatibility, type SignerConsentDecision, type SignerConsentInput, type SignerConsentOptions, type SignerCredentials, type SignerOptions, type SignerToolName, type SigningAuditContext, type SigningAuditEntry, type TightenOutcome, type ToolFailure, type ToolPayload, type ToolSuccess, UNSUPPORTED_ARGUMENT_MARKER, type X402ExpectedPayment, type X402FundingSignatureResult, type X402HeaderResult, appendSigningAuditEntry, assertSupportedBindingVersion, assertSupportedNodeVersion, assertX402MatchesExpected, buildSignerMcpServer, computeSignerConsentHash, createEdgeSigner, createSigningAuditEntry, createToolHandlers, defaultSigningAuditPath, ensureSignerConsent, hashPayloadForAudit, loadSignerCredentials, permissiveMode, readAccountAddressEnv, readAccountAddressField, renderSignerConsentBlock, resolveEdgeSigner, resolveSignerRuntime, runSignerConsentGate, runSignerStdioServer, signerCapabilityAdvertisement, signerCompatibility, signerInstructions, tightenIfFilePermissive, toolDescriptions, toolSchemas, warnIfCredentialFilePermissive, warnIfFilePermissive };
|