@elementumai/edk 0.8.1 → 0.8.2-alpha.6

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 (74) hide show
  1. package/README.md +166 -34
  2. package/dist-sdk/src/catalog/factories.js +18 -2
  3. package/dist-sdk/src/catalog/from-authoring.js +13 -1
  4. package/dist-sdk/src/catalog/org.js +51 -44
  5. package/dist-sdk/src/catalog/token.js +4 -0
  6. package/dist-sdk/src/catalog/types.d.ts +15 -0
  7. package/dist-sdk/src/core/types/app.d.ts +14 -8
  8. package/dist-sdk/src/engine/build/context.d.ts +40 -0
  9. package/dist-sdk/src/engine/build/context.js +11 -1
  10. package/dist-sdk/src/engine/tf/index.d.ts +2 -2
  11. package/dist-sdk/src/engine/tf/index.js +2 -2
  12. package/dist-sdk/src/engine/tf/labels.d.ts +29 -20
  13. package/dist-sdk/src/engine/tf/labels.js +32 -28
  14. package/dist-sdk/src/engine/tf/parse.d.ts +15 -0
  15. package/dist-sdk/src/engine/tf/parse.js +162 -0
  16. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +19 -1
  17. package/dist-sdk/src/entities/access-policy/from-tf.js +4 -6
  18. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +12 -5
  19. package/dist-sdk/src/entities/access-policy/to-tf.js +21 -6
  20. package/dist-sdk/src/entities/agent/build.d.ts +2 -0
  21. package/dist-sdk/src/entities/agent/build.js +1 -0
  22. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +60 -2
  23. package/dist-sdk/src/entities/agent/from-tf.d.ts +12 -7
  24. package/dist-sdk/src/entities/agent/from-tf.js +22 -15
  25. package/dist-sdk/src/entities/agent/module.js +7 -3
  26. package/dist-sdk/src/entities/agent/to-tf.d.ts +46 -1
  27. package/dist-sdk/src/entities/agent/to-tf.js +102 -8
  28. package/dist-sdk/src/entities/agent-a2a-skill/from-tf.d.ts +17 -0
  29. package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +64 -0
  30. package/dist-sdk/src/entities/agent-a2a-skill/module.d.ts +4 -0
  31. package/dist-sdk/src/entities/agent-a2a-skill/module.js +14 -0
  32. package/dist-sdk/src/entities/agent-a2a-skill/to-tf.d.ts +40 -0
  33. package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +47 -0
  34. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +7 -2
  35. package/dist-sdk/src/entities/agent-tool/to-tf.js +86 -26
  36. package/dist-sdk/src/entities/app/build.d.ts +35 -7
  37. package/dist-sdk/src/entities/app/build.js +19 -8
  38. package/dist-sdk/src/entities/app/from-tf.js +0 -7
  39. package/dist-sdk/src/entities/app/module.js +1 -0
  40. package/dist-sdk/src/entities/app/to-tf.js +13 -1
  41. package/dist-sdk/src/entities/automation/build.js +14 -6
  42. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +27 -4
  43. package/dist-sdk/src/entities/automation/filter.d.ts +22 -0
  44. package/dist-sdk/src/entities/automation/filter.js +42 -1
  45. package/dist-sdk/src/entities/automation/from-tf.js +127 -11
  46. package/dist-sdk/src/entities/automation/to-tf.js +176 -18
  47. package/dist-sdk/src/entities/element/build.d.ts +26 -8
  48. package/dist-sdk/src/entities/element/build.js +44 -3
  49. package/dist-sdk/src/entities/element/from-tf.js +10 -11
  50. package/dist-sdk/src/entities/element/module.js +1 -0
  51. package/dist-sdk/src/entities/element/to-tf.js +5 -0
  52. package/dist-sdk/src/entities/field/build.d.ts +9 -5
  53. package/dist-sdk/src/entities/field/calc/runtime.js +2 -2
  54. package/dist-sdk/src/entities/field/from-tf.js +10 -10
  55. package/dist-sdk/src/entities/field/to-tf.d.ts +35 -18
  56. package/dist-sdk/src/entities/field/to-tf.js +110 -6
  57. package/dist-sdk/src/entities/shared/filters/ast.d.ts +15 -0
  58. package/dist-sdk/src/entities/shared/tool-field-ref.js +15 -0
  59. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +97 -8
  60. package/dist-sdk/src/entities/skill/module.js +1 -0
  61. package/dist-sdk/src/entities/skill/to-tf.d.ts +26 -0
  62. package/dist-sdk/src/entities/skill/to-tf.js +63 -3
  63. package/dist-sdk/src/entities/skill/tools.d.ts +12 -5
  64. package/dist-sdk/src/entities/skill/tools.js +26 -1
  65. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +19 -2
  66. package/dist-sdk/src/entities/skill-tool/from-tf.js +97 -8
  67. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +11 -1
  68. package/dist-sdk/src/entities/skill-tool/to-tf.js +143 -27
  69. package/dist-sdk/src/entities/skill-tool/types.d.ts +5 -7
  70. package/dist-sdk/src/entities/skill-tool/types.js +47 -11
  71. package/dist-sdk/src/entities/view/to-tf.js +6 -0
  72. package/dist-sdk/src/graph/modules.js +2 -0
  73. package/dist-sdk/src/graph/types.d.ts +22 -2
  74. package/package.json +12 -7
