@archal/cli 0.4.1 → 0.5.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.
Files changed (2) hide show
  1. package/dist/index.js +22 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -922,7 +922,7 @@ function spawnWithTimeout(options) {
922
922
  }
923
923
 
924
924
  // src/runner/agent-executor.ts
925
- async function executeAgent(agentConfig, mcpConfigPath, mcpServersJson, twinNames, timeoutMs, restOptions) {
925
+ async function executeAgent(agentConfig, mcpConfigPath, mcpServersJson, twinNames, timeoutMs, restOptions, bearerToken) {
926
926
  const agentEnv = {
927
927
  ...agentConfig.env,
928
928
  MCP_CONFIG_PATH: mcpConfigPath,
@@ -930,6 +930,9 @@ async function executeAgent(agentConfig, mcpConfigPath, mcpServersJson, twinName
930
930
  ARCHAL_MCP_SERVERS: mcpServersJson,
931
931
  ARCHAL_TWIN_NAMES: twinNames.join(",")
932
932
  };
933
+ if (bearerToken) {
934
+ agentEnv["ARCHAL_TOKEN"] = bearerToken;
935
+ }
933
936
  if (restOptions?.restConfigPath) {
934
937
  agentEnv["ARCHAL_REST_CONFIG"] = restOptions.restConfigPath;
935
938
  }
@@ -4834,7 +4837,6 @@ async function uploadIfEnabled(traceId, report) {
4834
4837
  import { z as z3 } from "zod";
4835
4838
 
4836
4839
  // src/runner/seed-patch.ts
4837
- var TWINS_WITHOUT_SEED_FILE_SUPPORT = /* @__PURE__ */ new Set(["supabase"]);
4838
4840
  var RELATIONSHIP_RULES = {
4839
4841
  github: [
4840
4842
  { sourceCollection: "branches", sourceField: "repoId", targetCollection: "repos", targetField: "id" },
@@ -4864,6 +4866,13 @@ var RELATIONSHIP_RULES = {
4864
4866
  { sourceCollection: "issues", sourceField: "stateId", targetCollection: "workflowStates", targetField: "id" },
4865
4867
  { sourceCollection: "comments", sourceField: "issueId", targetCollection: "issues", targetField: "id" },
4866
4868
  { sourceCollection: "workflowStates", sourceField: "teamId", targetCollection: "teams", targetField: "id" }
4869
+ ],
4870
+ supabase: [
4871
+ { sourceCollection: "posts", sourceField: "user_id", targetCollection: "users", targetField: "id" },
4872
+ { sourceCollection: "comments", sourceField: "post_id", targetCollection: "posts", targetField: "id" },
4873
+ { sourceCollection: "comments", sourceField: "user_id", targetCollection: "users", targetField: "id" },
4874
+ { sourceCollection: "post_tags", sourceField: "post_id", targetCollection: "posts", targetField: "id" },
4875
+ { sourceCollection: "post_tags", sourceField: "tag_id", targetCollection: "tags", targetField: "id" }
4867
4876
  ]
4868
4877
  };
4869
4878
  function getRelationshipRulesForPrompt(twinName) {
@@ -5627,8 +5636,13 @@ MANDATORY: If a channel, user, repo, project, or entity is mentioned by name in
5627
5636
  - If setup mentions specific projects or issue keys, create them with those exact values
5628
5637
 
5629
5638
  ### Supabase
5630
- - Tables and rows are managed via SQL seeds, not JSON patches
5631
- - Dynamic seed generation is not supported for Supabase \u2014 the base seed must contain all needed tables
5639
+ - The state is a set of database tables with rows, represented as JSON collections
5640
+ - Each collection name is a table name (e.g., "users", "posts", "comments")
5641
+ - Rows follow the table's column schema \u2014 refer to the base seed sample for exact column names and types
5642
+ - Foreign key relationships exist between tables (e.g., posts.user_id \u2192 users.id) \u2014 maintain referential integrity
5643
+ - The base SQL seed defines the schema (tables, indexes, constraints); dynamic seeds only modify row data
5644
+ - Include realistic data types: text, integers, booleans, timestamptz (ISO 8601 format)
5645
+ - Serial/auto-increment ID columns exist on most tables \u2014 do NOT include "id" in added entities (the patch system auto-assigns IDs; the final snapshot sent to the twin will contain explicit IDs)
5632
5646
 
5633
5647
  ## STRUCTURAL RULES
5634
5648
 
@@ -6104,7 +6118,8 @@ ${baseTaskMessage}` : baseTaskMessage;
6104
6118
  mcpServersJson,
6105
6119
  twinNames,
6106
6120
  timeoutSeconds * 1e3,
6107
- { restConfigPath, twinUrls }
6121
+ { restConfigPath, twinUrls },
6122
+ apiBearerToken
6108
6123
  );
6109
6124
  if (!apiEngine && !localEngine && shouldRetryWithModernOpenClaw(agentResult)) {
6110
6125
  warn(
@@ -6117,7 +6132,8 @@ ${baseTaskMessage}` : baseTaskMessage;
6117
6132
  mcpServersJson,
6118
6133
  twinNames,
6119
6134
  timeoutSeconds * 1e3,
6120
- { restConfigPath, twinUrls }
6135
+ { restConfigPath, twinUrls },
6136
+ apiBearerToken
6121
6137
  );
6122
6138
  }
6123
6139
  const stateAfter = await collectStateFromHttp(cloudTwinUrls, apiBearerToken, adminAuth);
@@ -6341,10 +6357,6 @@ Run 'archal doctor' for a full system check.`
6341
6357
  const generationTargets = [];
6342
6358
  const extractedIntentByTwin = /* @__PURE__ */ new Map();
6343
6359
  for (const sel of seedSelections) {
6344
- if (TWINS_WITHOUT_SEED_FILE_SUPPORT.has(sel.twinName)) {
6345
- warn(`Twin "${sel.twinName}" does not support dynamic seeds, skipping`);
6346
- continue;
6347
- }
6348
6360
  if (!options.allowAmbiguousSeed) {
6349
6361
  const negative = getNegativeSeed(sel.twinName, sel.seedName, scenario.setup);
6350
6362
  if (negative && negative.missingSlots.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archal/cli",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "The archal CLI — test AI agents against digital twins",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",