@elevasis/sdk 0.4.4 → 0.4.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.
package/dist/cli.cjs CHANGED
@@ -43808,7 +43808,7 @@ async function apiDelete(endpoint, apiUrl = resolveApiUrl()) {
43808
43808
  }
43809
43809
 
43810
43810
  // src/cli/version.ts
43811
- var SDK_VERSION = "0.4.4";
43811
+ var SDK_VERSION = "0.4.6";
43812
43812
 
43813
43813
  // src/cli/commands/deploy.ts
43814
43814
  var import_meta2 = {};
@@ -43859,6 +43859,10 @@ async function scanDocumentation() {
43859
43859
  await scan(docsDir, "");
43860
43860
  return files.length > 0 ? files : void 0;
43861
43861
  }
43862
+ function escapeMdx(text) {
43863
+ if (!text) return "";
43864
+ return text.replace(/\|/g, "\\|").replace(/\{/g, "\\{").replace(/\}/g, "\\}");
43865
+ }
43862
43866
  async function generateResourceMap(org) {
43863
43867
  const workflows = org.workflows ?? [];
43864
43868
  const agents = org.agents ?? [];
@@ -43883,7 +43887,7 @@ async function generateResourceMap(org) {
43883
43887
  "| --- | --- | --- | --- | --- |"
43884
43888
  );
43885
43889
  for (const w of workflows) {
43886
- const desc = w.config.description?.replace(/\|/g, "\\|") ?? "";
43890
+ const desc = escapeMdx(w.config.description);
43887
43891
  lines.push(`| \`${w.config.resourceId}\` | ${w.config.name} | ${w.config.version} | ${w.config.status} | ${desc} |`);
43888
43892
  }
43889
43893
  lines.push("");
@@ -43896,7 +43900,7 @@ async function generateResourceMap(org) {
43896
43900
  "| --- | --- | --- | --- | --- |"
43897
43901
  );
43898
43902
  for (const a of agents) {
43899
- const desc = a.config.description?.replace(/\|/g, "\\|") ?? "";
43903
+ const desc = escapeMdx(a.config.description);
43900
43904
  lines.push(`| \`${a.config.resourceId}\` | ${a.config.name} | ${a.config.version} | ${a.config.status} | ${desc} |`);
43901
43905
  }
43902
43906
  lines.push("");
@@ -44472,7 +44476,8 @@ var SCAFFOLD_FILES = [
44472
44476
  ".claude/commands/resource.md",
44473
44477
  ".claude/commands/deploy.md",
44474
44478
  ".claude/commands/inspect.md",
44475
- ".claude/commands/env.md"
44479
+ ".claude/commands/env.md",
44480
+ ".claude/commands/sdk-docs.md"
44476
44481
  ];
44477
44482
  function registerInitCommand(program3) {
44478
44483
  program3.command("init [directory]").description("Scaffold a new Elevasis project\n Example: elevasis init my-project").option("--force", "Overwrite existing files").action(wrapAction("init", async (directory, options2) => {
@@ -44516,7 +44521,8 @@ function registerInitCommand(program3) {
44516
44521
  ".claude/commands/resource.md": claudeResourceCommandTemplate(),
44517
44522
  ".claude/commands/deploy.md": claudeDeployCommandTemplate(),
44518
44523
  ".claude/commands/inspect.md": claudeInspectCommandTemplate(),
44519
- ".claude/commands/env.md": claudeEnvCommandTemplate()
44524
+ ".claude/commands/env.md": claudeEnvCommandTemplate(),
44525
+ ".claude/commands/sdk-docs.md": claudeSdkDocsCommandTemplate()
44520
44526
  };
44521
44527
  for (const [filePath, content] of Object.entries(files)) {
44522
44528
  await (0, import_promises2.writeFile)((0, import_path3.resolve)(targetDir, filePath), content, "utf-8");
@@ -44877,6 +44883,22 @@ at deploy time via \`z.toJSONSchema()\`.
44877
44883
  - Documentation goes in \`docs/\` as \`.mdx\` files
44878
44884
  - \`dist/\` is generated by deploy -- never commit it
44879
44885
  - \`resourceId\` must be lowercase with hyphens, unique per organization
44886
+
44887
+ ## SDK Reference Documentation
44888
+
44889
+ Complete SDK documentation is bundled with the package at:
44890
+
44891
+ node_modules/@elevasis/sdk/reference/
44892
+
44893
+ Read \`node_modules/@elevasis/sdk/reference/_index.md\` for a manifest of all
44894
+ available pages. Key references:
44895
+
44896
+ - \`reference/platform-tools/index.mdx\` -- Complete platform.call() tool catalog
44897
+ - \`reference/resources/types.mdx\` -- All SDK types and exports
44898
+ - \`reference/runtime/limits.mdx\` -- Resource limits and quotas
44899
+ - \`reference/cli/index.mdx\` -- Full CLI command reference
44900
+
44901
+ Use the \`/sdk-docs\` command to browse reference documentation.
44880
44902
  `;
44881
44903
  }
44882
44904
  function claudeDocsCommandTemplate() {
@@ -45026,6 +45048,41 @@ Read .env for local environment variables.
45026
45048
  5. Remind user to redeploy after syncing
45027
45049
  `;
45028
45050
  }
45051
+ function claudeSdkDocsCommandTemplate() {
45052
+ return `# /sdk-docs command
45053
+
45054
+ You are an SDK documentation browser for this Elevasis SDK project.
45055
+
45056
+ ## Context
45057
+
45058
+ Reference documentation is bundled with the SDK package at:
45059
+
45060
+ node_modules/@elevasis/sdk/reference/
45061
+
45062
+ Read \`node_modules/@elevasis/sdk/reference/_index.md\` for the full manifest
45063
+ of available pages with titles and descriptions.
45064
+
45065
+ ## Operations
45066
+
45067
+ **No arguments (default):** Read and display the manifest at
45068
+ \`node_modules/@elevasis/sdk/reference/_index.md\`. Present the available
45069
+ documentation pages as a browsable list.
45070
+
45071
+ **\`<topic>\`:** Find and read the most relevant page(s) for the given topic.
45072
+ Match against the manifest entries. Examples:
45073
+
45074
+ - \`/sdk-docs platform-tools\` -- Read \`reference/platform-tools/index.mdx\`
45075
+ - \`/sdk-docs types\` -- Read \`reference/resources/types.mdx\`
45076
+ - \`/sdk-docs limits\` -- Read \`reference/runtime/limits.mdx\`
45077
+ - \`/sdk-docs cli\` -- Read \`reference/cli/index.mdx\`
45078
+ - \`/sdk-docs deployment\` -- Read \`reference/deployment/index.mdx\`
45079
+
45080
+ If the topic is ambiguous, show matching pages and ask which to read.
45081
+
45082
+ **\`all\`:** Read and summarize all reference pages. Provide a concise overview
45083
+ of the full SDK documentation.
45084
+ `;
45085
+ }
45029
45086
  function starterTemplate() {
45030
45087
  return `import type { WorkflowDefinition, OrganizationResources } from '@elevasis/sdk'
45031
45088
  import { z } from 'zod'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "comment:bin": "IMPORTANT: This package shares the 'elevasis' binary name with @repo/cli. They never conflict because @elevasis/sdk must NEVER be added as a dependency of any workspace package (apps/*, packages/*, organizations/*). Workspace projects use @repo/cli for the 'elevasis' binary. External developers (outside the workspace) get this SDK's binary via npm install.",
6
6
  "type": "module",
@@ -24,13 +24,9 @@
24
24
  "dist/worker/index.js",
25
25
  "dist/types/worker/index.d.ts",
26
26
  "dist/types/worker/platform.d.ts",
27
- "dist/cli.cjs"
27
+ "dist/cli.cjs",
28
+ "reference/"
28
29
  ],
29
- "scripts": {
30
- "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.core-dts.json && tsc -p tsconfig.build.json && tsup && rollup -c rollup.dts.config.mjs && esbuild src/cli/index.ts --bundle --platform=node --outfile=dist/cli.cjs --format=cjs --external:esbuild --external:jiti --banner:js=\"#!/usr/bin/env node\"",
31
- "check-types": "tsc --noEmit",
32
- "test:bundle": "pnpm build && vitest run --config vitest.bundle.config.ts"
33
- },
34
30
  "dependencies": {
35
31
  "esbuild": "^0.25.0",
36
32
  "jiti": "^2.0.0"
@@ -39,8 +35,6 @@
39
35
  "zod": "^4.1.0"
40
36
  },
41
37
  "devDependencies": {
42
- "@repo/core": "workspace:*",
43
- "@repo/typescript-config": "workspace:*",
44
38
  "@types/node": "^22.0.0",
45
39
  "chalk": "^5.3.0",
46
40
  "commander": "^11.0.0",
@@ -51,6 +45,13 @@
51
45
  "rollup-plugin-dts": "^6.3.0",
52
46
  "tsup": "^8.0.0",
53
47
  "typescript": "5.9.2",
54
- "zod": "^4.1.0"
48
+ "zod": "^4.1.0",
49
+ "@repo/core": "0.0.0",
50
+ "@repo/typescript-config": "0.0.0"
51
+ },
52
+ "scripts": {
53
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.core-dts.json && tsc -p tsconfig.build.json && tsup && rollup -c rollup.dts.config.mjs && esbuild src/cli/index.ts --bundle --platform=node --outfile=dist/cli.cjs --format=cjs --external:esbuild --external:jiti --banner:js=\"#!/usr/bin/env node\" && node scripts/copy-reference-docs.mjs",
54
+ "check-types": "tsc --noEmit",
55
+ "test:bundle": "pnpm build && vitest run --config vitest.bundle.config.ts"
55
56
  }
56
- }
57
+ }
@@ -0,0 +1,53 @@
1
+ # SDK Reference Documentation
2
+
3
+ 15 pages bundled from the Elevasis documentation site.
4
+
5
+ Browse these files for complete SDK reference including platform tools catalog,
6
+ resource types, runtime limits, deployment details, and CLI commands.
7
+
8
+ ## Pages
9
+
10
+ - **CLI Reference** -- `cli/index.mdx`
11
+ Full reference for every elevasis CLI command -- scaffold, validate, deploy, execute, and inspect resources
12
+
13
+ - **Execution API** -- `deployment/api.mdx`
14
+ REST endpoints for executing resources, querying execution history, and managing deployments via the Elevasis external API
15
+
16
+ - **Deploying Resources** -- `deployment/index.mdx`
17
+ How to deploy your Elevasis SDK resources to the platform using elevasis deploy, including configuration, validation, and environment setup
18
+
19
+ - **Resource Documentation** -- `documentation/index.mdx`
20
+ Write and deploy MDX documentation alongside your Elevasis resources
21
+
22
+ - **Getting Started** -- `getting-started/index.mdx`
23
+ Install the Elevasis SDK, scaffold a project, and run your first deployment
24
+
25
+ - **Project Structure** -- `getting-started/project-structure.mdx`
26
+ Each file scaffolded by elevasis init and its purpose in the development workflow
27
+
28
+ - **Elevasis SDK** -- `index.mdx`
29
+ Build and deploy workflows, agents, and resources with the Elevasis SDK
30
+
31
+ - **Integration Examples** -- `platform-tools/examples.mdx`
32
+ Common platform.call() patterns for email, CRM, PDF, LLM inference, resource triggering, and storage
33
+
34
+ - **Platform Tools** -- `platform-tools/index.mdx`
35
+ Access 70+ integration adapters and platform services from your SDK workflows via platform.call()
36
+
37
+ - **Writing Resources** -- `resources/index.mdx`
38
+ Guide to creating workflows and agents using WorkflowDefinition, AgentDefinition, and OrganizationResources with the Elevasis SDK
39
+
40
+ - **Common Patterns** -- `resources/patterns.mdx`
41
+ Common resource patterns for Elevasis SDK developers -- sequential steps, conditional branching, platform tools, error handling, and resource status management
42
+
43
+ - **SDK Types** -- `resources/types.mdx`
44
+ Complete type reference for @elevasis/sdk -- package exports, re-exported platform types, ElevasConfig interface, StepHandler context, and runtime values
45
+
46
+ - **Roadmap** -- `roadmap/index.mdx`
47
+ Planned SDK features -- error taxonomy, retry semantics, circuit breaker, metrics, alerting, and resource lifecycle extensions
48
+
49
+ - **Execution Runtime** -- `runtime/index.mdx`
50
+ How your code runs on the Elevasis platform -- execution lifecycle, concurrency, timeouts, cancellation, error handling, and observability
51
+
52
+ - **Resource Limits & Quotas** -- `runtime/limits.mdx`
53
+ Memory limits, execution timeouts, scale quotas, networking constraints, and v1 platform limitations for SDK resources