@@ -4,10 +4,8 @@
4
4
  * name/description/status) — so per-sub-type knowledge is one ROW here,
5
5
  * exactly like `entities/agent-tool/types.ts` (which this mirrors).
6
6
  *
7
- * This tranche implements createRecord + searchAspect end to end; the other
8
- * rows are declared so streams REPORT them by name instead of "unknown
9
- * resource", and adoption scopes ONLY the implemented ones — an adopted type
10
- * the printer can't reconstruct would plan as a destroy on rebuild.
7
+ * Search-table support stays coupled to the underlying AI search-table graph
8
+ * module; every other provider skill-tool resource is implemented end to end.
11
9
  *
12
10
  * Note the wire key for the automation tool is `automation`, not agent-tool's
13
11
  * `executeWorkflow` — confirmed against the live provider schema
@@ -16,10 +14,10 @@
16
14
  export const SKILL_TOOL_SUB_TYPES = [
17
15
  { typeKey: "createRecord", resourceType: "elementum_agentic_skill_create_record_tool", implemented: true },
18
16
  { typeKey: "searchAspect", resourceType: "elementum_agentic_skill_search_records_tool", implemented: true },
19
- { typeKey: "updateRecord", resourceType: "elementum_agentic_skill_update_record_tool" },
17
+ { typeKey: "updateRecord", resourceType: "elementum_agentic_skill_update_record_tool", implemented: true },
20
18
  { typeKey: "searchTable", resourceType: "elementum_agentic_skill_ai_search_tool" },
21
- { typeKey: "runAgent", resourceType: "elementum_agentic_skill_run_agent_tool" },
22
- { typeKey: "automation", resourceType: "elementum_agentic_skill_run_automation_tool" },
19
+ { typeKey: "runAgent", resourceType: "elementum_agentic_skill_run_agent_tool", implemented: true },
20
+ { typeKey: "automation", resourceType: "elementum_agentic_skill_run_automation_tool", implemented: true },
23
21
  ];
24
22
  export const SKILL_TOOL_SUB_TYPE_BY_TYPE_KEY = new Map(SKILL_TOOL_SUB_TYPES.map((t) => [t.typeKey, t]));
25
23
  export const SKILL_TOOL_SUB_TYPE_BY_RESOURCE = new Map(SKILL_TOOL_SUB_TYPES.map((t) => [t.resourceType, t]));
@@ -29,9 +27,9 @@ export const IMPLEMENTED_SKILL_TOOL_RESOURCE_TYPES = SKILL_TOOL_SUB_TYPES.filter
29
27
  export const ALL_SKILL_TOOL_RESOURCE_TYPES = SKILL_TOOL_SUB_TYPES.map((t) => t.resourceType);
