@swirls/deploy 0.3.0 → 0.4.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.
package/dist/index.d.ts CHANGED
@@ -4597,30 +4597,6 @@ interface LowerMountsResult {
4597
4597
  */
4598
4598
  declare function lowerSwirlsMounts(mounts: readonly SwirlsMount[], options?: LowerMountsOptions): LowerMountsResult;
4599
4599
 
4600
- declare const nodeTypeMap: {
4601
- readonly ai: "ai";
4602
- readonly decision: "decision";
4603
- readonly code: "code";
4604
- readonly email: "email";
4605
- readonly workflow: "workflow";
4606
- readonly http: "http";
4607
- readonly integration: "integration";
4608
- readonly postgres: "postgres";
4609
- readonly database: "database";
4610
- readonly scrape: "scrape";
4611
- readonly search: "search";
4612
- readonly parallel: "parallel";
4613
- readonly disk: "disk";
4614
- readonly shell: "shell";
4615
- readonly device: "device";
4616
- readonly stream: "stream";
4617
- readonly switch: "switch";
4618
- readonly wait: "wait";
4619
- readonly map: "map";
4620
- readonly fanout: "fanout";
4621
- readonly while: "while";
4622
- readonly agent: "agent";
4623
- };
4624
4600
  /** How an executable config string was authored in the DSL (plain literal vs @ts/@sql). */
4625
4601
  declare const configValueKindSchema: z.ZodEnum<{
4626
4602
  literal: "literal";
@@ -4921,21 +4897,22 @@ declare const workflowNodeConfigSchema: z.ZodIntersection<z.ZodDiscriminatedUnio
4921
4897
  fallbackValue: z.ZodOptional<z.ZodUnknown>;
4922
4898
  }, z.core.$strip>>;
4923
4899
  }, z.core.$strip>>;
4924
- type NodeType = keyof typeof nodeTypeMap;
4925
4900
  type WorkflowNodeConfig = z.infer<typeof workflowNodeConfigSchema>;
4926
4901
 
4927
4902
  /**
4928
- * Executable config fields that may be a plain string or `@ts` / `@sql`.
4903
+ * Build the `configValueKinds` sidecar from a node's parsed `configFields`.
4929
4904
  *
4930
- * A runtime resolves these fields at execution time, so the definition records
4931
- * which form each one was written in. Fields that must return non-strings
4932
- * (objects, arrays) or that are code-only by design stay off this list.
4905
+ * After lowering, a field written as `@ts { … }` or `@sql { … }` is a string
4906
+ * like any literal, so the definition records which fields were code. Every
4907
+ * field of the persisted `config` written as `@ts` or `@sql` gets an entry,
4908
+ * whatever the node type and whatever its code returns (a url, a headers
4909
+ * object, a list of params): a runtime evaluates by the kind, never by a list
4910
+ * of fields it expects to be code. A field with no entry is the value as
4911
+ * written.
4933
4912
  */
4934
- declare const EXECUTABLE_STRING_FIELDS: Partial<Record<NodeType, readonly string[]>>;
4935
- /** Build the `configValueKinds` sidecar from a node's parsed `configFields`. */
4936
4913
  declare function buildConfigValueKindsFromNodeDecl(node: {
4937
- type: string;
4938
4914
  configFields: Record<string, ConfigValue>;
4915
+ config: WorkflowNodeConfig;
4939
4916
  }): Record<string, ConfigValueKind> | undefined;
4940
4917
  /** Build a node's `config` in the definition from its parsed declaration. */
