@aaac/runtime 0.2.1 → 0.2.3

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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { b as SdkFunctionTool, O as ObserverEmitFn, c as ObservabilityIds, S as SdkAdapter, d as TaskOutcome, e as TaskContractLike, f as AgentContractLike, g as TaskContext, L as LibraryToolRegistry, P as PromptBuilderOptions, h as MemoryStore, M as MemoryRef, i as TaskRunResult } from './task-runner-GWoI7_71.js';
2
- export { A as AdapterSendOptions, a as AgentExecutionRequest, j as AgentProgressEvent, C as CacheConfig, k as CandidateAgent, E as EnvelopeParams, I as InMemoryStore, l as InnerSpanOptions, m as LibraryToolDefinition, n as OBSERVABILITY_ENV_VARS, R as RetryDecision, o as SplitPrompt, p as TaskRunOptions, T as TokenUsage, q as buildCandidateAgents, r as buildObservabilityEnv, s as buildRetryFollowUp, t as buildSdkFunctionTools, u as buildSplitTaskPrompt, v as buildTaskPrompt, w as collectAnalyzerToolIds, x as createExecutionEnvelope, y as createLibraryToolRegistry, z as createRegistryFromSdkTools, B as emitIterationClose, D as emitIterationMetric, F as emitIterationOpen, G as emitLlmTurnClose, H as emitLlmTurnOpen, J as emitSessionClose, K as emitSessionOpen, N as emitSubagentClose, Q as emitSubagentOpen, U as emitToolExecClose, V as emitToolExecOpen, W as emitToolchainClose, X as emitToolchainOpen, Y as extractStructuredResult, Z as renderAgentSystemPrompt, _ as renderAnalyzerExplorationMandatePrompt, $ as runTask, a0 as serializeObserverEmit, a1 as shouldInjectAnalyzerExplorationMandate, a2 as zodSchemaToPromptDescription, a3 as zodSchemaToYamlExample } from './task-runner-GWoI7_71.js';
1
+ import { b as SdkFunctionTool, O as ObserverEmitFn, c as ObservabilityIds, S as SdkAdapter, d as TaskOutcome, e as TaskContractLike, f as AgentContractLike, g as TaskContext, L as LibraryToolRegistry, P as PromptBuilderOptions, h as MemoryStore, M as MemoryRef, i as TaskRunResult } from './task-runner-37cFPFas.js';
2
+ export { A as AdapterSendOptions, a as AgentExecutionRequest, j as AgentProgressEvent, C as CacheConfig, k as CandidateAgent, E as EnvelopeParams, I as InMemoryStore, l as InnerSpanOptions, m as LibraryToolDefinition, n as OBSERVABILITY_ENV_VARS, R as RetryDecision, o as SplitPrompt, p as TaskRunOptions, T as TokenUsage, q as buildCandidateAgents, r as buildObservabilityEnv, s as buildRetryFollowUp, t as buildSdkFunctionTools, u as buildSplitTaskPrompt, v as buildTaskPrompt, w as collectAnalyzerToolIds, x as createExecutionEnvelope, y as createLibraryToolRegistry, z as createRegistryFromSdkTools, B as emitIterationClose, D as emitIterationMetric, F as emitIterationOpen, G as emitLlmTurnClose, H as emitLlmTurnOpen, J as emitSessionClose, K as emitSessionOpen, N as emitSubagentClose, Q as emitSubagentOpen, U as emitToolExecClose, V as emitToolExecOpen, W as emitToolchainClose, X as emitToolchainOpen, Y as extractStructuredResult, Z as renderAgentSystemPrompt, _ as renderAnalyzerExplorationMandatePrompt, $ as runTask, a0 as serializeObserverEmit, a1 as shouldInjectAnalyzerExplorationMandate, a2 as zodSchemaToPromptDescription, a3 as zodSchemaToYamlExample } from './task-runner-37cFPFas.js';
3
3
  import { ProjectModelMapping, ModelClass, ComponentIR, OperationIR } from '@aaac/contracts';
4
4
  export { ModelClass } from '@aaac/contracts';
5
5
  import { z } from 'zod';
@@ -1549,6 +1549,7 @@ declare const ClaudeConfigSchema: z.ZodObject<{
1549
1549
  template?: string | undefined;
1550
1550
  } | undefined>>;
1551
1551
  agents: z.ZodDefault<z.ZodBoolean>;
1552
+ harness: z.ZodDefault<z.ZodBoolean>;
1552
1553
  }, z.core.$strip>>;
1553
1554
  guard_command: z.ZodOptional<z.ZodString>;
1554
1555
  component_id: z.ZodOptional<z.ZodString>;
package/dist/index.js CHANGED
@@ -14,10 +14,15 @@ import {
14
14
  resolveGuardrailContext,
15
15
  resolveNavigationDsl,
16
16
  resolveNavigationSources
17
- } from "./chunk-ABXDSTUV.js";
17
+ } from "./chunk-MG2ULUX6.js";
18
18
  import {
19
19
  jsonSchemaToZod
20
20
  } from "./chunk-ET6TGQRT.js";
21
+ import {
22
+ PROJECT_CONFIG_FILENAME,
23
+ loadProjectConfig,
24
+ loadWorkspaceMembers
25
+ } from "./chunk-F5R46S7I.js";
21
26
  import {
22
27
  toolGrantForAgent
23
28
  } from "./chunk-VJXGCWSZ.js";
@@ -44,11 +49,6 @@ import {
44
49
  renderContextPackPrompt,
45
50
  serializeObserverEmit
46
51
  } from "./chunk-KTVMMG33.js";
