@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,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed agent input interfaces.
|
|
3
|
+
*
|
|
4
|
+
* These describe flat keys a team author puts on a phase in team.yml
|
|
5
|
+
* (nested `payload:` blocks are not supported):
|
|
6
|
+
*
|
|
7
|
+
* phases:
|
|
8
|
+
* - name: analyze-pdf
|
|
9
|
+
* agent: cursor
|
|
10
|
+
* role: |
|
|
11
|
+
* You are analyzing the PDF...
|
|
12
|
+
* model: claude-sonnet-4-20250514
|
|
13
|
+
*
|
|
14
|
+
* The orchestrator reads flat phase keys via `extract_agent_inputs`,
|
|
15
|
+
* maps known fields (e.g. `role` → invoke.role), and passes the rest
|
|
16
|
+
* as `config`.
|
|
17
|
+
*
|
|
18
|
+
* Hierarchy:
|
|
19
|
+
*
|
|
20
|
+
* BaseAgentPayload
|
|
21
|
+
* ├── LlmAgentPayload (cursor, claude-api, gemini, openai-api)
|
|
22
|
+
* ├── ExecAgentPayload (exec)
|
|
23
|
+
* └── ConnectorAgentPayload (jira, gdrive, hubspot, etc.)
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Common fields available to all agent types.
|
|
27
|
+
* Extensible — unknown keys pass through as config.
|
|
28
|
+
*/
|
|
29
|
+
export interface BaseAgentPayload {
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Payload for LLM-based agents.
|
|
34
|
+
*
|
|
35
|
+
* `role` is the primary runtime parameter — it tells the agent what
|
|
36
|
+
* to do. Its requirement is declared in PAYLOAD_SCHEMAS['llm'].
|
|
37
|
+
*/
|
|
38
|
+
export interface LlmAgentPayload extends BaseAgentPayload {
|
|
39
|
+
/** Instructions for the agent — what role it plays in this phase. */
|
|
40
|
+
role: string;
|
|
41
|
+
/** LLM model override (e.g. "claude-sonnet-4-20250514"). */
|
|
42
|
+
model?: string;
|
|
43
|
+
/** Sampling temperature (0.0–2.0). */
|
|
44
|
+
temperature?: number;
|
|
45
|
+
/** Maximum conversation turns before stopping. */
|
|
46
|
+
max_turns?: number;
|
|
47
|
+
/**
|
|
48
|
+
* API agents: whether the model's file tools reach the whole workspace (the files people sent in
|
|
49
|
+
* Hugs are always readable). CLI agents always work in the workspace and ignore it.
|
|
50
|
+
*/
|
|
51
|
+
workspace_access?: boolean;
|
|
52
|
+
/** @deprecated The old name of `workspace_access`, still read when that isn't set. */
|
|
53
|
+
needs_filesystem?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Payload for exec/shell agents that run commands.
|
|
57
|
+
*/
|
|
58
|
+
export interface ExecAgentPayload extends BaseAgentPayload {
|
|
59
|
+
/** Shell command to execute. */
|
|
60
|
+
command?: string;
|
|
61
|
+
/** Environment variables to set for the command. */
|
|
62
|
+
env?: Record<string, string>;
|
|
63
|
+
/** Working directory override. */
|
|
64
|
+
cwd?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Payload for connector agents that integrate with external systems.
|
|
68
|
+
*/
|
|
69
|
+
export interface ConnectorAgentPayload extends BaseAgentPayload {
|
|
70
|
+
/** Action to perform (e.g. "fetch", "create", "update"). */
|
|
71
|
+
action?: string;
|
|
72
|
+
/** Data sources to read from. */
|
|
73
|
+
sources?: Array<{
|
|
74
|
+
ref: string;
|
|
75
|
+
name: string;
|
|
76
|
+
}>;
|
|
77
|
+
/** Data targets to write to. */
|
|
78
|
+
targets?: Array<{
|
|
79
|
+
ref: string;
|
|
80
|
+
name: string;
|
|
81
|
+
file?: string;
|
|
82
|
+
}>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Check if a payload is for an LLM agent (has a role field).
|
|
86
|
+
*/
|
|
87
|
+
export declare function is_llm_payload(payload: BaseAgentPayload): payload is LlmAgentPayload;
|
|
88
|
+
/**
|
|
89
|
+
* Describes a single payload field: its type, whether it's required,
|
|
90
|
+
* and an optional description for UI/CLI hinting.
|
|
91
|
+
*/
|
|
92
|
+
export interface PayloadFieldSpec {
|
|
93
|
+
type: 'string' | 'number' | 'boolean' | 'object';
|
|
94
|
+
required: boolean;
|
|
95
|
+
description?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated Use agent manifest `inputs` block instead. Each agent now
|
|
99
|
+
* declares its own input schema in its manifest.json. This static map
|
|
100
|
+
* is retained only for backward compatibility.
|
|
101
|
+
*/
|
|
102
|
+
export declare const PAYLOAD_SCHEMAS: Record<string, Record<string, PayloadFieldSpec>>;
|
|
103
|
+
//# sourceMappingURL=agent_payloads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent_payloads.d.ts","sourceRoot":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,OAAO,EAAE,gBAAgB,GAAG,OAAO,IAAI,eAAe,CAEpF;AAOD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAgB5E,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed agent input interfaces.
|
|
3
|
+
*
|
|
4
|
+
* These describe flat keys a team author puts on a phase in team.yml
|
|
5
|
+
* (nested `payload:` blocks are not supported):
|
|
6
|
+
*
|
|
7
|
+
* phases:
|
|
8
|
+
* - name: analyze-pdf
|
|
9
|
+
* agent: cursor
|
|
10
|
+
* role: |
|
|
11
|
+
* You are analyzing the PDF...
|
|
12
|
+
* model: claude-sonnet-4-20250514
|
|
13
|
+
*
|
|
14
|
+
* The orchestrator reads flat phase keys via `extract_agent_inputs`,
|
|
15
|
+
* maps known fields (e.g. `role` → invoke.role), and passes the rest
|
|
16
|
+
* as `config`.
|
|
17
|
+
*
|
|
18
|
+
* Hierarchy:
|
|
19
|
+
*
|
|
20
|
+
* BaseAgentPayload
|
|
21
|
+
* ├── LlmAgentPayload (cursor, claude-api, gemini, openai-api)
|
|
22
|
+
* ├── ExecAgentPayload (exec)
|
|
23
|
+
* └── ConnectorAgentPayload (jira, gdrive, hubspot, etc.)
|
|
24
|
+
*/
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Utility: type guard
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
/**
|
|
29
|
+
* Check if a payload is for an LLM agent (has a role field).
|
|
30
|
+
*/
|
|
31
|
+
export function is_llm_payload(payload) {
|
|
32
|
+
return typeof payload.role === 'string';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use agent manifest `inputs` block instead. Each agent now
|
|
36
|
+
* declares its own input schema in its manifest.json. This static map
|
|
37
|
+
* is retained only for backward compatibility.
|
|
38
|
+
*/
|
|
39
|
+
export const PAYLOAD_SCHEMAS = {
|
|
40
|
+
llm: {
|
|
41
|
+
role: { type: 'string', required: true, description: 'Instructions for the agent — what role it plays in this phase' },
|
|
42
|
+
model: { type: 'string', required: false, description: 'LLM model override' },
|
|
43
|
+
temperature: { type: 'number', required: false, description: 'Sampling temperature (0.0–2.0)' },
|
|
44
|
+
max_turns: { type: 'number', required: false, description: 'Maximum conversation turns' },
|
|
45
|
+
workspace_access: { type: 'boolean', required: false, description: 'API agents: whether the file tools reach the whole workspace (Hug files are always readable)' },
|
|
46
|
+
needs_filesystem: { type: 'boolean', required: false, description: 'Deprecated: the old name of workspace_access' },
|
|
47
|
+
},
|
|
48
|
+
exec: {
|
|
49
|
+
command: { type: 'string', required: false, description: 'Shell command to execute' },
|
|
50
|
+
cwd: { type: 'string', required: false, description: 'Working directory override' },
|
|
51
|
+
},
|
|
52
|
+
connector: {
|
|
53
|
+
action: { type: 'string', required: false, description: 'Action to perform (e.g. fetch, create, update)' },
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=agent_payloads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent_payloads.js","sourceRoot":"","sources":["../src/agent_payloads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAwFH,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E;AAE9E;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAyB;IACpD,OAAO,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC5C,CAAC;AAiBD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqD;IAC7E,GAAG,EAAE;QACD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+DAA+D,EAAE;QACtH,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE;QAC7E,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,gCAAgC,EAAE;QAC/F,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,4BAA4B,EAAE;QACzF,gBAAgB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,8FAA8F,EAAE;QACnK,gBAAgB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,8CAA8C,EAAE;KACtH;IACD,IAAI,EAAE;QACF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,0BAA0B,EAAE;QACrF,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,4BAA4B,EAAE;KACtF;IACD,SAAS,EAAE;QACP,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,gDAAgD,EAAE;KAC7G;CACJ,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BaseAgent — foundation of the agent hierarchy.
|
|
3
|
+
*
|
|
4
|
+
* Handles:
|
|
5
|
+
* 1. Read Invoke payload from stdin (piped by the daemon)
|
|
6
|
+
* 2. Build BaseContext with HTTP callback helpers (inputs already merged)
|
|
7
|
+
* 3. Run validate() — a non-empty list of missing input names fails the phase
|
|
8
|
+
* 4. On a resume after a wait on Hugs, re-run built-in policies first (PLAN-hug-requests §10.4):
|
|
9
|
+
* still waiting → wait again without running the agent's code
|
|
10
|
+
* 5. Route to `on_resume(ctx, outcomes)` (resume) or `on_invoke(ctx)` — subclasses implement
|
|
11
|
+
* 6. POST terminators to daemon `/v1/runs/events`
|
|
12
|
+
* 7. Exit cleanly
|
|
13
|
+
*
|
|
14
|
+
* Terminators: `complete` / `error` / `wait` (phase.waiting).
|
|
15
|
+
* Authors do not merge prior state — the daemon rehydrates invoke fields.
|
|
16
|
+
*/
|
|
17
|
+
import type { Invoke } from '../protocol/types/index.js';
|
|
18
|
+
import type { BaseContext, AgentOutput, AgentCheckpoint } from './types.js';
|
|
19
|
+
import { type ResumedOutcome } from '../hug/ask.js';
|
|
20
|
+
/** Overrides for {@link BaseAgent.start}; each falls back to its env var. */
|
|
21
|
+
export interface AgentStartOptions {
|
|
22
|
+
/** Defaults to `CLIQ_DAEMON_URL`. */
|
|
23
|
+
daemon_url?: string;
|
|
24
|
+
/** Defaults to `CLIQ_RUN_ID`. */
|
|
25
|
+
run_id?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Abstract base for all agents.
|
|
29
|
+
*
|
|
30
|
+
* Subclasses override `build_context` to add layer-specific fields
|
|
31
|
+
* and implement `on_invoke` for the agent's business logic. The
|
|
32
|
+
* return value of `on_invoke` (if any) is auto-sent as `complete`.
|
|
33
|
+
*/
|
|
34
|
+
export declare abstract class BaseAgent {
|
|
35
|
+
readonly name: string;
|
|
36
|
+
constructor(name: string);
|
|
37
|
+
/** The current invoke's Hug machinery (set by `build_context`). */
|
|
38
|
+
private _asker;
|
|
39
|
+
/**
|
|
40
|
+
* Entry point — reads invoke from stdin, runs the agent, posts
|
|
41
|
+
* result to daemon, then exits.
|
|
42
|
+
*
|
|
43
|
+
* Order: build ctx (rehydrated) → validate → resume step → on_resume / on_invoke.
|
|
44
|
+
*/
|
|
45
|
+
start(options?: AgentStartOptions): Promise<void>;
|
|
46
|
+
/** Run one invoke (what `start` does after reading stdin; tests call it directly). */
|
|
47
|
+
run(invoke: Invoke, transport: AgentDaemonTransport): Promise<void>;
|
|
48
|
+
/** validate → resume step → on_resume / on_invoke → the result as `complete`. */
|
|
49
|
+
private _dispatch;
|
|
50
|
+
/**
|
|
51
|
+
* Whether a resumed run executes this agent's code from the top again, repeating each `ctx.ask` (the re-entry
|
|
52
|
+
* rule): each repeated ask then finds its Hug by position. True for agent code. An agent that resumes from saved
|
|
53
|
+
* state instead (the LLM and CLI agents) returns false, so its next ask opens a new Hug rather than finding one
|
|
54
|
+
* it already asked.
|
|
55
|
+
*/
|
|
56
|
+
protected replays_asks(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Required inputs missing from ctx before work starts, by name; any fail the phase (the daemon
|
|
59
|
+
* checks a run's inputs before it starts — nothing asks a person for them). Default: none.
|
|
60
|
+
* Subclasses should `return [...await super.validate(ctx), ...extra]`.
|
|
61
|
+
*/
|
|
62
|
+
protected validate(_ctx: BaseContext): string[] | Promise<string[]>;
|
|
63
|
+
/**
|
|
64
|
+
* A resume after a wait on Hugs (§10.4), once each Hug's stored policy has re-run: `outcomes`
|
|
65
|
+
* says how each ended up (`result` null for a policy with functions). Default: run `on_invoke`
|
|
66
|
+
* again with `ctx.resumed_outcome` set; a `ctx.ask` it repeats returns the settled answer, or
|
|
67
|
+
* re-runs its policy on the Hug's new events, instead of asking again.
|
|
68
|
+
*/
|
|
69
|
+
protected on_resume(ctx: BaseContext, _outcomes: readonly ResumedOutcome[]): Promise<AgentOutput | void>;
|
|
70
|
+
/**
|
|
71
|
+
* Build the context for this invoke. BaseAgent builds BaseContext;
|
|
72
|
+
* subclasses override to add layer-specific fields.
|
|
73
|
+
*/
|
|
74
|
+
protected build_context(invoke: Invoke, post_event: EventPoster, transport?: AgentDaemonTransport): BaseContext;
|
|
75
|
+
private create_logger;
|
|
76
|
+
/**
|
|
77
|
+
* The agent's business logic. Subclasses implement this.
|
|
78
|
+
*
|
|
79
|
+
* Return an `AgentOutput` to auto-send `complete`, or call
|
|
80
|
+
* `ctx.complete()` / `ctx.error()` / `ctx.wait()` and return nothing.
|
|
81
|
+
*/
|
|
82
|
+
protected abstract on_invoke(ctx: BaseContext): Promise<AgentOutput | void>;
|
|
83
|
+
/**
|
|
84
|
+
* Called when the orchestrator sends a cancel message.
|
|
85
|
+
* Override to implement graceful shutdown.
|
|
86
|
+
*/
|
|
87
|
+
protected on_cancel(): void;
|
|
88
|
+
}
|
|
89
|
+
/** Fire-and-forget poster of one run event to the daemon. */
|
|
90
|
+
export type EventPoster = (event_type: string, payload: Record<string, unknown>) => void;
|
|
91
|
+
/** Daemon HTTP link for helpers like submit_artifact. */
|
|
92
|
+
export type AgentDaemonTransport = {
|
|
93
|
+
daemon_url: string;
|
|
94
|
+
run_id: string;
|
|
95
|
+
};
|
|
96
|
+
declare function normalize_messages(raw: unknown): ReadonlyArray<{
|
|
97
|
+
role: string;
|
|
98
|
+
content: string;
|
|
99
|
+
}>;
|
|
100
|
+
declare function normalize_checkpoint(raw: unknown): AgentCheckpoint | null;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a fire-and-forget HTTP poster for daemon run events.
|
|
103
|
+
* Events are posted asynchronously — the agent does not wait for ack.
|
|
104
|
+
*/
|
|
105
|
+
declare function make_event_poster(daemon_url: string, run_id: string, phase: string, agent: string): EventPoster;
|
|
106
|
+
/** @internal — exported for unit tests that drive start() without stdin. */
|
|
107
|
+
export declare const _test: {
|
|
108
|
+
normalize_messages: typeof normalize_messages;
|
|
109
|
+
normalize_checkpoint: typeof normalize_checkpoint;
|
|
110
|
+
make_event_poster: typeof make_event_poster;
|
|
111
|
+
};
|
|
112
|
+
export {};
|
|
113
|
+
//# sourceMappingURL=base_agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base_agent.d.ts","sourceRoot":"","sources":["../../src/agents/base_agent.ts"],"names":[],"mappings":"AAAA;;;;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