30
28
  /**
31
29
  * Attributes `skillToolFromTf` understands per implemented sub-type — growth
32
- * is reported loudly. `run_as`/`service_account_id`/`status` are real
33
- * provider attributes (confirmed live) but out of authoring scope this
34
- * tranche — treated as known-but-unauthored (see `KNOWN_BUT_UNAUTHORED_SKILL_TOOL_ATTRS`).
30
+ * is reported loudly. Shared permissions (`run_as` and
31
+ * `service_account_id`) are included in every implemented row so pull never
32
+ * drops a tool's execution identity.
35
33
  */
36
34
  export const KNOWN_SKILL_TOOL_ATTRS = {
37
35
  createRecord: new Set([
@@ -62,6 +60,44 @@ export const KNOWN_SKILL_TOOL_ATTRS = {
62
60
  "filter",
63
61
  "filter_variables",
64
62
  ]),
63
+ updateRecord: new Set([
64
+ "skill_id",
65
+ "app_id",
66
+ "name",
67
+ "description",
68
+ "status",
69
+ "start_message",
70
+ "run_as",
71
+ "service_account_id",
72
+ "target_id",
73
+ "handle_description",
74
+ "fields",
75
+ ]),
76
+ runAgent: new Set([
77
+ "skill_id",
78
+ "app_id",
79
+ "name",
80
+ "description",
81
+ "status",
82
+ "start_message",
83
+ "run_as",
84
+ "service_account_id",
85
+ "target_agent_id",
86
+ "worker_task_prompt",
87
+ ]),
88
+ automation: new Set([
89
+ "skill_id",
90
+ "app_id",
91
+ "name",
92
+ "description",
93
+ "status",
94
+ "start_message",
95
+ "run_as",
96
+ "service_account_id",
97
+ "automation_id",
98
+ "inputs",
99
+ "outputs",
100
+ ]),
65
101
  };
66
102
  /** Known provider attrs with no authoring slot yet — reported by name, tool still pulled. */
67
- export const UNAUTHORABLE_SKILL_TOOL_ATTRS = new Set(["run_as", "service_account_id"]);
103
+ export const UNAUTHORABLE_SKILL_TOOL_ATTRS = new Set();
@@ -14,6 +14,8 @@ import { expr, isCanonicalTsLabel, sanitizeName, scopedResourceLabel, tsLabelToT
14
14
  import { fieldRefToTfValue as customFieldRefToTfValue } from "../field/to-tf.js";
15
15
  import { SUB_TYPE_BY_AUTHORING_TYPE } from "../field/types.js";
16
16
  import { GROUP_SECTION_WIRE_TYPE, LAYOUT_RESOURCE_TYPE, LAYOUT_RESTRICTED_SYSTEM_FIELD_KEYS, LIST_VIEW_RESOURCE_TYPE, MANAGED_VIEW_ORDER_RESOURCE_TYPE, SECTION_TYPE_TO_WIRE, SYSTEM_FIELD_ID_ATTR_BY_KEY, UPDATE_SECTION_WIRE_TYPE, } from "./types.js";
17
+ /** Elements only have `id`/`title` as real system fields (no status/stage/audit fields) — see `element/locals.ts`. */
18
+ const ELEMENT_SYSTEM_FIELD_KEYS = new Set(["id", "title"]);
17
19
  /** `layouts`/`listViews`/`viewOrder` → their resource blocks, in ei's dialect. */
18
20
  export function viewToTf(layouts, listViews, viewOrder, opts) {
19
21
  const { ownerTfLabel, scope = "app", aspectName, objectId, diagnostics } = opts;
@@ -151,6 +153,10 @@ function resolveFieldRefs(refs, ownerTfLabel, scope, where, diagnostics) {
151
153
  }
152
154
  function fieldRefToTfValue(ref, ownerTfLabel, scope, where, diagnostics) {
153
155
  if (typeof ref === "string") {
156
+ if (scope === "element" && !ELEMENT_SYSTEM_FIELD_KEYS.has(ref)) {
157
+ diagnostics.push(`${where}: "${ref}" is not a known system field key on an element; dropped`);
158
+ return undefined;
159
+ }
154
160
  const attr = SYSTEM_FIELD_ID_ATTR_BY_KEY.get(ref);
155
161
  if (attr === undefined) {
156
162
  diagnostics.push(`${where}: "${ref}" is not a known system field key; dropped`);
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { accessPolicyModule } from "../entities/access-policy/module.js";
6
6
  import { agentModule } from "../entities/agent/module.js";
7
+ import { agentA2ASkillModule } from "../entities/agent-a2a-skill/module.js";
7
8
  import { agentToolModule } from "../entities/agent-tool/module.js";
8
9
  import { appModule } from "../entities/app/module.js";
9
10
  import { automationModule } from "../entities/automation/module.js";
@@ -24,6 +25,7 @@ export const KIND_MODULES = [
24
25
  accessPolicyModule,
25
26
  agentModule,
26
27
  agentToolModule,
28
+ agentA2ASkillModule,
27
29
  automationModule,
28
30
  fileReaderModule,
29
31
  viewModule,
@@ -8,8 +8,8 @@
8
8
  */
9
9
  import type { DeployableEntity } from "../engine/entity.js";
10
10
  import type { FromTfContext } from "../engine/pull/context.js";
11
- import type { TfBlock } from "../engine/tf/index.js";
12
- export type KindId = "org" | "app" | "element" | "field" | "access-policy" | "agent" | "agent-tool" | "automation" | "file-reader" | "skill" | "skill-tool" | "view" | "managed-view-order" | "search-table" | "table" | "cloud-link" | "category" | "connector" | "ai-provider-anthropic" | "ai-provider-bedrock" | "ai-provider-custom" | "ai-provider-deepgram" | "ai-provider-elevenlab" | "ai-provider-gemini" | "ai-provider-openai" | "ai-provider-snowflake" | "ai-provider-xai" | "ai-provider-managed" | "group" | "role" | "user";
11
+ import type { ChildResourceScope, TfBlock } from "../engine/tf/index.js";
12
+ export type KindId = "org" | "app" | "element" | "field" | "access-policy" | "agent" | "agent-tool" | "agent-a2a-skill" | "automation" | "file-reader" | "skill" | "skill-tool" | "view" | "managed-view-order" | "search-table" | "table" | "cloud-link" | "category" | "connector" | "ai-provider-anthropic" | "ai-provider-bedrock" | "ai-provider-custom" | "ai-provider-deepgram" | "ai-provider-elevenlab" | "ai-provider-gemini" | "ai-provider-openai" | "ai-provider-snowflake" | "ai-provider-xai" | "ai-provider-managed" | "group" | "role" | "user";
13
13
  /** @deprecated Use {@link KindId}. */
14
14
  export type EntityKindId = KindId;
15
15
  export type StreamFacet = {
@@ -265,6 +265,26 @@ export interface BuildChildContext {
265
265
  readonly fieldAddresses?: ReadonlyMap<string, string>;
266
266
  readonly fieldNames?: ReadonlyMap<string, string>;
267
267
  readonly fieldMetadata?: ReadonlyMap<string, BuildFieldMetadata>;
268
+ /** Every app/element stream root in this build, by refName (see `ToTfContext.workspaceAspects`). */
269
+ readonly workspaceAspects?: ReadonlyMap<string, {
270
+ readonly kind: ChildResourceScope;
271
+ readonly tfLabel: string;
272
+ }>;
273
+ /**
274
+ * Every own-file child entity discovered for THIS bag under the current
275
+ * app (self included), before any of them are emitted — e.g. every
276
+ * `agents/*.ts` file's entity when the current child is itself an agent.
277
+ * Purely a forwarded list; the engine never interprets it. Lets a kind
278
+ * whose terraform label formula can collide across siblings (board issue
279
+ * #294: two agents authoring a same-named a2a skill) replicate ei's own
280
+ * cross-sibling disambiguation instead of colliding or silently dropping.
281
+ * `skills/*.ts` file's entity when the current child is itself a skill.
282
+ * Purely a forwarded list; the engine never interprets it. Lets a kind
283
+ * whose terraform label formula can collide across siblings (board issue
284
+ * #310: two skills authoring a same-named tool) replicate ei's own
285
+ * cross-sibling disambiguation instead of emitting a colliding address.
286
+ */
287
+ readonly siblingEntities?: readonly DeployableEntity[];
268
288
  }
269
289
  /** Result of extracting a stream-root kind (app, element) from a partitioned export. */
270
290
  export interface StreamRootExtractResult {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementumai/edk",
3
- "version": "0.8.1",
3
+ "version": "0.8.2-alpha.6",
4
4
  "description": "Elementum Development Kit — statically typed SDK for building Elementum automations, agents, and flows",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -128,14 +128,16 @@
128
128
  "sync:version": "tsx src/scripts/sync-cli-version.ts",
129
129
  "sync:skills": "tsx src/scripts/sync-skill-assets.ts",
130
130
  "sync:compatibility": "tsx src/scripts/sync-compatibility.ts",
131
+ "check:release-context": "tsx src/scripts/release-context.ts v0.0.0 HEAD >/dev/null",
131
132
  "fetch:schema": "make -C provider fetch-schema",
132
133
  "generate:schema": "make -C provider generate-schema",
134
+ "generate:graphql": "make -C provider generate-graphql",
133
135
  "build": "npm run build:sdk",
134
136
  "build:sdk": "rm -rf dist-sdk && tsc -p tsconfig.sdk.json",
135
137
  "build:cli": "npm run sync:version && npm run sync:skills && npm run sync:compatibility && rm -rf dist-cli && tsc -p tsconfig.cli.json",
136
- "prebuild:provider": "npm run generate:schema",
138
+ "prebuild:provider": "npm run generate:graphql",
137
139
  "build:provider": "go -C provider build -v .",
138
- "prebuild:bridge": "npm run generate:schema",
140
+ "prebuild:bridge": "npm run generate:graphql",
139
141
  "build:bridge": "mkdir -p integration/.toolchain && go -C cmd/elementum build -v -o ../../integration/.toolchain/ei .",
140
142
  "build:go": "npm run build:provider && npm run build:bridge",
141
143
  "build:distribution": "npm --prefix distribution run build",
@@ -150,11 +152,14 @@
150
152
  "prepack": "npm run build:sdk",
151
153
  "pack:dry-run": "npm pack --dry-run",
152
154
  "pack:consumer": "npm run build:sdk && tsx src/scripts/test-package-consumer.ts",
153
- "test": "tsc --noEmit -p tsconfig.typecheck-tests.json && vitest run",
154
- "pretest:provider": "npm run generate:schema",
155
+ "test": "tsx src/scripts/test.ts",
156
+ "test:unit": "tsc --noEmit -p tsconfig.typecheck-tests.json && vitest run",
157
+ "check:parity": "tsx src/scripts/check-provider-parity.ts",
158
+ "pretest:provider": "npm run generate:graphql",
155
159
  "test:provider": "go -C provider test -v -cover -timeout=120s -parallel=10 ./internal/...",
156
- "pretest:bridge": "npm run generate:schema",
160
+ "pretest:bridge": "npm run generate:graphql",
157
161
  "test:bridge": "go -C cmd/elementum test -v -timeout=30s ./...",
162
+ "test:backend-lock": "vitest run __tests__/integration/http-backend-lock.test.ts __tests__/integration/http-state-backend.test.ts",
158
163
  "test:go": "npm run test:provider && npm run test:bridge",
159
164
  "test:distribution": "npm --prefix distribution test",
160
165
  "test:watch": "vitest",
@@ -169,7 +174,7 @@
169
174
  "lint": "eslint src/cli src/internal/sdk-package.ts src/scripts/prepare-release-promotion.ts src/scripts/test-package-consumer.ts examples/package-consumer",
170
175
  "lint:all": "eslint .",
171
176
  "lint:generated": "eslint generated/",
172
- "check": "npm run typecheck && npm run lint",
177
+ "check": "npm run typecheck && npm run lint && npm run check:release-context",
173
178
  "check:distribution": "npm --prefix distribution run check",
174
179
  "verify:distribution": "npm run check:distribution && npm run test:distribution && npm run build:distribution && git diff --exit-code -- distribution/generated distribution/public/schemas",
175
180
  "edk:canvas": "tsx --tsconfig tsconfig.examples-check.json src/scripts/edk-canvas.ts"