47
- import {
48
- PROJECT_CONFIG_FILENAME,
49
- loadProjectConfig,
50
- loadWorkspaceMembers
51
- } from "./chunk-F5R46S7I.js";
52
52
  import {
53
53
  isNavigationIndex,
54
54
  renderNavigationIndexPrompt
@@ -9294,7 +9294,22 @@ var ClaudeEmitSchema = z3.object({
9294
9294
  * DSL-declared agents are real Claude Code subagents (#272). In a workspace
9295
9295
  * every member's agents are merged into the single root directory.
9296
9296
  */
9297
- agents: z3.boolean().default(false)
9297
+ agents: z3.boolean().default(false),
9298
+ /**
9299
+ * The navigation-index harness itself: `<output_dir>/settings.json`,
9300
+ * `hooks/`, `bin/`, `cache/` and the CLAUDE.md block. Default `true` — every
9301
+ * caller before this field existed got it unconditionally.
9302
+ *
9303
+ * Set `false` when the project OWNS those files by hand and only wants the
9304
+ * DSL-derived artifacts (`agents`, `workflows`, `commands`). A documentation
9305
+ * repository whose `settings.json` carries a hand-written egress guard is the
9306
+ * case this exists for: rendering the harness over it silently replaces the
9307
+ * only guard a standalone clone has.
9308
+ *
9309
+ * Turning it off does not orphan what it would have written — the files are
9310
+ * the project's, so they are neither rendered nor removed.
9311
+ */
9312
+ harness: z3.boolean().default(true)
9298
9313
  }).strip();
9299
9314
  var ClaudeConfigSchema = z3.object({
9300
9315
  /** Root directory for Claude artifacts (relative to the project root). */
@@ -9311,7 +9326,12 @@ var ClaudeConfigSchema = z3.object({
9311
9326
  * Additive-artifact emission toggles. Defaults keep the historical
9312
9327
  * behavior (no workflow scripts) so existing output is byte-preserved.
9313
9328
  */
9314
- emit: ClaudeEmitSchema.default({ workflows: false, commands: void 0, agents: false }),
9329
+ emit: ClaudeEmitSchema.default({
9330
+ workflows: false,
9331
+ commands: void 0,
9332
+ agents: false,
9333
+ harness: true
9334
+ }),
9315
9335
  /**
9316
9336
  * Command wired into guardrail hooks (e.g. "dev-team guard evaluate").
9317
9337
  * Reserved for future hook integration; validated for config parity.
@@ -9326,7 +9346,7 @@ function parseClaudeConfig(raw) {
9326
9346
 
9327
9347
  // src/lib/claude-materialize/workflow-render.ts
9328
9348
  import { resolveSchemaRefs } from "agent-contracts";
9329
- import { pathSegmentForId as pathSegmentForId4 } from "@aaac/contracts";
9349
+ import { pathSegmentForId as pathSegmentForId4, readDslExtension } from "@aaac/contracts";
9330
9350
 
9331
9351
  // src/lib/claude-materialize/dsl-sources.ts
9332
9352
  import { existsSync as existsSync4 } from "fs";
@@ -9465,7 +9485,8 @@ function computeWaves(steps, deps) {
9465
9485
  return waves;
9466
9486
  }
9467
9487
  function renderDelegatePrompt(agent, task, step) {
9468
- const userRequest = (step["x-instruction"] ?? step.description ?? "").trim() || "Perform the task described above.";
9488
+ const instruction = readDslExtension(step, "x-instruction");
9489
+ const userRequest = (instruction ?? step.description ?? "").trim() || "Perform the task described above.";
9469
9490
  return buildTaskPrompt(agent, task, { user_request: userRequest });
9470
9491
  }
9471
9492
  var PRIOR_CONTEXT_PREFIX = "\n\n---\n\n## Prior Context\n";
@@ -9979,6 +10000,8 @@ ${agent.mode}`,
9979
10000
  ].filter((s) => s !== void 0);
9980
10001
  }
9981
10002
  function agentDescription(agent) {
10003
+ const authored = agent.description?.replace(/\s+/g, " ").trim();
10004
+ if (authored) return authored;
9982
10005
  const purpose = agent.purpose.replace(/\s+/g, " ").trim();
9983
10006
  if (!purpose) return agent.role_name;
9984
10007
  return `${agent.role_name} \u2014 ${purpose}`;
@@ -10371,6 +10394,7 @@ async function readIfExists(path) {
10371
10394
  return readFile5(path, "utf8");
10372
10395
  }
10373
10396
  async function renderFiles(root, dsl, config, entryAgentPrompt) {
10397
+ if (!config.emit.harness) return [];
10374
10398
  const ir = buildComponentIR(dsl, config);
10375
10399
  const members = await workspaceMembersForProject(root);
10376
10400
  const workspaceOptions = members.length > 0 ? { members } : void 0;
@@ -10504,12 +10528,12 @@ function templateExt(outputTemplate) {
10504
10528
  return dot <= 0 ? "" : base.slice(dot);
10505
10529
  }
10506
10530
  async function orphanFiles(root, config, rendered, workflows, commands, agents) {
10507
- const orphans = await orphanGeneratedFiles(
10531
+ const orphans = config.emit.harness ? await orphanGeneratedFiles(
10508
10532
  root,
10509
10533
  HOOK_BIN_DIR,
10510
10534
  rendered.filter((f) => isHookBin(f.targetDir, f.path)).map(generatedFileRelPath),
10511
10535
  isOwnedHookBinFile
10512
- );
10536
+ ) : [];
10513
10537
  if (config.emit.workflows) {
10514
10538
  orphans.push(
10515
10539
  ...await orphanGeneratedFiles(