@getcliqio/cliq-sdk 0.0.0-stage → 1.15.32
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 +28 -2
- package/dist/agent_api.d.ts +39 -0
- package/dist/agent_api.d.ts.map +1 -0
- package/dist/agent_api.js +105 -0
- package/dist/agent_api.js.map +1 -0
- package/dist/agent_manifest.d.ts +162 -0
- package/dist/agent_manifest.d.ts.map +1 -0
- package/dist/agent_manifest.js +242 -0
- package/dist/agent_manifest.js.map +1 -0
- package/dist/agent_payloads.d.ts +103 -0
- package/dist/agent_payloads.d.ts.map +1 -0
- package/dist/agent_payloads.js +56 -0
- package/dist/agent_payloads.js.map +1 -0
- package/dist/agents/base_agent.d.ts +113 -0
- package/dist/agents/base_agent.d.ts.map +1 -0
- package/dist/agents/base_agent.js +413 -0
- package/dist/agents/base_agent.js.map +1 -0
- package/dist/agents/cli_agent.d.ts +98 -0
- package/dist/agents/cli_agent.d.ts.map +1 -0
- package/dist/agents/cli_agent.js +303 -0
- package/dist/agents/cli_agent.js.map +1 -0
- package/dist/agents/cli_rehydrate.d.ts +29 -0
- package/dist/agents/cli_rehydrate.d.ts.map +1 -0
- package/dist/agents/cli_rehydrate.js +32 -0
- package/dist/agents/cli_rehydrate.js.map +1 -0
- package/dist/agents/connector_agent.d.ts +20 -0
- package/dist/agents/connector_agent.d.ts.map +1 -0
- package/dist/agents/connector_agent.js +110 -0
- package/dist/agents/connector_agent.js.map +1 -0
- package/dist/agents/event_artifacts.d.ts +33 -0
- package/dist/agents/event_artifacts.d.ts.map +1 -0
- package/dist/agents/event_artifacts.js +73 -0
- package/dist/agents/event_artifacts.js.map +1 -0
- package/dist/agents/gate_agent.d.ts +40 -0
- package/dist/agents/gate_agent.d.ts.map +1 -0
- package/dist/agents/gate_agent.js +121 -0
- package/dist/agents/gate_agent.js.map +1 -0
- package/dist/agents/index.d.ts +32 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +26 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/llm_agent.d.ts +109 -0
- package/dist/agents/llm_agent.d.ts.map +1 -0
- package/dist/agents/llm_agent.js +285 -0
- package/dist/agents/llm_agent.js.map +1 -0
- package/dist/agents/llm_contract.d.ts +7 -0
- package/dist/agents/llm_contract.d.ts.map +1 -0
- package/dist/agents/llm_contract.js +7 -0
- package/dist/agents/llm_contract.js.map +1 -0
- package/dist/agents/standard_agent.d.ts +15 -0
- package/dist/agents/standard_agent.d.ts.map +1 -0
- package/dist/agents/standard_agent.js +34 -0
- package/dist/agents/standard_agent.js.map +1 -0
- package/dist/agents/turn_result.d.ts +67 -0
- package/dist/agents/turn_result.d.ts.map +1 -0
- package/dist/agents/turn_result.js +81 -0
- package/dist/agents/turn_result.js.map +1 -0
- package/dist/agents/types.d.ts +314 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +20 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/builtin_teams/hello_hug.d.ts +9 -0
- package/dist/builtin_teams/hello_hug.d.ts.map +1 -0
- package/dist/builtin_teams/hello_hug.js +68 -0
- package/dist/builtin_teams/hello_hug.js.map +1 -0
- package/dist/builtin_teams/hello_world.d.ts +8 -0
- package/dist/builtin_teams/hello_world.d.ts.map +1 -0
- package/dist/builtin_teams/hello_world.js +65 -0
- package/dist/builtin_teams/hello_world.js.map +1 -0
- package/dist/builtin_teams/hug_example.d.ts +10 -0
- package/dist/builtin_teams/hug_example.d.ts.map +1 -0
- package/dist/builtin_teams/hug_example.js +94 -0
- package/dist/builtin_teams/hug_example.js.map +1 -0
- package/dist/builtin_teams/index.d.ts +12 -0
- package/dist/builtin_teams/index.d.ts.map +1 -0
- package/dist/builtin_teams/index.js +18 -0
- package/dist/builtin_teams/index.js.map +1 -0
- package/dist/builtin_teams/types.d.ts +29 -0
- package/dist/builtin_teams/types.d.ts.map +1 -0
- package/dist/builtin_teams/types.js +3 -0
- package/dist/builtin_teams/types.js.map +1 -0
- package/dist/core_api_client.d.ts +48 -0
- package/dist/core_api_client.d.ts.map +1 -0
- package/dist/core_api_client.js +132 -0
- package/dist/core_api_client.js.map +1 -0
- package/dist/daemon_wire.d.ts +122 -0
- package/dist/daemon_wire.d.ts.map +1 -0
- package/dist/daemon_wire.js +105 -0
- package/dist/daemon_wire.js.map +1 -0
- package/dist/events/catalog.d.ts +40 -0
- package/dist/events/catalog.d.ts.map +1 -0
- package/dist/events/catalog.js +76 -0
- package/dist/events/catalog.js.map +1 -0
- package/dist/http_daemon_client.d.ts +136 -0
- package/dist/http_daemon_client.d.ts.map +1 -0
- package/dist/http_daemon_client.js +192 -0
- package/dist/http_daemon_client.js.map +1 -0
- package/dist/hug/ask.d.ts +160 -0
- package/dist/hug/ask.d.ts.map +1 -0
- package/dist/hug/ask.js +318 -0
- package/dist/hug/ask.js.map +1 -0
- package/dist/hug/attach.d.ts +60 -0
- package/dist/hug/attach.d.ts.map +1 -0
- package/dist/hug/attach.js +103 -0
- package/dist/hug/attach.js.map +1 -0
- package/dist/hug/bridge/index.d.ts +16 -0
- package/dist/hug/bridge/index.d.ts.map +1 -0
- package/dist/hug/bridge/index.js +13 -0
- package/dist/hug/bridge/index.js.map +1 -0
- package/dist/hug/bridge/messages.d.ts +559 -0
- package/dist/hug/bridge/messages.d.ts.map +1 -0
- package/dist/hug/bridge/messages.js +165 -0
- package/dist/hug/bridge/messages.js.map +1 -0
- package/dist/hug/client.d.ts +70 -0
- package/dist/hug/client.d.ts.map +1 -0
- package/dist/hug/client.js +144 -0
- package/dist/hug/client.js.map +1 -0
- package/dist/hug/context.d.ts +54 -0
- package/dist/hug/context.d.ts.map +1 -0
- package/dist/hug/context.js +27 -0
- package/dist/hug/context.js.map +1 -0
- package/dist/hug/define.d.ts +116 -0
- package/dist/hug/define.d.ts.map +1 -0
- package/dist/hug/define.js +119 -0
- package/dist/hug/define.js.map +1 -0
- package/dist/hug/definitions/approval.d.ts +216 -0
- package/dist/hug/definitions/approval.d.ts.map +1 -0
- package/dist/hug/definitions/approval.js +50 -0
- package/dist/hug/definitions/approval.js.map +1 -0
- package/dist/hug/definitions/common.d.ts +122 -0
- package/dist/hug/definitions/common.d.ts.map +1 -0
- package/dist/hug/definitions/common.js +70 -0
- package/dist/hug/definitions/common.js.map +1 -0
- package/dist/hug/definitions/form.d.ts +197 -0
- package/dist/hug/definitions/form.d.ts.map +1 -0
- package/dist/hug/definitions/form.js +29 -0
- package/dist/hug/definitions/form.js.map +1 -0
- package/dist/hug/definitions/index.d.ts +10 -0
- package/dist/hug/definitions/index.d.ts.map +1 -0
- package/dist/hug/definitions/index.js +8 -0
- package/dist/hug/definitions/index.js.map +1 -0
- package/dist/hug/errors.d.ts +30 -0
- package/dist/hug/errors.d.ts.map +1 -0
- package/dist/hug/errors.js +46 -0
- package/dist/hug/errors.js.map +1 -0
- package/dist/hug/file_checks.d.ts +41 -0
- package/dist/hug/file_checks.d.ts.map +1 -0
- package/dist/hug/file_checks.js +105 -0
- package/dist/hug/file_checks.js.map +1 -0
- package/dist/hug/files.d.ts +137 -0
- package/dist/hug/files.d.ts.map +1 -0
- package/dist/hug/files.js +283 -0
- package/dist/hug/files.js.map +1 -0
- package/dist/hug/hug_bundle.d.ts +70 -0
- package/dist/hug/hug_bundle.d.ts.map +1 -0
- package/dist/hug/hug_bundle.js +299 -0
- package/dist/hug/hug_bundle.js.map +1 -0
- package/dist/hug/hug_catalog.d.ts +38 -0
- package/dist/hug/hug_catalog.d.ts.map +1 -0
- package/dist/hug/hug_catalog.js +67 -0
- package/dist/hug/hug_catalog.js.map +1 -0
- package/dist/hug/hug_definitions.d.ts +32 -0
- package/dist/hug/hug_definitions.d.ts.map +1 -0
- package/dist/hug/hug_definitions.js +74 -0
- package/dist/hug/hug_definitions.js.map +1 -0
- package/dist/hug/index.d.ts +37 -0
- package/dist/hug/index.d.ts.map +1 -0
- package/dist/hug/index.js +23 -0
- package/dist/hug/index.js.map +1 -0
- package/dist/hug/llm.d.ts +106 -0
- package/dist/hug/llm.d.ts.map +1 -0
- package/dist/hug/llm.js +250 -0
- package/dist/hug/llm.js.map +1 -0
- package/dist/hug/policies.d.ts +65 -0
- package/dist/hug/policies.d.ts.map +1 -0
- package/dist/hug/policies.js +80 -0
- package/dist/hug/policies.js.map +1 -0
- package/dist/hug/problems.d.ts +35 -0
- package/dist/hug/problems.d.ts.map +1 -0
- package/dist/hug/problems.js +53 -0
- package/dist/hug/problems.js.map +1 -0
- package/dist/hug/requested_inputs.d.ts +190 -0
- package/dist/hug/requested_inputs.d.ts.map +1 -0
- package/dist/hug/requested_inputs.js +220 -0
- package/dist/hug/requested_inputs.js.map +1 -0
- package/dist/hug/schema_for_inputs.d.ts +20 -0
- package/dist/hug/schema_for_inputs.d.ts.map +1 -0
- package/dist/hug/schema_for_inputs.js +95 -0
- package/dist/hug/schema_for_inputs.js.map +1 -0
- package/dist/hug/session.d.ts +113 -0
- package/dist/hug/session.d.ts.map +1 -0
- package/dist/hug/session.js +210 -0
- package/dist/hug/session.js.map +1 -0
- package/dist/hug/types.d.ts +141 -0
- package/dist/hug/types.d.ts.map +1 -0
- package/dist/hug/types.js +80 -0
- package/dist/hug/types.js.map +1 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/logging.d.ts +172 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +306 -0
- package/dist/logging.js.map +1 -0
- package/dist/mcp.d.ts +119 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +259 -0
- package/dist/mcp.js.map +1 -0
- package/dist/mcp_client.d.ts +145 -0
- package/dist/mcp_client.d.ts.map +1 -0
- package/dist/mcp_client.js +374 -0
- package/dist/mcp_client.js.map +1 -0
- package/dist/paths.d.ts +20 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +20 -0
- package/dist/paths.js.map +1 -0
- package/dist/protocol/factory.d.ts +32 -0
- package/dist/protocol/factory.d.ts.map +1 -0
- package/dist/protocol/factory.js +31 -0
- package/dist/protocol/factory.js.map +1 -0
- package/dist/protocol/framing.d.ts +35 -0
- package/dist/protocol/framing.d.ts.map +1 -0
- package/dist/protocol/framing.js +73 -0
- package/dist/protocol/framing.js.map +1 -0
- package/dist/protocol/index.d.ts +13 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +13 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/types/agent.d.ts +42 -0
- package/dist/protocol/types/agent.d.ts.map +1 -0
- package/dist/protocol/types/agent.js +9 -0
- package/dist/protocol/types/agent.js.map +1 -0
- package/dist/protocol/types/cliq_core.d.ts +79 -0
- package/dist/protocol/types/cliq_core.d.ts.map +1 -0
- package/dist/protocol/types/cliq_core.js +17 -0
- package/dist/protocol/types/cliq_core.js.map +1 -0
- package/dist/protocol/types/foundations.d.ts +41 -0
- package/dist/protocol/types/foundations.d.ts.map +1 -0
- package/dist/protocol/types/foundations.js +10 -0
- package/dist/protocol/types/foundations.js.map +1 -0
- package/dist/protocol/types/index.d.ts +32 -0
- package/dist/protocol/types/index.d.ts.map +1 -0
- package/dist/protocol/types/index.js +27 -0
- package/dist/protocol/types/index.js.map +1 -0
- package/dist/protocol/types/messages.d.ts +827 -0
- package/dist/protocol/types/messages.d.ts.map +1 -0
- package/dist/protocol/types/messages.js +117 -0
- package/dist/protocol/types/messages.js.map +1 -0
- package/dist/protocol/types/pipeline.d.ts +122 -0
- package/dist/protocol/types/pipeline.d.ts.map +1 -0
- package/dist/protocol/types/pipeline.js +16 -0
- package/dist/protocol/types/pipeline.js.map +1 -0
- package/dist/protocol/types/schemas.d.ts +814 -0
- package/dist/protocol/types/schemas.d.ts.map +1 -0
- package/dist/protocol/types/schemas.js +772 -0
- package/dist/protocol/types/schemas.js.map +1 -0
- package/dist/protocol/types/team.d.ts +42 -0
- package/dist/protocol/types/team.d.ts.map +1 -0
- package/dist/protocol/types/team.js +15 -0
- package/dist/protocol/types/team.js.map +1 -0
- package/dist/protocol/types/workspace.d.ts +46 -0
- package/dist/protocol/types/workspace.d.ts.map +1 -0
- package/dist/protocol/types/workspace.js +9 -0
- package/dist/protocol/types/workspace.js.map +1 -0
- package/dist/settings_keys.d.ts +12 -0
- package/dist/settings_keys.d.ts.map +1 -0
- package/dist/settings_keys.js +35 -0
- package/dist/settings_keys.js.map +1 -0
- package/dist/tcp/client.d.ts +15 -0
- package/dist/tcp/client.d.ts.map +1 -0
- package/dist/tcp/client.js +28 -0
- package/dist/tcp/client.js.map +1 -0
- package/dist/tcp/connection.d.ts +79 -0
- package/dist/tcp/connection.d.ts.map +1 -0
- package/dist/tcp/connection.js +153 -0
- package/dist/tcp/connection.js.map +1 -0
- package/dist/tcp/index.d.ts +10 -0
- package/dist/tcp/index.d.ts.map +1 -0
- package/dist/tcp/index.js +7 -0
- package/dist/tcp/index.js.map +1 -0
- package/dist/tcp/server.d.ts +31 -0
- package/dist/tcp/server.d.ts.map +1 -0
- package/dist/tcp/server.js +54 -0
- package/dist/tcp/server.js.map +1 -0
- package/dist/team/bundle.d.ts +88 -0
- package/dist/team/bundle.d.ts.map +1 -0
- package/dist/team/bundle.js +214 -0
- package/dist/team/bundle.js.map +1 -0
- package/dist/team/identity.d.ts +31 -0
- package/dist/team/identity.d.ts.map +1 -0
- package/dist/team/identity.js +83 -0
- package/dist/team/identity.js.map +1 -0
- package/dist/team/index.d.ts +13 -0
- package/dist/team/index.d.ts.map +1 -0
- package/dist/team/index.js +8 -0
- package/dist/team/index.js.map +1 -0
- package/dist/team/lint_bundle.d.ts +16 -0
- package/dist/team/lint_bundle.d.ts.map +1 -0
- package/dist/team/lint_bundle.js +35 -0
- package/dist/team/lint_bundle.js.map +1 -0
- package/dist/team/ref.d.ts +48 -0
- package/dist/team/ref.d.ts.map +1 -0
- package/dist/team/ref.js +70 -0
- package/dist/team/ref.js.map +1 -0
- package/dist/team/roles.d.ts +22 -0
- package/dist/team/roles.d.ts.map +1 -0
- package/dist/team/roles.js +33 -0
- package/dist/team/roles.js.map +1 -0
- package/dist/team/tree.d.ts +101 -0
- package/dist/team/tree.d.ts.map +1 -0
- package/dist/team/tree.js +125 -0
- package/dist/team/tree.js.map +1 -0
- package/dist/team_lint.d.ts +57 -0
- package/dist/team_lint.d.ts.map +1 -0
- package/dist/team_lint.js +277 -0
- package/dist/team_lint.js.map +1 -0
- package/dist/telemetry/stream_json_usage.d.ts +39 -0
- package/dist/telemetry/stream_json_usage.d.ts.map +1 -0
- package/dist/telemetry/stream_json_usage.js +139 -0
- package/dist/telemetry/stream_json_usage.js.map +1 -0
- package/dist/telemetry/usage.d.ts +288 -0
- package/dist/telemetry/usage.d.ts.map +1 -0
- package/dist/telemetry/usage.js +421 -0
- package/dist/telemetry/usage.js.map +1 -0
- package/dist/utils/duration.d.ts +11 -0
- package/dist/utils/duration.d.ts.map +1 -0
- package/dist/utils/duration.js +22 -0
- package/dist/utils/duration.js.map +1 -0
- package/dist/utils/redact.d.ts +26 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +52 -0
- package/dist/utils/redact.js.map +1 -0
- package/dist/utils/url.d.ts +6 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +11 -0
- package/dist/utils/url.js.map +1 -0
- package/package.json +72 -5
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bridge between a hug's frame and its host (PLAN-hug-widgets §6): every message, both ways, as Zod schemas. The
|
|
3
|
+
* frontend SDK (`@getcliqio/hug-frontend`) and both hosts (the Hub page, cliqd's local page) check every message with
|
|
4
|
+
* these, so the two sides can't drift.
|
|
5
|
+
*
|
|
6
|
+
* Messages are JSON objects `{ v, type, id?, … }` sent with `postMessage`. `v` is the bridge protocol version (not
|
|
7
|
+
* the SDK's version); `init` lists the versions the host speaks.
|
|
8
|
+
*
|
|
9
|
+
* Browser-safe: imports only `zod` and the shared hug modules.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
/** The bridge protocol versions this code speaks. */
|
|
13
|
+
export declare const BRIDGE_PROTOCOLS: readonly [1];
|
|
14
|
+
/** The version this code sends. */
|
|
15
|
+
export declare const BRIDGE_VERSION = 1;
|
|
16
|
+
/** Largest answer a frame may send (`values`, serialized). */
|
|
17
|
+
export declare const MAX_VALUES_BYTES: number;
|
|
18
|
+
/** Longest Submit label. */
|
|
19
|
+
export declare const MAX_SUBMIT_LABEL = 40;
|
|
20
|
+
/** Most `values` messages per second the host takes (the last one wins). */
|
|
21
|
+
export declare const MAX_VALUES_PER_SECOND = 20;
|
|
22
|
+
/** Most file reads in flight, and bytes read, per Hug page. */
|
|
23
|
+
export declare const MAX_READS_IN_FLIGHT = 10;
|
|
24
|
+
/** Most bytes a frame may read per Hug page. */
|
|
25
|
+
export declare const MAX_READ_BYTES_PER_PAGE: number;
|
|
26
|
+
/** A file as the frame sees it: a reference with its metadata. */
|
|
27
|
+
export declare const BridgeFileRef: z.ZodObject<{
|
|
28
|
+
artifact_id: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
size: z.ZodNumber;
|
|
31
|
+
content_type: z.ZodString;
|
|
32
|
+
sha256: z.ZodString;
|
|
33
|
+
}, z.core.$loose>;
|
|
34
|
+
/** BridgeFileRef, as a type. */
|
|
35
|
+
export type BridgeFileRef = z.infer<typeof BridgeFileRef>;
|
|
36
|
+
/** An upload slot. */
|
|
37
|
+
export declare const BridgeFileSlot: z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
accept: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
max_bytes: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
/** One answer, as drawn in view mode or kept for editing. */
|
|
45
|
+
export declare const BridgeAnswer: z.ZodObject<{
|
|
46
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
47
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
48
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
via: z.ZodArray<z.ZodString>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
/** BridgeAnswer, as a type. */
|
|
55
|
+
export type BridgeAnswer = z.infer<typeof BridgeAnswer>;
|
|
56
|
+
/** Hub colours and type, as CSS variables, and the scheme. */
|
|
57
|
+
export declare const BridgeTheme: z.ZodObject<{
|
|
58
|
+
scheme: z.ZodEnum<{
|
|
59
|
+
light: "light";
|
|
60
|
+
dark: "dark";
|
|
61
|
+
}>;
|
|
62
|
+
tokens: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
63
|
+
}, z.core.$strict>;
|
|
64
|
+
/** BridgeTheme, as a type. */
|
|
65
|
+
export type BridgeTheme = z.infer<typeof BridgeTheme>;
|
|
66
|
+
/** `init`: everything the frame needs to draw, sent after `ready` (§6.1). */
|
|
67
|
+
export declare const InitMessage: z.ZodObject<{
|
|
68
|
+
v: z.ZodLiteral<1>;
|
|
69
|
+
type: z.ZodLiteral<"init">;
|
|
70
|
+
protocols: z.ZodArray<z.ZodNumber>;
|
|
71
|
+
hug: z.ZodObject<{
|
|
72
|
+
id: z.ZodString;
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
title: z.ZodString;
|
|
75
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
76
|
+
status: z.ZodEnum<{
|
|
77
|
+
cancelled: "cancelled";
|
|
78
|
+
open: "open";
|
|
79
|
+
closed: "closed";
|
|
80
|
+
expired: "expired";
|
|
81
|
+
}>;
|
|
82
|
+
expires_at: z.ZodNullable<z.ZodString>;
|
|
83
|
+
requester: z.ZodNullable<z.ZodString>;
|
|
84
|
+
run: z.ZodNullable<z.ZodObject<{
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
name: z.ZodNullable<z.ZodString>;
|
|
87
|
+
}, z.core.$strict>>;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
params: z.ZodUnknown;
|
|
90
|
+
files: z.ZodArray<z.ZodObject<{
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
accept: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
|
+
max_bytes: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
98
|
+
artifact_id: z.ZodString;
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
size: z.ZodNumber;
|
|
101
|
+
content_type: z.ZodString;
|
|
102
|
+
sha256: z.ZodString;
|
|
103
|
+
}, z.core.$loose>>;
|
|
104
|
+
viewer: z.ZodObject<{
|
|
105
|
+
name: z.ZodString;
|
|
106
|
+
via: z.ZodArray<z.ZodString>;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
mine: z.ZodNullable<z.ZodObject<{
|
|
109
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
110
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
111
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
name: z.ZodString;
|
|
113
|
+
via: z.ZodArray<z.ZodString>;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strict>>;
|
|
117
|
+
viewing: z.ZodNullable<z.ZodObject<{
|
|
118
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
119
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
120
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
name: z.ZodString;
|
|
122
|
+
via: z.ZodArray<z.ZodString>;
|
|
123
|
+
}, z.core.$strict>>;
|
|
124
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
125
|
+
}, z.core.$strict>>;
|
|
126
|
+
draft: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
127
|
+
progress: z.ZodNullable<z.ZodString>;
|
|
128
|
+
theme: z.ZodObject<{
|
|
129
|
+
scheme: z.ZodEnum<{
|
|
130
|
+
light: "light";
|
|
131
|
+
dark: "dark";
|
|
132
|
+
}>;
|
|
133
|
+
tokens: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
locale: z.ZodString;
|
|
136
|
+
mode: z.ZodEnum<{
|
|
137
|
+
answer: "answer";
|
|
138
|
+
view: "view";
|
|
139
|
+
}>;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
/** `update`: the Hug changed while open (progress, expiry). */
|
|
142
|
+
export declare const UpdateMessage: z.ZodObject<{
|
|
143
|
+
v: z.ZodLiteral<1>;
|
|
144
|
+
type: z.ZodLiteral<"update">;
|
|
145
|
+
progress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
146
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
|
+
}, z.core.$strict>;
|
|
148
|
+
/** `status`: the Hug closed, expired or was cancelled — view mode. */
|
|
149
|
+
export declare const StatusMessage: z.ZodObject<{
|
|
150
|
+
v: z.ZodLiteral<1>;
|
|
151
|
+
type: z.ZodLiteral<"status">;
|
|
152
|
+
status: z.ZodEnum<{
|
|
153
|
+
cancelled: "cancelled";
|
|
154
|
+
open: "open";
|
|
155
|
+
closed: "closed";
|
|
156
|
+
expired: "expired";
|
|
157
|
+
}>;
|
|
158
|
+
mode: z.ZodLiteral<"view">;
|
|
159
|
+
viewing: z.ZodNullable<z.ZodObject<{
|
|
160
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
161
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
162
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
163
|
+
name: z.ZodString;
|
|
164
|
+
via: z.ZodArray<z.ZodString>;
|
|
165
|
+
}, z.core.$strict>>;
|
|
166
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
}, z.core.$strict>;
|
|
169
|
+
/** `mode`: the page switches between showing an answer and editing one (§6.4). */
|
|
170
|
+
export declare const ModeMessage: z.ZodObject<{
|
|
171
|
+
v: z.ZodLiteral<1>;
|
|
172
|
+
type: z.ZodLiteral<"mode">;
|
|
173
|
+
mode: z.ZodEnum<{
|
|
174
|
+
answer: "answer";
|
|
175
|
+
view: "view";
|
|
176
|
+
}>;
|
|
177
|
+
viewing: z.ZodNullable<z.ZodObject<{
|
|
178
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
179
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
180
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
name: z.ZodString;
|
|
182
|
+
via: z.ZodArray<z.ZodString>;
|
|
183
|
+
}, z.core.$strict>>;
|
|
184
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strict>>;
|
|
186
|
+
mine: z.ZodNullable<z.ZodObject<{
|
|
187
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
188
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
189
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
name: z.ZodString;
|
|
191
|
+
via: z.ZodArray<z.ZodString>;
|
|
192
|
+
}, z.core.$strict>>;
|
|
193
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}, z.core.$strict>>;
|
|
195
|
+
draft: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
/** `upload_result`: an upload finished (its reference, or why not). */
|
|
198
|
+
export declare const UploadResultMessage: z.ZodObject<{
|
|
199
|
+
v: z.ZodLiteral<1>;
|
|
200
|
+
type: z.ZodLiteral<"upload_result">;
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
ok: z.ZodBoolean;
|
|
203
|
+
ref: z.ZodOptional<z.ZodObject<{
|
|
204
|
+
artifact_id: z.ZodString;
|
|
205
|
+
name: z.ZodString;
|
|
206
|
+
size: z.ZodNumber;
|
|
207
|
+
content_type: z.ZodString;
|
|
208
|
+
sha256: z.ZodString;
|
|
209
|
+
}, z.core.$loose>>;
|
|
210
|
+
error: z.ZodOptional<z.ZodString>;
|
|
211
|
+
}, z.core.$strict>;
|
|
212
|
+
/** `file`: a read finished (the bytes as a Blob, or why not). */
|
|
213
|
+
export declare const FileMessage: z.ZodObject<{
|
|
214
|
+
v: z.ZodLiteral<1>;
|
|
215
|
+
type: z.ZodLiteral<"file">;
|
|
216
|
+
id: z.ZodString;
|
|
217
|
+
ok: z.ZodBoolean;
|
|
218
|
+
blob: z.ZodOptional<z.ZodCustom<Blob, Blob>>;
|
|
219
|
+
error: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strict>;
|
|
221
|
+
/** `submit_result`: after the host's Submit — the stored answer, or Core's problems. */
|
|
222
|
+
export declare const SubmitResultMessage: z.ZodObject<{
|
|
223
|
+
v: z.ZodLiteral<1>;
|
|
224
|
+
type: z.ZodLiteral<"submit_result">;
|
|
225
|
+
ok: z.ZodBoolean;
|
|
226
|
+
answer: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
228
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
229
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
name: z.ZodString;
|
|
231
|
+
via: z.ZodArray<z.ZodString>;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
234
|
+
}, z.core.$strict>>;
|
|
235
|
+
problems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
236
|
+
path: z.ZodOptional<z.ZodString>;
|
|
237
|
+
message: z.ZodString;
|
|
238
|
+
}, z.core.$strict>>>;
|
|
239
|
+
}, z.core.$strict>;
|
|
240
|
+
/** Every message a host sends a frame. */
|
|
241
|
+
export declare const HostMessage: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
242
|
+
v: z.ZodLiteral<1>;
|
|
243
|
+
type: z.ZodLiteral<"init">;
|
|
244
|
+
protocols: z.ZodArray<z.ZodNumber>;
|
|
245
|
+
hug: z.ZodObject<{
|
|
246
|
+
id: z.ZodString;
|
|
247
|
+
name: z.ZodString;
|
|
248
|
+
title: z.ZodString;
|
|
249
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
250
|
+
status: z.ZodEnum<{
|
|
251
|
+
cancelled: "cancelled";
|
|
252
|
+
open: "open";
|
|
253
|
+
closed: "closed";
|
|
254
|
+
expired: "expired";
|
|
255
|
+
}>;
|
|
256
|
+
expires_at: z.ZodNullable<z.ZodString>;
|
|
257
|
+
requester: z.ZodNullable<z.ZodString>;
|
|
258
|
+
run: z.ZodNullable<z.ZodObject<{
|
|
259
|
+
id: z.ZodString;
|
|
260
|
+
name: z.ZodNullable<z.ZodString>;
|
|
261
|
+
}, z.core.$strict>>;
|
|
262
|
+
}, z.core.$strict>;
|
|
263
|
+
params: z.ZodUnknown;
|
|
264
|
+
files: z.ZodArray<z.ZodObject<{
|
|
265
|
+
name: z.ZodString;
|
|
266
|
+
accept: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
267
|
+
max_bytes: z.ZodOptional<z.ZodNumber>;
|
|
268
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
269
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
270
|
+
}, z.core.$strict>>;
|
|
271
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
272
|
+
artifact_id: z.ZodString;
|
|
273
|
+
name: z.ZodString;
|
|
274
|
+
size: z.ZodNumber;
|
|
275
|
+
content_type: z.ZodString;
|
|
276
|
+
sha256: z.ZodString;
|
|
277
|
+
}, z.core.$loose>>;
|
|
278
|
+
viewer: z.ZodObject<{
|
|
279
|
+
name: z.ZodString;
|
|
280
|
+
via: z.ZodArray<z.ZodString>;
|
|
281
|
+
}, z.core.$strict>;
|
|
282
|
+
mine: z.ZodNullable<z.ZodObject<{
|
|
283
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
284
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
285
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
286
|
+
name: z.ZodString;
|
|
287
|
+
via: z.ZodArray<z.ZodString>;
|
|
288
|
+
}, z.core.$strict>>;
|
|
289
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
290
|
+
}, z.core.$strict>>;
|
|
291
|
+
viewing: z.ZodNullable<z.ZodObject<{
|
|
292
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
293
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
294
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
295
|
+
name: z.ZodString;
|
|
296
|
+
via: z.ZodArray<z.ZodString>;
|
|
297
|
+
}, z.core.$strict>>;
|
|
298
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
299
|
+
}, z.core.$strict>>;
|
|
300
|
+
draft: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
301
|
+
progress: z.ZodNullable<z.ZodString>;
|
|
302
|
+
theme: z.ZodObject<{
|
|
303
|
+
scheme: z.ZodEnum<{
|
|
304
|
+
light: "light";
|
|
305
|
+
dark: "dark";
|
|
306
|
+
}>;
|
|
307
|
+
tokens: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
308
|
+
}, z.core.$strict>;
|
|
309
|
+
locale: z.ZodString;
|
|
310
|
+
mode: z.ZodEnum<{
|
|
311
|
+
answer: "answer";
|
|
312
|
+
view: "view";
|
|
313
|
+
}>;
|
|
314
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
315
|
+
v: z.ZodLiteral<1>;
|
|
316
|
+
type: z.ZodLiteral<"update">;
|
|
317
|
+
progress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
318
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
319
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
320
|
+
v: z.ZodLiteral<1>;
|
|
321
|
+
type: z.ZodLiteral<"status">;
|
|
322
|
+
status: z.ZodEnum<{
|
|
323
|
+
cancelled: "cancelled";
|
|
324
|
+
open: "open";
|
|
325
|
+
closed: "closed";
|
|
326
|
+
expired: "expired";
|
|
327
|
+
}>;
|
|
328
|
+
mode: z.ZodLiteral<"view">;
|
|
329
|
+
viewing: z.ZodNullable<z.ZodObject<{
|
|
330
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
331
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
332
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
333
|
+
name: z.ZodString;
|
|
334
|
+
via: z.ZodArray<z.ZodString>;
|
|
335
|
+
}, z.core.$strict>>;
|
|
336
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
337
|
+
}, z.core.$strict>>;
|
|
338
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
339
|
+
v: z.ZodLiteral<1>;
|
|
340
|
+
type: z.ZodLiteral<"mode">;
|
|
341
|
+
mode: z.ZodEnum<{
|
|
342
|
+
answer: "answer";
|
|
343
|
+
view: "view";
|
|
344
|
+
}>;
|
|
345
|
+
viewing: z.ZodNullable<z.ZodObject<{
|
|
346
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
347
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
348
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
349
|
+
name: z.ZodString;
|
|
350
|
+
via: z.ZodArray<z.ZodString>;
|
|
351
|
+
}, z.core.$strict>>;
|
|
352
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
353
|
+
}, z.core.$strict>>;
|
|
354
|
+
mine: z.ZodNullable<z.ZodObject<{
|
|
355
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
356
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
357
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
358
|
+
name: z.ZodString;
|
|
359
|
+
via: z.ZodArray<z.ZodString>;
|
|
360
|
+
}, z.core.$strict>>;
|
|
361
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
362
|
+
}, z.core.$strict>>;
|
|
363
|
+
draft: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
364
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
365
|
+
v: z.ZodLiteral<1>;
|
|
366
|
+
type: z.ZodLiteral<"upload_result">;
|
|
367
|
+
id: z.ZodString;
|
|
368
|
+
ok: z.ZodBoolean;
|
|
369
|
+
ref: z.ZodOptional<z.ZodObject<{
|
|
370
|
+
artifact_id: z.ZodString;
|
|
371
|
+
name: z.ZodString;
|
|
372
|
+
size: z.ZodNumber;
|
|
373
|
+
content_type: z.ZodString;
|
|
374
|
+
sha256: z.ZodString;
|
|
375
|
+
}, z.core.$loose>>;
|
|
376
|
+
error: z.ZodOptional<z.ZodString>;
|
|
377
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
378
|
+
v: z.ZodLiteral<1>;
|
|
379
|
+
type: z.ZodLiteral<"file">;
|
|
380
|
+
id: z.ZodString;
|
|
381
|
+
ok: z.ZodBoolean;
|
|
382
|
+
blob: z.ZodOptional<z.ZodCustom<Blob, Blob>>;
|
|
383
|
+
error: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
385
|
+
v: z.ZodLiteral<1>;
|
|
386
|
+
type: z.ZodLiteral<"submit_result">;
|
|
387
|
+
ok: z.ZodBoolean;
|
|
388
|
+
answer: z.ZodOptional<z.ZodObject<{
|
|
389
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
390
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
391
|
+
responder: z.ZodOptional<z.ZodObject<{
|
|
392
|
+
name: z.ZodString;
|
|
393
|
+
via: z.ZodArray<z.ZodString>;
|
|
394
|
+
}, z.core.$strict>>;
|
|
395
|
+
responded_at: z.ZodOptional<z.ZodString>;
|
|
396
|
+
}, z.core.$strict>>;
|
|
397
|
+
problems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
398
|
+
path: z.ZodOptional<z.ZodString>;
|
|
399
|
+
message: z.ZodString;
|
|
400
|
+
}, z.core.$strict>>>;
|
|
401
|
+
}, z.core.$strict>], "type">;
|
|
402
|
+
/** HostMessage, as a type. */
|
|
403
|
+
export type HostMessage = z.infer<typeof HostMessage>;
|
|
404
|
+
/** `ready`: the frame has loaded; lists the bridge versions it speaks. */
|
|
405
|
+
export declare const ReadyMessage: z.ZodObject<{
|
|
406
|
+
v: z.ZodLiteral<1>;
|
|
407
|
+
type: z.ZodLiteral<"ready">;
|
|
408
|
+
protocols: z.ZodArray<z.ZodNumber>;
|
|
409
|
+
}, z.core.$strict>;
|
|
410
|
+
/** `values`: the current answer and its state (valid, problems, Submit label, summary). */
|
|
411
|
+
export declare const ValuesMessage: z.ZodObject<{
|
|
412
|
+
v: z.ZodLiteral<1>;
|
|
413
|
+
type: z.ZodLiteral<"values">;
|
|
414
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
415
|
+
valid: z.ZodBoolean;
|
|
416
|
+
problems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
417
|
+
path: z.ZodOptional<z.ZodString>;
|
|
418
|
+
message: z.ZodString;
|
|
419
|
+
}, z.core.$strict>>>;
|
|
420
|
+
submit: z.ZodOptional<z.ZodObject<{
|
|
421
|
+
label: z.ZodString;
|
|
422
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
423
|
+
primary: "primary";
|
|
424
|
+
danger: "danger";
|
|
425
|
+
}>>;
|
|
426
|
+
}, z.core.$strict>>;
|
|
427
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
428
|
+
}, z.core.$strict>;
|
|
429
|
+
/** `upload`: a file from the person for a declared slot. */
|
|
430
|
+
export declare const UploadMessage: z.ZodObject<{
|
|
431
|
+
v: z.ZodLiteral<1>;
|
|
432
|
+
type: z.ZodLiteral<"upload">;
|
|
433
|
+
id: z.ZodString;
|
|
434
|
+
key: z.ZodString;
|
|
435
|
+
}, z.core.$strict>;
|
|
436
|
+
/** `read_file`: a file's bytes, through the host. */
|
|
437
|
+
export declare const ReadFileMessage: z.ZodObject<{
|
|
438
|
+
v: z.ZodLiteral<1>;
|
|
439
|
+
type: z.ZodLiteral<"read_file">;
|
|
440
|
+
id: z.ZodString;
|
|
441
|
+
ref: z.ZodObject<{
|
|
442
|
+
artifact_id: z.ZodString;
|
|
443
|
+
name: z.ZodString;
|
|
444
|
+
size: z.ZodNumber;
|
|
445
|
+
content_type: z.ZodString;
|
|
446
|
+
sha256: z.ZodString;
|
|
447
|
+
}, z.core.$loose>;
|
|
448
|
+
}, z.core.$strict>;
|
|
449
|
+
/** `download`: the host saves a file for the person. */
|
|
450
|
+
export declare const DownloadMessage: z.ZodObject<{
|
|
451
|
+
v: z.ZodLiteral<1>;
|
|
452
|
+
type: z.ZodLiteral<"download">;
|
|
453
|
+
ref: z.ZodObject<{
|
|
454
|
+
artifact_id: z.ZodString;
|
|
455
|
+
name: z.ZodString;
|
|
456
|
+
size: z.ZodNumber;
|
|
457
|
+
content_type: z.ZodString;
|
|
458
|
+
sha256: z.ZodString;
|
|
459
|
+
}, z.core.$loose>;
|
|
460
|
+
}, z.core.$strict>;
|
|
461
|
+
/** `open_link`: the host opens an http(s) link (after showing it, unless it is in the params). */
|
|
462
|
+
export declare const OpenLinkMessage: z.ZodObject<{
|
|
463
|
+
v: z.ZodLiteral<1>;
|
|
464
|
+
type: z.ZodLiteral<"open_link">;
|
|
465
|
+
url: z.ZodURL;
|
|
466
|
+
}, z.core.$strict>;
|
|
467
|
+
/** `resize`: the frame's height. */
|
|
468
|
+
export declare const ResizeMessage: z.ZodObject<{
|
|
469
|
+
v: z.ZodLiteral<1>;
|
|
470
|
+
type: z.ZodLiteral<"resize">;
|
|
471
|
+
height: z.ZodNumber;
|
|
472
|
+
}, z.core.$strict>;
|
|
473
|
+
/** Every message a frame sends its host. */
|
|
474
|
+
export declare const FrameMessage: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
475
|
+
v: z.ZodLiteral<1>;
|
|
476
|
+
type: z.ZodLiteral<"ready">;
|
|
477
|
+
protocols: z.ZodArray<z.ZodNumber>;
|
|
478
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
479
|
+
v: z.ZodLiteral<1>;
|
|
480
|
+
type: z.ZodLiteral<"values">;
|
|
481
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
482
|
+
valid: z.ZodBoolean;
|
|
483
|
+
problems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
484
|
+
path: z.ZodOptional<z.ZodString>;
|
|
485
|
+
message: z.ZodString;
|
|
486
|
+
}, z.core.$strict>>>;
|
|
487
|
+
submit: z.ZodOptional<z.ZodObject<{
|
|
488
|
+
label: z.ZodString;
|
|
489
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
490
|
+
primary: "primary";
|
|
491
|
+
danger: "danger";
|
|
492
|
+
}>>;
|
|
493
|
+
}, z.core.$strict>>;
|
|
494
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
495
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
496
|
+
v: z.ZodLiteral<1>;
|
|
497
|
+
type: z.ZodLiteral<"upload">;
|
|
498
|
+
id: z.ZodString;
|
|
499
|
+
key: z.ZodString;
|
|
500
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
501
|
+
v: z.ZodLiteral<1>;
|
|
502
|
+
type: z.ZodLiteral<"read_file">;
|
|
503
|
+
id: z.ZodString;
|
|
504
|
+
ref: z.ZodObject<{
|
|
505
|
+
artifact_id: z.ZodString;
|
|
506
|
+
name: z.ZodString;
|
|
507
|
+
size: z.ZodNumber;
|
|
508
|
+
content_type: z.ZodString;
|
|
509
|
+
sha256: z.ZodString;
|
|
510
|
+
}, z.core.$loose>;
|
|
511
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
512
|
+
v: z.ZodLiteral<1>;
|
|
513
|
+
type: z.ZodLiteral<"download">;
|
|
514
|
+
ref: z.ZodObject<{
|
|
515
|
+
artifact_id: z.ZodString;
|
|
516
|
+
name: z.ZodString;
|
|
517
|
+
size: z.ZodNumber;
|
|
518
|
+
content_type: z.ZodString;
|
|
519
|
+
sha256: z.ZodString;
|
|
520
|
+
}, z.core.$loose>;
|
|
521
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
522
|
+
v: z.ZodLiteral<1>;
|
|
523
|
+
type: z.ZodLiteral<"open_link">;
|
|
524
|
+
url: z.ZodURL;
|
|
525
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
526
|
+
v: z.ZodLiteral<1>;
|
|
527
|
+
type: z.ZodLiteral<"resize">;
|
|
528
|
+
height: z.ZodNumber;
|
|
529
|
+
}, z.core.$strict>], "type">;
|
|
530
|
+
/** FrameMessage, as a type. */
|
|
531
|
+
export type FrameMessage = z.infer<typeof FrameMessage>;
|
|
532
|
+
/**
|
|
533
|
+
* Check a message a frame sent, as a host must before acting on it (§6.3): its shape, and the size of an answer.
|
|
534
|
+
* (Which file references and upload keys are allowed depends on the Hug; the host checks those itself.)
|
|
535
|
+
*
|
|
536
|
+
* @returns the message, or why it was refused.
|
|
537
|
+
*/
|
|
538
|
+
export declare function parse_frame_message(raw: unknown): {
|
|
539
|
+
ok: true;
|
|
540
|
+
message: FrameMessage;
|
|
541
|
+
} | {
|
|
542
|
+
ok: false;
|
|
543
|
+
reason: string;
|
|
544
|
+
};
|
|
545
|
+
/**
|
|
546
|
+
* Check a message a host sent, as the frontend SDK does before acting on it.
|
|
547
|
+
*
|
|
548
|
+
* @returns the message, or why it was refused.
|
|
549
|
+
*/
|
|
550
|
+
export declare function parse_host_message(raw: unknown): {
|
|
551
|
+
ok: true;
|
|
552
|
+
message: HostMessage;
|
|
553
|
+
} | {
|
|
554
|
+
ok: false;
|
|
555
|
+
reason: string;
|
|
556
|
+
};
|
|
557
|
+
/** The highest protocol version both sides speak, or null. */
|
|
558
|
+
export declare function negotiate_protocol(theirs: readonly number[], ours?: readonly number[]): number | null;
|
|
559
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/hug/bridge/messages.ts"],"names":[],"mappings":"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"}
|