@elevasis/sdk 1.48.0 → 1.49.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 (46) hide show
  1. package/dist/cli.cjs +742 -231
  2. package/dist/index.d.ts +685 -47
  3. package/dist/index.js +274 -40
  4. package/dist/node/index.d.ts +108 -24
  5. package/dist/test-utils/index.d.ts +647 -34
  6. package/dist/test-utils/index.js +240 -38
  7. package/dist/worker/index.d.ts +663 -39
  8. package/dist/worker/index.js +115 -6
  9. package/package.json +4 -4
  10. package/reference/_navigation.md +4 -4
  11. package/reference/_reference-manifest.json +1 -1
  12. package/reference/core/index.mdx +6 -4
  13. package/reference/index.mdx +11 -5
  14. package/reference/packages/core/src/README.md +46 -44
  15. package/reference/packages/core/src/content/README.md +13 -12
  16. package/reference/rules/ui.md +1 -1
  17. package/reference/rules/vibe-intents.md +2 -2
  18. package/reference/rules/vibe.md +30 -10
  19. package/reference/scaffold/recipes/extend-content.md +82 -3
  20. package/reference/sdk/cli-management.mdx +184 -41
  21. package/reference/sdk/cli.mdx +103 -64
  22. package/reference/sdk/define-builders.mdx +1 -1
  23. package/reference/sdk/deployment/command-center.mdx +2 -2
  24. package/reference/sdk/deployment/index.mdx +1 -1
  25. package/reference/sdk/exports.mdx +4 -4
  26. package/reference/sdk/framework/agent.mdx +4 -3
  27. package/reference/sdk/framework/index.mdx +1 -1
  28. package/reference/sdk/framework/project-structure.mdx +34 -23
  29. package/reference/sdk/framework/tutorial-system.mdx +1 -1
  30. package/reference/sdk/getting-started.mdx +25 -52
  31. package/reference/sdk/index.mdx +3 -3
  32. package/reference/sdk/platform-tools/adapters-integration.mdx +1 -1
  33. package/reference/sdk/platform-tools/adapters-platform.mdx +1 -1
  34. package/reference/sdk/platform-tools/type-safety.mdx +1 -1
  35. package/reference/sdk/resources/patterns.mdx +10 -11
  36. package/reference/sdk/resources/types.mdx +15 -9
  37. package/reference/sdk/templates/data-enrichment.mdx +1 -1
  38. package/reference/sdk/templates/email-sender.mdx +1 -1
  39. package/reference/sdk/templates/index.mdx +47 -47
  40. package/reference/sdk/templates/lead-scorer.mdx +1 -1
  41. package/reference/sdk/templates/pdf-generator.mdx +42 -24
  42. package/reference/sdk/templates/recurring-job.mdx +20 -15
  43. package/reference/sdk/templates/text-classifier.mdx +1 -1
  44. package/reference/sdk/templates/web-scraper.mdx +9 -5
  45. package/reference/ui/exports.mdx +1 -1
  46. package/reference/ui/index.mdx +2 -2
@@ -2749,6 +2749,12 @@ function buildReasoningRequest(iterationContext) {
2749
2749
  capabilities
2750
2750
  };
2751
2751
  }
