@elevasis/sdk 1.0.1 → 1.0.2
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 +19 -15
- package/dist/index.d.ts +1 -3
- package/dist/templates.js +1 -1
- package/dist/types/worker/index.d.ts +2 -2
- package/package.json +3 -3
- package/reference/_navigation.md +1 -1
- package/reference/deployment/command-center.mdx +6 -6
- package/reference/framework/project-structure.mdx +4 -4
- package/reference/resources/index.mdx +6 -6
- package/reference/resources/patterns.mdx +2 -2
- package/reference/resources/types.mdx +1 -1
- package/reference/runtime.mdx +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -43893,7 +43893,7 @@ function wrapAction(commandName, fn) {
|
|
|
43893
43893
|
// package.json
|
|
43894
43894
|
var package_default = {
|
|
43895
43895
|
name: "@elevasis/sdk",
|
|
43896
|
-
version: "1.0.
|
|
43896
|
+
version: "1.0.2",
|
|
43897
43897
|
description: "SDK for building Elevasis organization resources",
|
|
43898
43898
|
type: "module",
|
|
43899
43899
|
bin: {
|
|
@@ -44551,21 +44551,25 @@ function registerDeployCommand(program3) {
|
|
|
44551
44551
|
if (archivedCount > 0) {
|
|
44552
44552
|
console.log(source_default.gray(` Skipping ${archivedCount} archived resource${archivedCount !== 1 ? "s" : ""}`));
|
|
44553
44553
|
}
|
|
44554
|
-
const bumpType = options2.major ? "major" : options2.minor ? "minor" : "patch";
|
|
44554
|
+
const bumpType = options2.major ? "major" : options2.minor ? "minor" : options2.patch ? "patch" : null;
|
|
44555
44555
|
const currentVersion = org.version;
|
|
44556
|
-
|
|
44557
|
-
|
|
44558
|
-
|
|
44559
|
-
|
|
44560
|
-
|
|
44561
|
-
|
|
44562
|
-
|
|
44563
|
-
|
|
44564
|
-
|
|
44556
|
+
if (bumpType !== null) {
|
|
44557
|
+
const newVersion = bumpVersion(currentVersion, bumpType);
|
|
44558
|
+
const absEntryPath = (0, import_path.resolve)(entryPath);
|
|
44559
|
+
const entryContent = await (0, import_promises.readFile)(absEntryPath, "utf-8");
|
|
44560
|
+
const updatedContent = entryContent.replace(
|
|
44561
|
+
/version:\s*['"][\d]+\.[\d]+\.[\d]+['"]/,
|
|
44562
|
+
`version: '${newVersion}'`
|
|
44563
|
+
);
|
|
44564
|
+
await (0, import_promises.writeFile)(absEntryPath, updatedContent, "utf-8");
|
|
44565
|
+
org.version = newVersion;
|
|
44566
|
+
}
|
|
44565
44567
|
console.log("");
|
|
44566
44568
|
console.log(source_default.gray(` Org: ${orgName}`));
|
|
44567
44569
|
console.log(source_default.gray(` Target: ${apiUrl} (${env2})`));
|
|
44568
|
-
console.log(
|
|
44570
|
+
console.log(
|
|
44571
|
+
source_default.gray(` Version: ${source_default.white(org.version)}${bumpType !== null ? ` (${bumpType} bump)` : ""}`)
|
|
44572
|
+
);
|
|
44569
44573
|
console.log("");
|
|
44570
44574
|
for (const w of activeWorkflows) {
|
|
44571
44575
|
console.log(source_default.gray(` workflow ${source_default.white(w.config.resourceId)} v${w.config.version}`));
|
|
@@ -47053,7 +47057,7 @@ paths:
|
|
|
47053
47057
|
- Organize by business domain: \`src/<domain>/\` (e.g., \`src/operations/\`, \`src/acquisition/\`)
|
|
47054
47058
|
- Each domain barrel (\`src/<domain>/index.ts\`) exports \`workflows\` and \`agents\` arrays
|
|
47055
47059
|
- Cross-domain utilities go in \`src/shared/\`; domain-specific utilities in \`src/<domain>/shared/\`
|
|
47056
|
-
- The default export in \`src/index.ts\` must be
|
|
47060
|
+
- The default export in \`src/index.ts\` must be a \`DeploymentSpec\` object
|
|
47057
47061
|
- \`resourceId\` must be lowercase with hyphens, unique per organization
|
|
47058
47062
|
- \`dist/\` is generated by deploy -- never commit it
|
|
47059
47063
|
|
|
@@ -47512,11 +47516,11 @@ process.exit(0)
|
|
|
47512
47516
|
|
|
47513
47517
|
// src/cli/commands/templates/core/resources.ts
|
|
47514
47518
|
function starterTemplate() {
|
|
47515
|
-
return `import type {
|
|
47519
|
+
return `import type { DeploymentSpec } from '@elevasis/sdk'
|
|
47516
47520
|
import * as operations from './operations/index.js'
|
|
47517
47521
|
import * as example from './example/index.js'
|
|
47518
47522
|
|
|
47519
|
-
const org:
|
|
47523
|
+
const org: DeploymentSpec = {
|
|
47520
47524
|
workflows: [
|
|
47521
47525
|
...operations.workflows,
|
|
47522
47526
|
...example.workflows,
|
package/dist/index.d.ts
CHANGED
|
@@ -3505,8 +3505,6 @@ interface DeploymentSpec {
|
|
|
3505
3505
|
/** Human checkpoint definitions - human decision points in automation */
|
|
3506
3506
|
humanCheckpoints?: HumanCheckpointDefinition[];
|
|
3507
3507
|
}
|
|
3508
|
-
/** @deprecated Use DeploymentSpec instead */
|
|
3509
|
-
type OrganizationResources = DeploymentSpec;
|
|
3510
3508
|
/**
|
|
3511
3509
|
* Organization Registry type
|
|
3512
3510
|
*/
|
|
@@ -7407,4 +7405,4 @@ declare class ToolingError extends ExecutionError {
|
|
|
7407
7405
|
}
|
|
7408
7406
|
|
|
7409
7407
|
export { ExecutionError, RegistryValidationError, ResourceRegistry, StepType, ToolingError };
|
|
7410
|
-
export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqList, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, FindCompanyEmailParams as AnymailfinderFindCompanyEmailParams, FindCompanyEmailResult as AnymailfinderFindCompanyEmailResult, FindDecisionMakerEmailParams as AnymailfinderFindDecisionMakerEmailParams, FindDecisionMakerEmailResult as AnymailfinderFindDecisionMakerEmailResult, FindPersonEmailParams as AnymailfinderFindPersonEmailParams, FindPersonEmailResult as AnymailfinderFindPersonEmailResult, AnymailfinderToolMap, VerifyEmailParams as AnymailfinderVerifyEmailParams, VerifyEmailResult as AnymailfinderVerifyEmailResult, ApifyToolMap, ApifyWebhookConfig, AppendRowsParams, AppendRowsResult, ApprovalToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BulkDeleteLeadsParams, BulkDeleteLeadsResult, BulkImportParams, BulkImportResult, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, CompanyFilters, ConditionalNext, ContactFilters, Contract, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DeploymentSpec, DomainDefinition, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetDailyCampaignAnalyticsParams, GetDailyCampaignAnalyticsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, HumanCheckpointDefinition, InstantlyToolMap, IntegrationDefinition, LLMAdapterFactory, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadToolMap, LinearNext, ListAttributesParams, ListAttributesResult, ListLeadsParams, ListLeadsResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, MillionVerifierToolMap, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap,
|
|
7408
|
+
export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqList, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, FindCompanyEmailParams as AnymailfinderFindCompanyEmailParams, FindCompanyEmailResult as AnymailfinderFindCompanyEmailResult, FindDecisionMakerEmailParams as AnymailfinderFindDecisionMakerEmailParams, FindDecisionMakerEmailResult as AnymailfinderFindDecisionMakerEmailResult, FindPersonEmailParams as AnymailfinderFindPersonEmailParams, FindPersonEmailResult as AnymailfinderFindPersonEmailResult, AnymailfinderToolMap, VerifyEmailParams as AnymailfinderVerifyEmailParams, VerifyEmailResult as AnymailfinderVerifyEmailResult, ApifyToolMap, ApifyWebhookConfig, AppendRowsParams, AppendRowsResult, ApprovalToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BulkDeleteLeadsParams, BulkDeleteLeadsResult, BulkImportParams, BulkImportResult, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, CompanyFilters, ConditionalNext, ContactFilters, Contract, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DeploymentSpec, DomainDefinition, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetDailyCampaignAnalyticsParams, GetDailyCampaignAnalyticsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, HumanCheckpointDefinition, InstantlyToolMap, IntegrationDefinition, LLMAdapterFactory, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadToolMap, LinearNext, ListAttributesParams, ListAttributesResult, ListLeadsParams, ListLeadsResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, MillionVerifierToolMap, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap, PaginatedResult, PaginationParams, PdfToolMap, QueryRecordsParams, QueryRecordsResult, ReadSheetParams, ReadSheetResult, Recipient, RecurringScheduleConfig, RelationshipDeclaration, RelativeScheduleConfig, RemoveFromSubsequenceParams, RemoveFromSubsequenceResult, ResendGetEmailParams, ResendGetEmailResult, ResendSendEmailParams, ResendSendEmailResult, ResendToolMap, ResourceDefinition, ResourceDomain, ResourceMetricsConfig, ResourceRelationships, ResourceStatus$1 as ResourceStatus, ResourceType, RunActorParams, RunActorResult, SDKLLMGenerateParams, ScheduleOriginTracking, ScheduleTarget, ScheduleTriggerConfig, SchedulerToolMap, SendReplyParams, SendReplyResult, SetContactNurtureParams, SheetInfo, SignatureApiFieldType, SignatureApiToolMap, SigningPlace, SortCriteria, StartActorParams, StartActorResult, StepHandler, StorageDeleteInput, StorageDeleteOutput, StorageDownloadInput, StorageDownloadOutput, StorageListInput, StorageListOutput, StorageSignedUrlInput, StorageSignedUrlOutput, StorageToolMap, StorageUploadInput, StorageUploadOutput, StripeToolMap, SyncDealStageParams, TaskSchedule, TaskScheduleConfig, TombaToolMap, Tool, ToolExecutionOptions, ToolMethodMap, ToolingErrorType, TriggerConfig, TriggerDefinition, UpdateAttributeParams, UpdateAttributeResult, UpdateCloseLostReasonParams, UpdateCompanyParams, UpdateContactParams, UpdateDiscoveryDataParams, UpdateFeesParams, UpdateInterestStatusParams, UpdateInterestStatusResult, UpdateListParams, UpdatePaymentLinkParams, UpdatePaymentLinkResult, UpdateProposalDataParams, UpdateRecordParams, UpdateRecordResult, UpdateRowByValueParams, UpdateRowByValueResult, UploadFileParams, UploadFileResult, UpsertCompanyParams, UpsertContactParams, UpsertDealParams, UpsertRowParams, UpsertRowResult, VoidEnvelopeParams, VoidEnvelopeResult, WebhookProviderType, WebhookTriggerConfig, WorkflowConfig, WorkflowDefinition, WorkflowStep, WriteSheetParams, WriteSheetResult };
|
package/dist/templates.js
CHANGED
|
@@ -1657,7 +1657,7 @@ paths:
|
|
|
1657
1657
|
- Organize by business domain: \`src/<domain>/\` (e.g., \`src/operations/\`, \`src/acquisition/\`)
|
|
1658
1658
|
- Each domain barrel (\`src/<domain>/index.ts\`) exports \`workflows\` and \`agents\` arrays
|
|
1659
1659
|
- Cross-domain utilities go in \`src/shared/\`; domain-specific utilities in \`src/<domain>/shared/\`
|
|
1660
|
-
- The default export in \`src/index.ts\` must be
|
|
1660
|
+
- The default export in \`src/index.ts\` must be a \`DeploymentSpec\` object
|
|
1661
1661
|
- \`resourceId\` must be lowercase with hyphens, unique per organization
|
|
1662
1662
|
- \`dist/\` is generated by deploy -- never commit it
|
|
1663
1663
|
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
* Worker -> Parent: { type: 'credential-request', id, name }
|
|
27
27
|
* Parent -> Worker: { type: 'credential-result', id, provider?, credentials?, error?, code? }
|
|
28
28
|
*/
|
|
29
|
-
import type {
|
|
29
|
+
import type { DeploymentSpec } from '../index.js';
|
|
30
30
|
export { platform, PlatformToolError } from './platform.js';
|
|
31
31
|
export type { PlatformCredential } from './platform.js';
|
|
32
32
|
export * from './adapters/index.js';
|
|
33
|
-
export declare function startWorker(org:
|
|
33
|
+
export declare function startWorker(org: DeploymentSpec): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "SDK for building Elevasis organization resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"tsup": "^8.0.0",
|
|
51
51
|
"typescript": "5.9.2",
|
|
52
52
|
"zod": "^4.1.0",
|
|
53
|
-
"@repo/
|
|
54
|
-
"@repo/
|
|
53
|
+
"@repo/core": "0.0.0",
|
|
54
|
+
"@repo/typescript-config": "0.0.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"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 --banner:js=\"#!/usr/bin/env node\" && node scripts/copy-reference-docs.mjs && node scripts/generate-navigation.mjs",
|
package/reference/_navigation.md
CHANGED
|
@@ -48,7 +48,7 @@ All paths are relative to `node_modules/@elevasis/sdk/reference/`.
|
|
|
48
48
|
|
|
49
49
|
| Resource | Location | Description | When to Load |
|
|
50
50
|
| --- | --- | --- | --- |
|
|
51
|
-
| Writing Resources | `resources/index.mdx` | Guide to creating workflows and agents using WorkflowDefinition, AgentDefinition, and
|
|
51
|
+
| Writing Resources | `resources/index.mdx` | Guide to creating workflows and agents using WorkflowDefinition, AgentDefinition, and DeploymentSpec with the Elevasis SDK | Building or modifying a workflow |
|
|
52
52
|
| Common Patterns | `resources/patterns.mdx` | Common resource patterns for Elevasis SDK developers -- sequential steps, conditional branching, platform tools, error handling, and resource status management | Building or modifying a workflow |
|
|
53
53
|
| SDK Types | `resources/types.mdx` | Complete type reference for @elevasis/sdk -- package exports, re-exported platform types, ElevasConfig interface, StepHandler context, and runtime values | Looking up type signatures or SDK exports |
|
|
54
54
|
|
|
@@ -23,7 +23,7 @@ The Command Center is the browser UI for interacting with deployed resources. Af
|
|
|
23
23
|
|
|
24
24
|
## Command View
|
|
25
25
|
|
|
26
|
-
The Command View is a visual graph of your deployed resources. Each node is a resource (workflow, agent, trigger, integration). Edges are the relationships you declared in `
|
|
26
|
+
The Command View is a visual graph of your deployed resources. Each node is a resource (workflow, agent, trigger, integration). Edges are the relationships you declared in `DeploymentSpec`.
|
|
27
27
|
|
|
28
28
|
**What you can do here:**
|
|
29
29
|
|
|
@@ -54,10 +54,10 @@ Every resource you deploy becomes a node in the graph. Some nodes are executable
|
|
|
54
54
|
|
|
55
55
|
### Relationships
|
|
56
56
|
|
|
57
|
-
Relationships are edges in the graph. Declare them in `
|
|
57
|
+
Relationships are edges in the graph. Declare them in `DeploymentSpec`:
|
|
58
58
|
|
|
59
59
|
```typescript
|
|
60
|
-
const org:
|
|
60
|
+
const org: DeploymentSpec = {
|
|
61
61
|
workflows: [scoreLeadWorkflow, sendProposalWorkflow],
|
|
62
62
|
relationships: {
|
|
63
63
|
'score-lead': {
|
|
@@ -98,7 +98,7 @@ Keep relationships in sync with your handler code. When you add an `execution.tr
|
|
|
98
98
|
`elevasis-sdk deploy` and `elevasis-sdk check` both validate:
|
|
99
99
|
|
|
100
100
|
- Duplicate resource IDs
|
|
101
|
-
- Relationship targets must exist in the same `
|
|
101
|
+
- Relationship targets must exist in the same `DeploymentSpec`
|
|
102
102
|
- Agent model params (provider, model name, temperature bounds)
|
|
103
103
|
- Workflow step chains (`next.target` must point to existing step names)
|
|
104
104
|
|
|
@@ -106,14 +106,14 @@ Keep relationships in sync with your handler code. When you add an `execution.tr
|
|
|
106
106
|
|
|
107
107
|
```
|
|
108
108
|
ERROR Relationship target 'send-proposal' not found in organization resources
|
|
109
|
-
ERROR Duplicate resource ID 'score-lead' in
|
|
109
|
+
ERROR Duplicate resource ID 'score-lead' in deployment
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
### Graph Serialization
|
|
113
113
|
|
|
114
114
|
The platform converts your definitions into `CommandViewNode` (one per resource) and `CommandViewEdge` (one per relationship) structures. `buildEdges()` reads your `relationships` declarations and produces edges as a pure transformation -- no runtime behavior is inferred.
|
|
115
115
|
|
|
116
|
-
> **SDK takeaway:** Declare relationships in `
|
|
116
|
+
> **SDK takeaway:** Declare relationships in `DeploymentSpec` to keep the Command View accurate as your system grows. Update declarations whenever you add or remove `execution.trigger()` calls.
|
|
117
117
|
|
|
118
118
|
---
|
|
119
119
|
|
|
@@ -12,14 +12,14 @@ loadWhen: "Understanding scaffolded files or project layout"
|
|
|
12
12
|
|
|
13
13
|
### `src/index.ts`
|
|
14
14
|
|
|
15
|
-
The registry entry point for your workspace. This file aggregates resources from domain barrel files and re-exports them as
|
|
15
|
+
The registry entry point for your workspace. This file aggregates resources from domain barrel files and re-exports them as a `DeploymentSpec` default export. It does not contain workflow logic itself -- its sole job is aggregation:
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import type {
|
|
18
|
+
import type { DeploymentSpec } from '@elevasis/sdk'
|
|
19
19
|
import * as operations from './operations/index.js'
|
|
20
20
|
import * as example from './example/index.js'
|
|
21
21
|
|
|
22
|
-
const org:
|
|
22
|
+
const org: DeploymentSpec = {
|
|
23
23
|
workflows: [
|
|
24
24
|
...operations.workflows,
|
|
25
25
|
...example.workflows,
|
|
@@ -187,7 +187,7 @@ The most important file for AI-assisted development. It provides Claude Code wit
|
|
|
187
187
|
|
|
188
188
|
- **Project orientation** -- what an Elevasis SDK project is and how it works
|
|
189
189
|
- **Project structure** -- which files contain resources, documentation, and configuration
|
|
190
|
-
- **SDK patterns** -- working code examples for resource definitions, Zod schemas, and the `
|
|
190
|
+
- **SDK patterns** -- working code examples for resource definitions, Zod schemas, and the `DeploymentSpec` export
|
|
191
191
|
- **CLI reference** -- all commands with flags (`check`, `deploy`, `exec`, `resources`, `executions`, `execution`, `deployments`, `env list/set/remove`)
|
|
192
192
|
- **Development rules** -- conventions the agent should enforce (source in `src/`, docs in `docs/`, use `@elevasis/sdk` types only)
|
|
193
193
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Writing Resources
|
|
3
|
-
description: Guide to creating workflows and agents using WorkflowDefinition, AgentDefinition, and
|
|
3
|
+
description: Guide to creating workflows and agents using WorkflowDefinition, AgentDefinition, and DeploymentSpec with the Elevasis SDK
|
|
4
4
|
loadWhen: "Building or modifying a workflow"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
Resources are the building blocks of your Elevasis project. A resource is a workflow or agent definition that the platform can execute on your behalf. You define them in TypeScript, export them from a single entry point, and the platform handles scheduling, retries, logging, and execution.
|
|
8
8
|
|
|
9
|
-
This page covers how to structure your resources, write step handlers, and export everything through `
|
|
9
|
+
This page covers how to structure your resources, write step handlers, and export everything through `DeploymentSpec`.
|
|
10
10
|
|
|
11
11
|
## WorkflowDefinition
|
|
12
12
|
|
|
@@ -289,14 +289,14 @@ const myAgent: AgentDefinition = {
|
|
|
289
289
|
|
|
290
290
|
---
|
|
291
291
|
|
|
292
|
-
##
|
|
292
|
+
## DeploymentSpec
|
|
293
293
|
|
|
294
|
-
All resources must be exported through
|
|
294
|
+
All resources must be exported through a `DeploymentSpec` default export from `src/index.ts`. This is the entry point the platform reads when you deploy.
|
|
295
295
|
|
|
296
296
|
```typescript
|
|
297
|
-
import type {
|
|
297
|
+
import type { DeploymentSpec } from '@elevasis/sdk';
|
|
298
298
|
|
|
299
|
-
const org:
|
|
299
|
+
const org: DeploymentSpec = {
|
|
300
300
|
workflows: [echoWorkflow, pipeline],
|
|
301
301
|
agents: [
|
|
302
302
|
// myAgent,
|
|
@@ -330,11 +330,11 @@ export const workflows = [sendInvoice];
|
|
|
330
330
|
export const agents = [];
|
|
331
331
|
|
|
332
332
|
// src/index.ts
|
|
333
|
-
import type {
|
|
333
|
+
import type { DeploymentSpec } from '@elevasis/sdk';
|
|
334
334
|
import * as orders from './orders/index.js';
|
|
335
335
|
import * as billing from './billing/index.js';
|
|
336
336
|
|
|
337
|
-
const org:
|
|
337
|
+
const org: DeploymentSpec = {
|
|
338
338
|
workflows: [
|
|
339
339
|
...orders.workflows,
|
|
340
340
|
...billing.workflows,
|
|
@@ -45,7 +45,7 @@ All types come from the platform core. The SDK re-exports them grouped by source
|
|
|
45
45
|
| `ResourceStatus` | Enum: `'dev' | 'prod'` |
|
|
46
46
|
| `ResourceDomain` | Domain classification for a resource |
|
|
47
47
|
| `DomainDefinition` | Structure for grouping resources by domain |
|
|
48
|
-
| `
|
|
48
|
+
| `DeploymentSpec` | Top-level export shape: `{ workflows, agents }` |
|
|
49
49
|
| `TriggerDefinition` | Base for trigger configuration |
|
|
50
50
|
| `IntegrationDefinition` | Integration configuration structure |
|
|
51
51
|
| `WebhookProviderType` | Supported webhook providers |
|
package/reference/runtime.mdx
CHANGED
|
@@ -109,7 +109,7 @@ v1 versioning is intentionally simple:
|
|
|
109
109
|
|
|
110
110
|
### Deletion
|
|
111
111
|
|
|
112
|
-
- **Via CLI:** Remove the resource from your `
|
|
112
|
+
- **Via CLI:** Remove the resource from your `DeploymentSpec` export and run `elevasis-sdk deploy`. Resources absent from the new bundle are automatically deregistered from the platform.
|
|
113
113
|
- **Via AI Studio:** The delete button unregisters the resource immediately and marks the deployment stopped.
|
|
114
114
|
- **In-flight executions:** Workers already running complete normally. Deletion affects only new execution attempts.
|
|
115
115
|
- **Data retention:** Execution logs and history for a deleted resource are retained for 30 days, then purged.
|