aui-agent-builder 0.3.113 → 0.3.115

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.
@@ -1,50 +0,0 @@
1
- /**
2
- * Bundled-agent guard for the Apollo runtime messaging commands
3
- * (`aui apollo create-task | send-message | rerun | trace`).
4
- *
5
- * These four commands are intentionally restricted to **bundle-mode
6
- * agents** (`Agent.bundle_mode === true`). They forward an assembled
7
- * agent-settings bundle (the same JSON shape `aui push` sends to the
8
- * blob endpoint) and operate against the new agent-first Apollo
9
- * contract — neither of which applies to legacy records-mode ("regular")
10
- * agents. Running them against a records-mode agent would silently send
11
- * a bundle the runtime can't honour, so we fail fast with a clear
12
- * message instead.
13
- *
14
- * Resolution mirrors the rest of the CLI: an explicit `--agent-id`
15
- * always wins, otherwise we fall back to the project's
16
- * `.auirc.agent_management_id` (then the legacy `agent_id`). The
17
- * bundle-mode decision is delegated to the shared `detectAgentBundleMode`
18
- * dispatcher so the `AUI_FORCE_AGENT_MODE` escape hatch and the
19
- * `agent.mode_resolved` telemetry event behave exactly as they do for
20
- * push/pull/import.
21
- */
22
- import { ConfigError, ValidationError } from "../../errors/index.js";
23
- import { detectAgentBundleMode } from "./agent-mode.js";
24
- /**
25
- * Resolve the target agent-management id and assert it is a bundle-mode
26
- * agent. Throws `ConfigError` when no agent can be resolved and
27
- * `ValidationError` when the resolved agent is not bundle-mode.
28
- */
29
- export async function resolveBundledAgent(input) {
30
- const agentManagementId = input.agentIdOption?.trim() ||
31
- input.projectConfig?.agent_management_id ||
32
- input.projectConfig?.agent_id;
33
- if (!agentManagementId) {
34
- throw new ConfigError("No agent could be resolved for this command.", {
35
- suggestion: "Pass --agent-id <agent-management-id>, or run from an imported agent project (so .auirc has agent_management_id). Use `aui import-agent` to link one.",
36
- });
37
- }
38
- const resolution = await detectAgentBundleMode(input.client, agentManagementId);
39
- if (resolution.mode !== "bundle") {
40
- throw new ValidationError(`Agent ${agentManagementId} is a records-mode (regular) agent — the Apollo messaging commands are only available for bundle-mode agents.`, {
41
- suggestion: "Use a bundle-mode agent (created with `aui agents --create --bundle-mode`, the default for new agents). These commands do not support legacy records-mode agents.",
42
- });
43
- }
44
- return {
45
- agentManagementId,
46
- info: resolution.info,
47
- mode: resolution.mode,
48
- };
49
- }
50
- //# sourceMappingURL=bundled-agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundled-agent.js","sourceRoot":"","sources":["../../../src/commands/util/bundled-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAkB,MAAM,iBAAiB,CAAC;AAmBxE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAA+B;IAE/B,MAAM,iBAAiB,GACrB,KAAK,CAAC,aAAa,EAAE,IAAI,EAAE;QAC3B,KAAK,CAAC,aAAa,EAAE,mBAAmB;QACxC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC;IAEhC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,IAAI,WAAW,CACnB,8CAA8C,EAC9C;YACE,UAAU,EACR,uJAAuJ;SAC1J,CACF,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,qBAAqB,CAAC,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAEhF,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACjC,MAAM,IAAI,eAAe,CACvB,SAAS,iBAAiB,+GAA+G,EACzI;YACE,UAAU,EACR,mKAAmK;SACtK,CACF,CAAC;IACJ,CAAC;IAED,OAAO;QACL,iBAAiB;QACjB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,IAAI,EAAE,UAAU,CAAC,IAAI;KACtB,CAAC;AACJ,CAAC"}