2752
+
2753
+ // ../core/src/execution/engine/llm/types.ts
2754
+ function extractMessageText(content2) {
2755
+ if (typeof content2 === "string") return content2;
2756
+ return content2.filter((part) => part.type === "text").map((part) => part.text).join("\n");
2757
+ }
2752
2758
  var ToolCallActionSchema = z.object({
2753
2759
  type: z.literal("tool-call"),
2754
2760
  id: z.string().optional(),
@@ -2818,6 +2824,19 @@ var GPT5ConfigSchema = z.object({
2818
2824
  topP: z.number().min(0).max(1).optional(),
2819
2825
  modelOptions: GPT5OptionsSchema.optional()
2820
2826
  });
2827
+ var GPT56OptionsSchema = z.object({
2828
+ reasoning_effort: z.enum(["none", "low", "medium", "high", "xhigh", "max"]).optional(),
2829
+ verbosity: z.enum(["low", "medium", "high"]).optional()
2830
+ });
2831
+ var GPT56ConfigSchema = z.object({
2832
+ model: z.enum(["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"]),
2833
+ provider: z.enum(["openai"]),
2834
+ apiKey: z.string(),
2835
+ temperature: z.literal(1).optional(),
2836
+ maxOutputTokens: z.number().min(4e3).optional(),
2837
+ topP: z.number().min(0).max(1).optional(),
2838
+ modelOptions: GPT56OptionsSchema.optional()
2839
+ });
2821
2840
  var MockConfigSchema = z.object({
2822
2841
  model: z.enum(["mock"]),
2823
2842
  provider: z.enum(["mock"]),
@@ -2870,9 +2889,12 @@ var AnthropicConfigSchema = z.discriminatedUnion("model", [
2870
2889
  AnthropicClaude5ConfigSchema,
2871
2890
  AnthropicStandardConfigSchema
2872
2891
  ]);
2892
+ var GPT56_CACHE_READ_RATE_MULTIPLIER = 0.1;
2893
+ var CACHE_CREATION_RATE_MULTIPLIER = 1.25;
2873
2894
  var MODEL_INFO = {
2874
2895
  // OpenAI GPT-5 (Reasoning Models)
2875
2896
  "gpt-5": {
2897
+ provider: "openai",
2876
2898
  inputCostPer1M: 125,
2877
2899
  // $1.25 per 1M tokens
2878
2900
  outputCostPer1M: 1e3,
@@ -2886,6 +2908,7 @@ var MODEL_INFO = {
2886
2908
  configSchema: GPT5ConfigSchema
2887
2909
  },
2888
2910
  "gpt-5.4-mini": {
2911
+ provider: "openai",
2889
2912
  inputCostPer1M: 75,
2890
2913
  // $0.75 per 1M tokens
2891
2914
  outputCostPer1M: 450,
@@ -2899,6 +2922,7 @@ var MODEL_INFO = {
2899
2922
  configSchema: GPT5ConfigSchema
2900
2923
  },
2901
2924
  "gpt-5.4-nano": {
2925
+ provider: "openai",
2902
2926
  inputCostPer1M: 20,
2903
2927
  // $0.20 per 1M tokens
2904
2928
  outputCostPer1M: 125,
@@ -2910,8 +2934,60 @@ var MODEL_INFO = {
2910
2934
  category: "standard",
2911
2935
  configSchema: GPT5ConfigSchema
2912
2936
  },
2937
+ // OpenAI GPT-5.6 family (GA 2026-07-09). All three tiers share 1.05M context, 128K max output,
2938
+ // image input, tool use, structured outputs, and prompt caching -- they differ in reasoning depth
2939
+ // and price, not capability. The bare `gpt-5.6` alias is deliberately unregistered; see OpenAIModel.
2940
+ "gpt-5.6-sol": {
2941
+ provider: "openai",
2942
+ inputCostPer1M: 500,
2943
+ // $5.00 per 1M tokens
2944
+ outputCostPer1M: 3e3,
2945
+ // $30.00 per 1M tokens
2946
+ minTokens: 4e3,
2947
+ recommendedTokens: 8e3,
2948
+ maxTokens: 105e4,
2949
+ // 1.05M context window
2950
+ maxOutputTokens: 128e3,
2951
+ category: "reasoning",
2952
+ configSchema: GPT56ConfigSchema,
2953
+ cacheReadRateMultiplier: GPT56_CACHE_READ_RATE_MULTIPLIER,
2954
+ cacheCreationRateMultiplier: CACHE_CREATION_RATE_MULTIPLIER
2955
+ },
2956
+ "gpt-5.6-terra": {
2957
+ provider: "openai",
2958
+ inputCostPer1M: 250,
2959
+ // $2.50 per 1M tokens
2960
+ outputCostPer1M: 1500,
2961
+ // $15.00 per 1M tokens
2962
+ minTokens: 4e3,
2963
+ recommendedTokens: 8e3,
2964
+ maxTokens: 105e4,
2965
+ // 1.05M context window
2966
+ maxOutputTokens: 128e3,
2967
+ category: "standard",
2968
+ configSchema: GPT56ConfigSchema,
2969
+ cacheReadRateMultiplier: GPT56_CACHE_READ_RATE_MULTIPLIER,
2970
+ cacheCreationRateMultiplier: CACHE_CREATION_RATE_MULTIPLIER
2971
+ },
2972
+ "gpt-5.6-luna": {
2973
+ provider: "openai",
2974
+ inputCostPer1M: 100,
2975
+ // $1.00 per 1M tokens
2976
+ outputCostPer1M: 600,
2977
+ // $6.00 per 1M tokens
2978
+ minTokens: 4e3,
2979
+ recommendedTokens: 8e3,
2980
+ maxTokens: 105e4,
2981
+ // 1.05M context window
2982
+ maxOutputTokens: 128e3,
2983
+ category: "standard",
2984
+ configSchema: GPT56ConfigSchema,
2985
+ cacheReadRateMultiplier: GPT56_CACHE_READ_RATE_MULTIPLIER,
2986
+ cacheCreationRateMultiplier: CACHE_CREATION_RATE_MULTIPLIER
2987
+ },
2913
2988
  // Mock model for testing
2914
2989
  mock: {
2990
+ provider: "mock",
2915
2991
  inputCostPer1M: 0,
2916
2992
  // Free for tests
2917
2993
  outputCostPer1M: 0,
@@ -2925,6 +3001,7 @@ var MODEL_INFO = {
2925
3001
  },
2926
3002
  // OpenRouter Models (via openrouter.ai)
2927
3003
  "openrouter/z-ai/glm-5": {
3004
+ provider: "openrouter",
2928
3005
  inputCostPer1M: 72,
2929
3006
  // $0.72 per 1M tokens
2930
3007
  outputCostPer1M: 230,
@@ -2938,6 +3015,7 @@ var MODEL_INFO = {
2938
3015
  },
2939
3016
  // Anthropic Claude Models (direct SDK access via @anthropic-ai/sdk)
2940
3017
  "claude-opus-5": {
3018
+ provider: "anthropic",
2941
3019
  inputCostPer1M: 500,
2942
3020
  // $5.00 per 1M tokens
2943
3021
  outputCostPer1M: 2500,
@@ -2951,6 +3029,7 @@ var MODEL_INFO = {
2951
3029
  configSchema: AnthropicConfigSchema
2952
3030
  },
2953
3031
  "claude-sonnet-5": {
3032
+ provider: "anthropic",
2954
3033
  // List pricing. An introductory rate of $2.00/$10.00 runs through 2026-08-31; encoding the
2955
3034
  // temporary rate would make historical cost analytics wrong once it lapses.
2956
3035
  inputCostPer1M: 300,
@@ -2966,6 +3045,7 @@ var MODEL_INFO = {
2966
3045
  configSchema: AnthropicConfigSchema
2967
3046
  },
2968
3047
  "claude-haiku-4-5-20251001": {
3048
+ provider: "anthropic",
2969
3049
  inputCostPer1M: 100,
2970
3050
  // $1.00 per 1M tokens
2971
3051
  outputCostPer1M: 500,
@@ -2979,6 +3059,7 @@ var MODEL_INFO = {
2979
3059
  configSchema: AnthropicConfigSchema
2980
3060
  },
2981
3061
  "claude-haiku-4-5": {
3062
+ provider: "anthropic",
2982
3063
  inputCostPer1M: 100,
2983
3064
  // $1.00 per 1M tokens
2984
3065
  outputCostPer1M: 500,
@@ -2998,7 +3079,7 @@ function getModelInfo(model) {
2998
3079
  return MODEL_INFO[model];
2999
3080
  }
3000
3081
  for (const knownModel of MODEL_KEYS_BY_SPECIFICITY) {
3001
- if (model.startsWith(knownModel)) {
3082
+ if (model.startsWith(`${knownModel}-`)) {
3002
3083
  return MODEL_INFO[knownModel];
3003
3084
  }
3004
3085
  }
@@ -3349,7 +3430,9 @@ async function callLLMForAgentIteration(adapter, request) {
3349
3430
  message: request.capabilities.message,
3350
3431
  memoryOps: request.capabilities.memoryOps,
3351
3432
  historyTurns: request.conversationHistory?.length ?? 0,
3352
- messages: messages.map((m) => ({ role: m.role, ...preview(m.content) }))
3433
+ // `preview` reads text; `extractMessageText` is the identity function for the plain-string case
3434
+ // this always was, and drops image parts (nothing to preview) rather than stringify them.
3435
+ messages: messages.map((m) => ({ role: m.role, ...preview(extractMessageText(m.content)) }))
3353
3436
  });
3354
3437
  let acceptedOutput;
3355
3438
  const response = await adapter.generate({
@@ -3372,7 +3455,10 @@ async function callLLMForAgentIteration(adapter, request) {
3372
3455
  // Same text the real request was billed for -- `estimateTokens`'s bias is a property of the
3373
3456
  // heuristic itself, not of which text it measures, so this is what calibrates the correction
3374
3457
  // `MemoryManager` applies to its own (much smaller) slice of the same request.
3375
- estimatedRequestTokens: estimateTokens(messages.map((m) => m.content).join(""))
3458
+ // Same text-only reasoning as the `preview` call above -- an image part contributes no text
3459
+ // tokens to this estimate (the real request's image token cost is a separate, provider-billed
3460
+ // line item this heuristic was never calibrated against).
3461
+ estimatedRequestTokens: estimateTokens(messages.map((m) => extractMessageText(m.content)).join(""))
3376
3462
  };
3377
3463
  } catch (error) {
3378
3464
  flowLog("agent.iteration.validationFailed", {
@@ -3410,7 +3496,7 @@ async function callLLMForAgentCompletion(adapter, request) {
3410
3496
  return {
3411
3497
  output: response.output,
3412
3498
  usage: response.usage,
3413
- estimatedRequestTokens: estimateTokens(messages.map((m) => m.content).join(""))
3499
+ estimatedRequestTokens: estimateTokens(messages.map((m) => extractMessageText(m.content)).join(""))
3414
3500
  };
3415
3501
  }
3416
3502
 
@@ -6537,10 +6623,17 @@ function createClickUpAdapter(credential) {
6537
6623
  // src/worker/adapters/dropbox.ts
6538
6624
  var METHODS4 = [
6539
6625
  "uploadFile",
6540
- "createFolder"
6626
+ "createFolder",
6627
+ "listFolder",
6628
+ "getMetadata",
6629
+ "getTemporaryLink",
6630
+ "createSharedLink",
6631
+ "download",
6632
+ "getThumbnail",
6633
+ "getThumbnailBatch"
6541
6634
  ];
6542
6635
  function createDropboxAdapter(credential) {
6543
- return createAdapter("dropbox", METHODS4, credential);
6636
+ return createAdapter("dropbox", [...METHODS4], credential);
6544
6637
  }
6545
6638
 
6546
6639
  // src/worker/adapters/gmail.ts
@@ -6826,6 +6919,10 @@ var METHODS14 = [
6826
6919
  "getItem",
6827
6920
  "listItems",
6828
6921
  "updateItem",
6922
+ "addItemSourceAsset",
6923
+ "removeItemSourceAsset",
6924
+ "reorderItemSourceAssets",
6925
+ "updateItemSourceAsset",
6829
6926
  "createAttempt",
6830
6927
  "listAttempts",
6831
6928
  "updateAttempt",
@@ -6833,6 +6930,8 @@ var METHODS14 = [
6833
6930
  "getSourceAsset",
6834
6931
  "listSourceAssets",
6835
6932
  "updateSourceAsset",
6933
+ "getDistribution",
6934
+ "listDistributions",
6836
6935
  "createDistribution",
6837
6936
  "updateDistribution"
6838
6937
  ];
@@ -7241,6 +7340,16 @@ function startWorker(org) {
7241
7340
  // real tier rather than silently passing on an absent one.
7242
7341
  systemPrompt: a.config.systemPrompt,
7243
7342
  securityLevel: a.config.securityLevel,
7343
+ // Wave 2b / Decision 2: redacted model config (no `apiKey`) so the platform can re-run
7344
+ // `validateAgentGrammar` and the token-floor check against what the org actually deployed
7345
+ // instead of only ever seeing the platform's own placeholder stub config. `apiKey` is
7346
+ // deliberately excluded -- this manifest crosses into apps/api's process and is logged.
7347
+ modelConfig: a.modelConfig ? {
7348
+ model: a.modelConfig.model,
7349
+ provider: a.modelConfig.provider,
7350
+ temperature: a.modelConfig.temperature,
7351
+ maxOutputTokens: a.modelConfig.maxOutputTokens
7352
+ } : void 0,
7244
7353
  status: a.config.status,
7245
7354
  description: a.config.description,
7246
7355
  version: a.config.version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "1.48.0",
3
+ "version": "1.49.0",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "type": "module",
6
6
  "bin": {
@@ -55,9 +55,9 @@
55
55
  "tsup": "^8.0.0",
56
56
  "typescript": "5.9.2",
57
57
  "zod": "^4.1.0",
58
- "@repo/core": "0.63.0",
59
- "@repo/typescript-config": "0.0.0",
60
- "@repo/eslint-config": "0.0.0"
58
+ "@repo/core": "0.64.0",
59
+ "@repo/eslint-config": "0.0.0",
60
+ "@repo/typescript-config": "0.0.0"
61
61
  },
62
62
  "scripts": {
63
63
  "lint": "eslint src --max-warnings 0",
@@ -162,7 +162,7 @@ Package entries indexed: 64.
162
162
  | --- | --- | --- | --- |
163
163
  | Theme | `packages/ui/src/theme/README.md` | Published theme entry for downstream applications. | (not specified) |
164
164
  | Graph | `packages/ui/src/graph/README.md` | Published graph helper and visualization entry. | (not specified) |
165
- | Theme Presets | `packages/ui/src/theme/presets/README.md` | Re-exports the canonical THEME_PRESETS tuple, ThemePresetName union, and ThemePresetEnum Zod enum from @repo/core. Single source of truth for preset names across UI, schemas, and Zustand state. | (not specified) |
165
+ | Theme Presets | `packages/ui/src/theme/presets/README.md` | Published THEME_PRESETS tuple, ThemePresetName union, and ThemePresetEnum Zod enum, defined locally and kept manually aligned with the canonical list in packages/core/src/auth/multi-tenancy/theme-presets.ts. | (not specified) |
166
166
  | Knowledge | `packages/ui/src/knowledge/README.md` | Published knowledge browser primitives: Browser, Tree, NodeList, NodeView, SearchBar, MDX provider, and the generated KNOWLEDGE_BODIES map. | (not specified) |
167
167
 
168
168
  ---
@@ -281,7 +281,7 @@ Docs-site pages indexed: 38.
281
281
 
282
282
  | Page | Location | Description |
283
283
  | --- | --- | --- |
284
- | CLI Management Commands | `sdk/cli-management.mdx` | elevasis-sdk management commands -- project, note, acquisition, client, agent, session, queue, schedule, om, ui, skill, and content subcommand families |
284
+ | CLI Management Commands | `sdk/cli-management.mdx` | elevasis-sdk management commands -- project, note, acquisition, client, agent, session, queue, schedule, om, ui, skill, content, and grant subcommand families |
285
285
  | CLI Reference | `sdk/cli.mdx` | Core elevasis-sdk CLI commands -- validate, deploy, execute, inspect resources, manage credentials, rename, and enumerate the command catalog |
286
286
  | Concepts Reference | `sdk/concepts.mdx` | Plain-English explanations of Elevasis SDK concepts -- glossary, workflow analogies, Zod schemas, execution model, platform tools, and design decisions |
287
287
  | When to Reach for the define* Builders | `sdk/define-builders.mdx` | defineWorkflow, defineStep, defineContract, defineResource, and defineTopology exist for two different reasons -- this page teaches which reason applies before you pick a builder over a plain object literal. |
@@ -295,7 +295,7 @@ Docs-site pages indexed: 38.
295
295
  | Tutorial System | `sdk/framework/tutorial-system.mdx` | The /tutorial skill in the external project scaffold -- two-track onboarding (vibe-coder and technical), gate question, track persistence, and escape hatch |
296
296
  | Getting Started | `sdk/getting-started.mdx` | Set up your Elevasis SDK project and run your first deployment |
297
297
  | Human-in-the-Loop (HITL) Workflows | `sdk/human-in-the-loop.mdx` | How a workflow step opens an approval task, how it reaches the command queue, and how selecting an action resumes work -- the story that connects the approval adapter, checkpoint metadata, and the queue CLI. |
298
- | Elevasis SDK | `sdk/index.mdx` | Build and deploy workflows, agents, and resources with the Elevasis SDK |
298
+ | @elevasis/sdk | `sdk/index.mdx` | Build and deploy workflows, agents, and resources with the Elevasis SDK |
299
299
  | Integration Adapters | `sdk/platform-tools/adapters-integration.mdx` | Auto-generated table of all 13 integration (credential-bound) adapters exported from @elevasis/sdk/worker, derived from static analysis of the adapter source files. |
300
300
  | Platform Adapters | `sdk/platform-tools/adapters-platform.mdx` | Auto-generated table of all 14 platform (singleton, no credential) adapters exported from @elevasis/sdk/worker, derived from static analysis of the adapter source files. |
301
301
  | Platform Tools | `sdk/platform-tools/index.mdx` | Access 25 adapters (13 integration + 12 platform) from your SDK workflows -- typed adapters, credential security model, and working code examples |
@@ -309,7 +309,7 @@ Docs-site pages indexed: 38.
309
309
  | Template: Email Sender | `sdk/templates/email-sender.mdx` | Transactional email via Resend with template support -- send styled emails to one or multiple recipients |
310
310
  | Templates | `sdk/templates/index.mdx` | Ready-to-use workflow templates for common automation patterns -- web scraping, data enrichment, email sending, lead scoring, PDF generation, text classification, and recurring jobs |
311
311
  | Template: Lead Scorer | `sdk/templates/lead-scorer.mdx` | LLM-based lead scoring with Supabase storage -- receive a lead, score it with an LLM, store the result |
312
- | Template: PDF Generator | `sdk/templates/pdf-generator.mdx` | PDF generation from structured data with platform storage upload -- render a PDF from a template and upload to platform storage |
312
+ | Template: PDF Generator | `sdk/templates/pdf-generator.mdx` | PDF generation from structured data with platform storage upload -- render a PDF from typed content blocks and upload to platform storage |
313
313
  | Template: Recurring Job | `sdk/templates/recurring-job.mdx` | Scheduler-triggered periodic workflow -- run a task on a schedule (daily, weekly, hourly, or custom cron) |
314
314
  | Template: Text Classifier | `sdk/templates/text-classifier.mdx` | Multi-label text classification with structured output -- classify text into predefined categories using an LLM with JSON output |
315
315
  | Template: Web Scraper | `sdk/templates/web-scraper.mdx` | Apify-based web scraper that stores results in Supabase -- fetch structured data from any website via Apify actors |
@@ -875,7 +875,7 @@
875
875
  "subpath": "./theme/presets",
876
876
  "kind": "subpath",
877
877
  "title": "Theme Presets",
878
- "description": "Re-exports the canonical THEME_PRESETS tuple, ThemePresetName union, and ThemePresetEnum Zod enum from @repo/core. Single source of truth for preset names across UI, schemas, and Zustand state.",
878
+ "description": "Published THEME_PRESETS tuple, ThemePresetName union, and ThemePresetEnum Zod enum, defined locally and kept manually aligned with the canonical list in packages/core/src/auth/multi-tenancy/theme-presets.ts.",
879
879
  "group": "Visual",
880
880
  "order": 2,
881
881
  "sourcePath": "packages/ui/src/theme/presets/index.ts",
@@ -15,11 +15,13 @@ The default export and most subpaths are browser-safe. No Node.js-specific runti
15
15
 
16
16
  ## Published Subpaths
17
17
 
18
- `@elevasis/core` ships six published subpaths:
18
+ `@elevasis/core` ships eight published subpaths:
19
19
 
20
20
  - **`.`** (default) -- base schemas, shared utilities, and the root contract surface. Browser-safe.
21
21
  - **`./auth`** -- auth contract types: session shapes, membership, role definitions, and WorkOS integration contracts.
22
22
  - **`./organization-model`** -- the organization model (OM) schema: system definitions, resource metadata, and the org-model graph types used by the platform's AI routing layer.
23
+ - **`./organization-model/readiness`** -- readiness profiles and the system-interface readiness contract used to gate a System's API surface.
24
+ - **`./content`** -- content pipeline schemas: items, distributions, pipeline step contracts, and review-gate types.
23
25
  - **`./entities`** -- entity schemas: typed definitions for leads, clients, deals, contacts, and other CRM-adjacent records.
24
26
  - **`./knowledge`** -- knowledge graph schemas: document types, embedding metadata, and retrieval contract types.
25
27
  - **`./test-utils`** -- Zod-based test fixtures and factory helpers. Not for production use.
@@ -36,7 +38,7 @@ import { parsePath, bySystem } from "@elevasis/core/knowledge";
36
38
 
37
39
  The default export and all named subpaths above are browser-safe -- they contain only Zod schemas, TypeScript types, and pure utility functions. There are no Node.js-specific APIs, filesystem access, or server-side dependencies in the published surface.
38
40
 
39
- The broader workspace `exports` (~40 paths in `packages/core`) are internal to the monorepo and not part of the published surface. Only the six subpaths listed above are available to tenant projects.
41
+ The broader workspace `exports` (~40 paths in `packages/core`) are internal to the monorepo and not part of the published surface. Only the eight subpaths listed above are available to tenant projects.
40
42
 
41
43
  ## When To Use @elevasis/core Directly
42
44
 
@@ -53,6 +55,6 @@ Most tenant projects install `@elevasis/sdk`, which includes `@elevasis/core` as
53
55
 
54
56
  For advanced use cases -- writing custom validators, extending the org model, or building a server that enforces the same contracts the platform uses -- import from `@elevasis/core` subpaths directly rather than going through the SDK layer.
55
57
 
56
- ## Export Catalog
58
+ ## Documentation
57
59
 
58
- See [Export Catalog](exports.mdx) for a generated table of all published subpath exports derived from the reference manifest.
60
+ - [Export Catalog](exports.mdx) - Generated table of all published subpath exports derived from the reference manifest
@@ -31,9 +31,9 @@ You do not need all three packages. A pure automation project needs only `@eleva
31
31
 
32
32
  ## Packages
33
33
 
34
- ### @elevasis/sdk (v1.45.0)
34
+ ### @elevasis/sdk (v1.48.0)
35
35
 
36
- The primary developer package. Provides the TypeScript API for defining workflows and agents, the `elevasis-sdk` CLI for validation and deployment, and typed worker adapters for 25 platform and integration tools.
36
+ The primary developer package. Provides the TypeScript API for defining workflows and agents, the `elevasis-sdk` CLI for validation and deployment, and typed worker adapters for 27 platform and integration tools.
37
37
 
38
38
  **Install:** `pnpm add @elevasis/sdk`
39
39
 
@@ -41,17 +41,17 @@ The primary developer package. Provides the TypeScript API for defining workflow
41
41
 
42
42
  See [@elevasis/sdk](sdk/index.mdx) for the full group overview, getting started guide, CLI reference, adapter catalog, and more.
43
43
 
44
- ### @elevasis/core (v0.60.0)
44
+ ### @elevasis/core (v0.63.0)
45
45
 
46
46
  The shared contract layer. Exports Zod schemas and TypeScript types that are shared between the SDK, the UI, and the platform API. Useful when you need the typed contracts (organization model, entities, knowledge, auth) in a package that does not pull in the full SDK runtime.
47
47
 
48
48
  **Install:** `pnpm add @elevasis/core`
49
49
 
50
- **Published subpaths:** `.` (default), `./auth`, `./test-utils`, `./organization-model`, `./entities`, `./knowledge`
50
+ **Published subpaths:** `.` (default), `./auth`, `./test-utils`, `./organization-model`, `./organization-model/readiness`, `./content`, `./entities`, `./knowledge`
51
51
 
52
52
  See [@elevasis/core](core/index.mdx) for subpath details, browser/server split, and when to use it.
53
53
 
54
- ### @elevasis/ui (v2.68.0)
54
+ ### @elevasis/ui (v2.72.0)
55
55
 
56
56
  The shared React feature-shell. Provides `ElevasisCoreProvider` / `ElevasisSystemsProvider` and manifest-backed feature modules that a host UI embeds. Many peer dependencies are optional -- pull only what the features you use require.
57
57
 
@@ -61,6 +61,12 @@ The shared React feature-shell. Provides `ElevasisCoreProvider` / `ElevasisSyste
61
61
 
62
62
  See [@elevasis/ui](ui/index.mdx) for the provider model, feature modules, peer dependency details, and when to use it.
63
63
 
64
+ ## Documentation
65
+
66
+ - [@elevasis/sdk](sdk/index.mdx) - Runtime, resource definitions, CLI, worker adapters, deployment, and framework
67
+ - [@elevasis/core](core/index.mdx) - Shared Zod schemas, organization model, knowledge graph, and auth contracts
68
+ - [@elevasis/ui](ui/index.mdx) - React feature-shell, provider model, and manifest-backed feature modules
69
+
64
70
  ## Authoring Note
65
71
 
66
72
  These pages have a dual surface. At SDK build time, `packages/sdk/scripts/copy-reference-docs.mjs` copies every `apps/docs/content/docs/sdk/**.mdx` into `packages/sdk/reference/`, which ships inside the npm package (`files: ["reference/"]`). The `external/_template/CLAUDE.md` points tenant-project agents at `operations/node_modules/@elevasis/sdk/reference/` as their primary reference bundle. Drift in these docs does not just affect the public site -- it actively misleads every agent building a tenant project.
@@ -1,44 +1,46 @@
1
- # @elevasis/core
2
-
3
- Published browser-safe shared contracts for the Elevasis platform.
4
-
5
- This package is the source of truth for shared types, schemas, and contract helpers that are safe to consume from apps and other packages. In this repo the source package is named `@repo/core`, but these docs describe the published `@elevasis/core` surface.
6
-
7
- ## Import Rules
8
-
9
- - Use `@elevasis/core` (root export) for browser-safe shared types and schemas.
10
- - Use `@elevasis/core/organization-model` for the semantic contract layer.
11
- - Use `@elevasis/core/entities` for the published base entity contracts.
12
- - Use `@elevasis/core/test-utils` for shared test fixtures, mocks, and test helpers.
13
- - Paths like `@elevasis/core/server` and `@elevasis/core/platform` are internal monorepo paths (`@repo/core/...`) and are NOT available to external consumers.
14
-
15
- ## Published Surface Groups
16
-
17
- The published `@elevasis/core` npm package exposes these subpaths:
18
-
19
- - `.` (`@elevasis/core`) - browser-safe shared types, schemas, and constants.
20
- - `./organization-model` (`@elevasis/core/organization-model`) - the semantic contract layer for CRM, lead gen, delivery, features, branding, and navigation.
21
- - `./entities` (`@elevasis/core/entities`) - published base entity contracts generic over project metadata extensions.
22
- - `./test-utils` (`@elevasis/core/test-utils`) - test fixtures, mocks, and helpers for downstream automated tests.
23
-
24
- Within the monorepo, the internal `@repo/core` package exposes additional subpaths for use by `apps/` and other packages:
25
-
26
- - `@repo/core/server` - Node.js-only helpers and services.
27
- - `@repo/core/platform` - shared constants, utilities, registry, SSE, and API types.
28
- - `@repo/core/auth` - multi-tenancy types for organizations, users, memberships, invitations, and credentials.
29
- - `@repo/core/execution` - workflow, agent, scheduler, and execution-interface contracts.
30
- - `@repo/core/commands` - command queue types and schemas.
31
- - `@repo/core/operations` - sessions, notifications, observability, activities, triggers, and debug logs.
32
- - `@repo/core/supabase` - generated database types and helpers.
33
- - `@repo/core/integrations/...` - OAuth and credential contracts.
34
- - `@repo/core/projects/api-schemas` - project management request and response schemas.
35
- - `@repo/core/content` - published content metadata types.
36
- - `@repo/core/test-utils` - source of the published test fixtures and mocks surface.
37
-
38
- Other `@repo/core/*` subpaths remain monorepo-only unless they are explicitly listed above in the published `@elevasis/core` surface.
39
-
40
- ## When To Read Deeper
41
-
42
- - For the organization model contract, start with [organization-model/README.md](./organization-model/README.md).
43
- - For test utilities, read [test-utils/README.md](./test-utils/README.md).
44
- - For credentials, read [auth/multi-tenancy/credentials/README.md](./auth/multi-tenancy/credentials/README.md) if you are working in source. The runtime helpers are server-only.
1
+ # @elevasis/core
2
+
3
+ Published browser-safe shared contracts for the Elevasis platform.
4
+
5
+ This package is the source of truth for shared types, schemas, and contract helpers that are safe to consume from apps and other packages. In this repo the source package is named `@repo/core`, but these docs describe the published `@elevasis/core` surface.
6
+
7
+ ## Import Rules
8
+
9
+ - Use `@elevasis/core` (root export) for browser-safe shared types and schemas.
10
+ - Use `@elevasis/core/organization-model` for the semantic contract layer, and `@elevasis/core/organization-model/readiness` for readiness profile and contract types.
11
+ - Use `@elevasis/core/auth` for multi-tenancy types, `@elevasis/core/content` for content metadata types, and `@elevasis/core/entities` for the published base entity contracts.
12
+ - Use `@elevasis/core/knowledge` for the published knowledge contracts.
13
+ - Use `@elevasis/core/test-utils` for shared test fixtures, mocks, and test helpers.
14
+ - Paths like `@elevasis/core/server`, `@elevasis/core/platform`, and `@elevasis/core/supabase` are internal monorepo paths (`@repo/core/...`) and are NOT available to external consumers.
15
+
16
+ ## Published Surface Groups
17
+
18
+ The published `@elevasis/core` npm package exposes these subpaths (the authoritative list is `publishConfig.exports` in `packages/core/package.json`):
19
+
20
+ - `.` (`@elevasis/core`) - browser-safe shared types, schemas, and constants.
21
+ - `./auth` (`@elevasis/core/auth`) - multi-tenancy types for organizations, users, memberships, invitations, and credentials.
22
+ - `./content` (`@elevasis/core/content`) - published content metadata types.
23
+ - `./entities` (`@elevasis/core/entities`) - published base entity contracts generic over project metadata extensions.
24
+ - `./knowledge` (`@elevasis/core/knowledge`) - published knowledge graph contracts.
25
+ - `./organization-model` (`@elevasis/core/organization-model`) - the semantic contract layer for CRM, lead gen, delivery, features, branding, and navigation.
26
+ - `./organization-model/readiness` (`@elevasis/core/organization-model/readiness`) - readiness profile and contract types for the organization model.
27
+ - `./test-utils` (`@elevasis/core/test-utils`) - test fixtures, mocks, and helpers for downstream automated tests.
28
+
29
+ Within the monorepo, the internal `@repo/core` package exposes additional subpaths that are NOT published, for use by `apps/` and other packages:
30
+
31
+ - `@repo/core/server` - Node.js-only helpers and services.
32
+ - `@repo/core/platform` - shared constants, utilities, registry, SSE, and API types.
33
+ - `@repo/core/execution` - workflow, agent, scheduler, and execution-interface contracts.
34
+ - `@repo/core/commands` - command queue types and schemas.
35
+ - `@repo/core/operations` - sessions, notifications, observability, activities, triggers, and debug logs.
36
+ - `@repo/core/supabase` - generated database types and helpers.
37
+ - `@repo/core/integrations/...` - OAuth and credential contracts.
38
+ - `@repo/core/projects/api-schemas` - project management request and response schemas.
39
+
40
+ Other `@repo/core/*` subpaths remain monorepo-only unless they are explicitly listed above in the published `@elevasis/core` surface.
41
+
42
+ ## When To Read Deeper
43
+
44
+ - For the organization model contract, start with [organization-model/README.md](./organization-model/README.md).
45
+ - For test utilities, read [test-utils/README.md](./test-utils/README.md).
46
+ - For credentials, read [auth/multi-tenancy/credentials/README.md](./auth/multi-tenancy/credentials/README.md) if you are working in source. The runtime helpers are server-only.
@@ -6,18 +6,19 @@ The helpers live here rather than in `@repo/ui` because they have three consumer
6
6
 
7
7
  ## Surface
8
8
 
9
- | Export | Purpose |
10
- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
- | `ContentItemResponseSchema`, `CreateContentItemRequestSchema`, `UpdateContentItemRequestSchema` | `content_items` transport shape. `processingState` is intentionally absent from create/update — factory-write-only. |
12
- | `ContentProcessingStateSchema` | `{ stepKey: { status, data? } }`, keyed by `ContentStepKeySchema` — a content-specific key, not lead-gen's `LeadGenStageKeySchema`. |
13
- | `ContentPayloadEnvelopeSchema` | The producer's immutable emission stored in `payload`. Never edited — `body` is the human's canonical text. |
14
- | `ReviewContentItemRequestSchema` | Approve, or reject with a required `rejectReason`. Writes `reviewed_at` / `reviewed_by`. |
15
- | `ContentItemAttemptResponseSchema`, `CreateContentItemAttemptRequestSchema` | `content_item_attempts` transport shape. No `attemptNumber` field on create — the API service assigns it inside the write. `stepKey` is producer-supplied and nullable. |
16
- | `ContentDistributionResponseSchema`, `CreateContentDistributionRequestSchema`, `UpdateContentDistributionRequestSchema` | `content_distributions` transport shape, including the manual-publish fields (`publishMethod`, `platformPostId`, `platformUrl`). |
17
- | `PlatformContent`, `YouTubeContent`, `LinkedInContent`, `InstagramContent`, `XContent`, `AnyPlatformContent`, `PlatformContentMap`, `Platform` | Typed interfaces for platform-specific content stored in `content_distributions.platform_content`. |
18
- | `isOpenContentReviewGate`, `getOpenContentReviewGates` | The one predicate deciding whether a `processing_state` entry is an open, unreviewed `queued` gate. Consumed by the `/queue` handler, `reviewItem`'s `stepKey` validation, and the review page. |
19
- | `deriveContentBoard`, `ContentBoard`, `ContentBoardCard`, `ContentBoardColumn`, `ContentBoardGate` | Placement: `(items, pipeline, now)` to columns, gates, waiting counts, plus the `done` and `unplaced` buckets. Pure. Consumed by the Command Center board and `elevasis-sdk content:board`. |
20
- | `getContentItemIdentity` | Names an item for display when `title` cannot first non-blank line of `body`, then the first string payload field, then `title`, then `'Untitled'`. |
9
+ | Export | Purpose |
10
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
+ | `ContentItemResponseSchema`, `CreateContentItemRequestSchema`, `UpdateContentItemRequestSchema` | `content_items` transport shape. `processingState` is intentionally absent from create/update — factory-write-only. |
12
+ | `ContentProcessingStateSchema` | `{ stepKey: { status, data? } }`, keyed by `ContentStepKeySchema` — a content-specific key, not lead-gen's `LeadGenStageKeySchema`. |
13
+ | `ContentPayloadEnvelopeSchema` | The producer's immutable emission stored in `payload`. Never edited — `body` is the human's canonical text. |
14
+ | `ReviewContentItemRequestSchema` | Approve, or reject with a required `rejectReason`. Writes `reviewed_at` / `reviewed_by`. |
15
+ | `ContentItemAttemptResponseSchema`, `CreateContentItemAttemptRequestSchema` | `content_item_attempts` transport shape. No `attemptNumber` field on create — the API service assigns it inside the write. `stepKey` is producer-supplied and nullable. |
16
+ | `ContentDistributionResponseSchema`, `CreateContentDistributionRequestSchema`, `UpdateContentDistributionRequestSchema` | `content_distributions` transport shape, including the manual-publish fields (`publishMethod`, `platformPostId`, `platformUrl`). |
17
+ | `ContentItemSourceAssetResponseSchema`, `ContentItemSourceAssetInputSchema`, `UpdateContentItemSourceAssetRequestSchema`, `ReorderContentItemSourceAssetsRequestSchema`, `ContentAssetCropSchema` | `content_item_source_assets` transport shape — an item's ordered source assets, `position` 0 is the cover. `crop` is per-MEMBERSHIP normalized fractions, because the same photo crops differently in different items. The initial set rides `CreateContentItemRequestSchema.sourceAssets`; every later mutation is its own method, and `UpdateContentItemRequestSchema` deliberately never touches membership. `derivativePath` / `derivativeCrop` / `derivativeRenderedAt` carry the rendered crop: a stored JPEG in the `content-derivatives` bucket, so the cropped image exists as a file rather than only as CSS. Stale is derived — the two crops differ — never stored as a flag. |
18
+ | `PlatformContent`, `YouTubeContent`, `LinkedInContent`, `InstagramContent`, `XContent`, `AnyPlatformContent`, `PlatformContentMap`, `Platform` | Typed interfaces for platform-specific content stored in `content_distributions.platform_content`. |
19
+ | `isOpenContentReviewGate`, `getOpenContentReviewGates` | The one predicate deciding whether a `processing_state` entry is an open, unreviewed `queued` gate. Consumed by the `/queue` handler, `reviewItem`'s `stepKey` validation, and the review page. |
20
+ | `deriveContentBoard`, `ContentBoard`, `ContentBoardCard`, `ContentBoardColumn`, `ContentBoardGate` | Placement: `(items, pipeline, now)` to columns, gates, waiting counts, plus the `done` and `unplaced` buckets. Pure. Consumed by the Command Center board and `elevasis-sdk content:board`. |
21
+ | `getContentItemIdentity` | Names an item for display when `title` cannot — first non-blank line of `body`, then the first string payload field, then `title`, then `'Untitled'`. |
21
22
 
22
23
  ## Step catalog reconciliation
23
24
 
@@ -295,7 +295,7 @@ For CRM deal action buttons, read `operations/node_modules/@elevasis/sdk/referen
295
295
 
296
296
  ## Topbar Actions
297
297
 
298
- `navigation.topbar` is the organization-model region for topbar action items. Topbar actions are a **distinct node type**, not navigation surfaces: they trigger behavior (open a modal, open docs) rather than route somewhere, so they have no `path` and no nesting, and the `surfaceType` enum (`page | dashboard | list | detail | graph | settings`) does not apply to them. Like sidebar surfaces, they are toggled and reordered through `/org-os manage`.
298
+ `navigation.topbar` is the organization-model region for topbar action items. Topbar actions are a **distinct node type**, not navigation surfaces: they trigger behavior (open a modal, open docs) rather than route somewhere, so they have no `path` and no nesting, and the `surfaceType` enum (`page | dashboard | list | detail | graph | settings`) does not apply to them. Like sidebar surfaces, they are toggled and reordered by editing the navigation config below -- topbar actions carry an `enabled` flag, and ordering follows authored order.
299
299
 
300
300
  Author them in `core/config/organization-model/navigation.ts`, keyed by action id:
301
301
 
@@ -33,7 +33,7 @@ The user wants to record something new -- a task, a note, a piece of information
33
33
  | "Track this conversation as a deal note" | Explicit "track" with a described artifact |
34
34
  | "Note for myself: the client prefers morning calls" | "Note for myself" = personal note to persist |
35
35
 
36
- **Agent action:** draft the capture in plain language, confirm with the user, then execute via `elevasis-sdk project:*` commands for project records, `elevasis-sdk note:create` for personal user notes (the Command Center right panel), or `elevasis-sdk schedule:create` for recurring automation. Disambiguate note scope: a note tied to a deal/task/project is `project:note:create` (a `project:*` record); a standalone personal note is `note:create`. Use repetition vocabulary ("every", "daily", "weekly", "monthly") for schedules; one-shot future reminders stay project tasks with due dates. Never write without confirmation.
36
+ **Agent action:** draft the capture in plain language, confirm with the user, then execute via `elevasis-sdk project:*` commands for project records, `elevasis-sdk note:create` for personal user notes (the Command Center right panel), `elevasis-sdk schedule:create` for recurring automation, or `elevasis-sdk content:source-asset:create` for a new content source asset (a reusable input the content pipeline draws from -- a brand doc, a reference file, raw material). Disambiguate note scope: a note tied to a deal/task/project is `project:note:create` (a `project:*` record); a standalone personal note is `note:create`. Use repetition vocabulary ("every", "daily", "weekly", "monthly") for schedules; one-shot future reminders stay project tasks with due dates. Never write without confirmation.
37
37
 
38
38
  ### 2. Query
39
39
 
@@ -51,7 +51,7 @@ The user wants to know something about current state -- task priorities, what is
51
51
  | "What systems are enabled for this project?" | Static-model query about Systems config |
52
52
  | "What's waiting on review?" | Runtime-entity query about content review-gate state |
53
53
 
54
- **Agent action:** read the relevant source and narrate the answer in plain language. Use org model or `project:*` for project state, `elevasis-sdk queue:list --status pending --pretty` and `queue:status --pretty` for HITL queue state, `elevasis-sdk schedule:list --status active --pretty` for upcoming recurring automation, and `elevasis-sdk content:queue --pretty` (open review gates), `content:list --pretty` (item overview), `content:board <pipelineId> --pretty` (pipeline state), or `content:get <itemId> --pretty` (one item's attempt/distribution history) for the content platform. No writes.
54
+ **Agent action:** read the relevant source and narrate the answer in plain language. Use org model or `project:*` for project state, `elevasis-sdk queue:list --status pending --pretty` and `queue:status --pretty` for HITL queue state, `elevasis-sdk schedule:list --status active --pretty` for upcoming recurring automation, and for the content platform: `elevasis-sdk content:queue --pretty` (open review gates), `content:list --pretty` (item overview), `content:board <pipelineId> --pretty` (pipeline state), `content:get <itemId> --pretty` (one item's attempt/distribution history), `content:source-assets --pretty` (list available source assets), or `content:source-asset <id> --pretty` (one source asset's detail). No writes.
55
55
 
56
56
  ### 3. Describe
57
57