4941
4918
  declare function buildWorkflowNodeConfigFromNodeDecl(node: {
@@ -5059,4 +5036,4 @@ declare function buildDeploymentSourceManifest({ definition, ast, files, }: {
5059
5036
  */
5060
5037
  declare function stripEditorMetadata(value: unknown): unknown;
5061
5038
 
5062
- export { AGENTS_SKILLS_DIR, type BuildDefinitionOptions, COMPUTER_BASELINE_KIT, COMPUTER_BASELINE_PACKAGES, COMPUTER_HARNESS_RESOURCE_DEFAULTS, COMPUTER_HARNESS_RUNTIME, COMPUTER_MOUNT_KIT, COMPUTER_MOUNT_PACKAGES, COMPUTER_RESOURCE_DEFAULTS, type CompiledComputer, type CompiledComputerHarness, type ComputerHarnessBake, type ComputerHarnessInput, type ComputerRecipeInput, type DeployBundleDirent, type DeployBundleFs, type DeploymentDefinition, type DeploymentSkillFilePayload, type DeploymentSkillFilesBundle, type DeploymentSourceFileContent, type DeploymentSourceManifest, type DeploymentSourceManifestV2, type DeploymentSourceResourceKind, type DeploymentSourceResourceKindV2, type Diagnostic, EXECUTABLE_STRING_FIELDS, HARNESS_DEBIAN_STAGE_DIR, HARNESS_PROVIDERS, HARNESS_ROOT_DIR, type HarnessCatalog, type HarnessDebianPackage, type HarnessProvider, type HarnessRuntimePackage, type LanguageHost, type LowerDiagnostic, type LowerMountsOptions, type LowerMountsResult, type LowerOptions, type LowerResult, type LowerStage, MAX_SKILL_FILES, MAX_SKILL_FILE_BYTES, MAX_SKILL_TREE_BYTES, MOUNT_SKILLS_ROOT, type MergeProjectOptions, type MountDiagnostic, type MountFingerprint, type MountSite, type MountSkillFiles, type MountSourceFile, type OpenUiSupport, type ProviderCatalog, SKILL_MD_FILENAME, type SkillBlockRef, type SkillBundle, type SkillClassificationResult, type SkillDeployFs, type SkillDeployStat, type SkillFileEntry, type SkillMdFrontmatter, type SourceRange, type SwirlsFile, type SwirlsMount, type SwirlsMountFiles, type SwirlsSources, buildConfigValueKindsFromNodeDecl, buildDeploymentDefinitionPayload, buildDeploymentSourceManifest, buildWorkflowNodeConfigFromNodeDecl, canonicalizeForStableJson, classifySkillBundle, collectDeploymentSkillFiles, collectDeploymentSourceFiles, collectReferencedSkillBlocksFromAst, collectSwirlsFiles, combineDeploymentAndSourceFingerprints, compileComputerRecipe, compileGoalBlock, compileOperationBlock, computeDefinitionHash, computeDeploymentDefinitionFingerprint, computeDeploymentSourceFingerprint, computeGoalContractHash, computeSkillChecksum, computerHarnessBake, computerSnapshotName, createMemoryRepoFs, createNodeDeployBundleFs, daytonaSnapshotResources, deployBundleToSkillDeployFs, deployBundleToWorkspaceFileSystem, deploymentSourceManifestV2Schema, flattenArchivePathMap, flattenInlineSubgraphsInGraph, floxManifestToml, harnessPrepScript, harnessRuntimePackages, isHarnessProvider, isKnownScriptExtension, isScriptsOrBinDirectory, lowerSwirlsMounts, lowerSwirlsSources, mergeProjectSwirlsFiles, normalizeDeploymentSourcePath, operationScriptSha256, parseDeploymentDefinition, parseDeploymentSourceManifestV2, parseSkillMdFrontmatter, platformComputerSnapshotName, recipePackages, resolveSkillTree, sha256Hex, sliceRepoFilesToRoot, stripEditorMetadata, swirlsHost, uuidv7, validateDeploymentSourceInput, virtualRepoCwd };
5039
+ export { AGENTS_SKILLS_DIR, type BuildDefinitionOptions, COMPUTER_BASELINE_KIT, COMPUTER_BASELINE_PACKAGES, COMPUTER_HARNESS_RESOURCE_DEFAULTS, COMPUTER_HARNESS_RUNTIME, COMPUTER_MOUNT_KIT, COMPUTER_MOUNT_PACKAGES, COMPUTER_RESOURCE_DEFAULTS, type CompiledComputer, type CompiledComputerHarness, type ComputerHarnessBake, type ComputerHarnessInput, type ComputerRecipeInput, type DeployBundleDirent, type DeployBundleFs, type DeploymentDefinition, type DeploymentSkillFilePayload, type DeploymentSkillFilesBundle, type DeploymentSourceFileContent, type DeploymentSourceManifest, type DeploymentSourceManifestV2, type DeploymentSourceResourceKind, type DeploymentSourceResourceKindV2, type Diagnostic, HARNESS_DEBIAN_STAGE_DIR, HARNESS_PROVIDERS, HARNESS_ROOT_DIR, type HarnessCatalog, type HarnessDebianPackage, type HarnessProvider, type HarnessRuntimePackage, type LanguageHost, type LowerDiagnostic, type LowerMountsOptions, type LowerMountsResult, type LowerOptions, type LowerResult, type LowerStage, MAX_SKILL_FILES, MAX_SKILL_FILE_BYTES, MAX_SKILL_TREE_BYTES, MOUNT_SKILLS_ROOT, type MergeProjectOptions, type MountDiagnostic, type MountFingerprint, type MountSite, type MountSkillFiles, type MountSourceFile, type OpenUiSupport, type ProviderCatalog, SKILL_MD_FILENAME, type SkillBlockRef, type SkillBundle, type SkillClassificationResult, type SkillDeployFs, type SkillDeployStat, type SkillFileEntry, type SkillMdFrontmatter, type SourceRange, type SwirlsFile, type SwirlsMount, type SwirlsMountFiles, type SwirlsSources, buildConfigValueKindsFromNodeDecl, buildDeploymentDefinitionPayload, buildDeploymentSourceManifest, buildWorkflowNodeConfigFromNodeDecl, canonicalizeForStableJson, classifySkillBundle, collectDeploymentSkillFiles, collectDeploymentSourceFiles, collectReferencedSkillBlocksFromAst, collectSwirlsFiles, combineDeploymentAndSourceFingerprints, compileComputerRecipe, compileGoalBlock, compileOperationBlock, computeDefinitionHash, computeDeploymentDefinitionFingerprint, computeDeploymentSourceFingerprint, computeGoalContractHash, computeSkillChecksum, computerHarnessBake, computerSnapshotName, createMemoryRepoFs, createNodeDeployBundleFs, daytonaSnapshotResources, deployBundleToSkillDeployFs, deployBundleToWorkspaceFileSystem, deploymentSourceManifestV2Schema, flattenArchivePathMap, flattenInlineSubgraphsInGraph, floxManifestToml, harnessPrepScript, harnessRuntimePackages, isHarnessProvider, isKnownScriptExtension, isScriptsOrBinDirectory, lowerSwirlsMounts, lowerSwirlsSources, mergeProjectSwirlsFiles, normalizeDeploymentSourcePath, operationScriptSha256, parseDeploymentDefinition, parseDeploymentSourceManifestV2, parseSkillMdFrontmatter, platformComputerSnapshotName, recipePackages, resolveSkillTree, sha256Hex, sliceRepoFilesToRoot, stripEditorMetadata, swirlsHost, uuidv7, validateDeploymentSourceInput, virtualRepoCwd };
package/dist/index.js CHANGED
@@ -21206,23 +21206,8 @@ function inlineIntegrationActionConfig(config, ctx) {
21206
21206
  }
21207
21207
 
21208
21208
  // src/node-config.ts
21209
- var EXECUTABLE_STRING_FIELDS = {
21210
- disk: ["command", "path", "file"],
21211
- shell: ["command"],
21212
- device: ["device", "input"],
21213
- http: ["url", "body"],
21214
- email: ["from", "to", "subject", "text", "html", "replyTo"],
21215
- scrape: ["url"],
21216
- search: ["query", "location", "country", "tbs"],
21217
- ai: ["prompt", "model"],
21218
- agent: ["prompt", "system", "model"],
21219
- decision: ["state", "model"],
21220
- parallel: ["objective", "entityType"]
21221
- };
21222
- function configValueKindFromCv(cv) {
21209
+ function codeKindFromCv(cv) {
21223
21210
  switch (cv.kind) {
21224
- case "string":
21225
- return "literal";
21226
21211
  case "ts_block":
21227
21212
  case "ts_file_ref":
21228
21213
  return "ts";
@@ -21233,19 +21218,10 @@ function configValueKindFromCv(cv) {
21233
21218
  }
21234
21219
  }
21235
21220
  function buildConfigValueKindsFromNodeDecl(node) {
21236
- const nodeType = nodeTypeSchema.parse(node.type);
21237
- const fields = EXECUTABLE_STRING_FIELDS[nodeType];
21238
- if (!fields) {
21239
- return void 0;
21240
- }
21241
21221
  const kinds = {};
21242
- for (const key of fields) {
21243
- const cv = node.configFields[key];
21244
- if (!cv) {
21245
- continue;
21246
- }
21247
- const kind = configValueKindFromCv(cv);
21248
- if (kind) {
21222
+ for (const [key, cv] of Object.entries(node.configFields)) {
21223
+ const kind = codeKindFromCv(cv);
21224
+ if (kind && key in node.config) {
21249
21225
  kinds[key] = kind;
21250
21226
  }
21251
21227
  }
@@ -21746,8 +21722,8 @@ ${z10.prettifyError(r.error)}`
21746
21722
  }
21747
21723
  }
21748
21724
  const configValueKinds = buildConfigValueKindsFromNodeDecl({
21749
- type: n.type,
21750
- configFields: omitCredentialFieldsFromConfigFields(n.configFields)
21725
+ configFields: omitCredentialFieldsFromConfigFields(n.configFields),
21726
+ config: persistConfig
21751
21727
  });
21752
21728
  let secretsMapPayload = n.secretsMap;
21753
21729
  if (persistConfig.type === "decision" && persistConfig.definition) {
@@ -24367,7 +24343,6 @@ export {
24367
24343
  COMPUTER_MOUNT_KIT,
24368
24344
  COMPUTER_MOUNT_PACKAGES,
24369
24345
  COMPUTER_RESOURCE_DEFAULTS,
24370
- EXECUTABLE_STRING_FIELDS,
24371
24346
  HARNESS_DEBIAN_STAGE_DIR,
24372
24347
  HARNESS_PROVIDERS,
24373
24348
  HARNESS_ROOT_DIR,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swirls/deploy",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Lowers .swirls source files into a Swirls deployment definition.",
5
5
  "license": "MIT",
6
6
  "repository": {