@elevasis/sdk 0.4.6 → 0.4.7

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 (41) hide show
  1. package/dist/cli.cjs +814 -451
  2. package/dist/index.d.ts +79 -14
  3. package/dist/index.js +17 -12
  4. package/dist/templates.js +747 -0
  5. package/dist/types/templates.d.ts +1 -0
  6. package/dist/types/worker/index.d.ts +6 -0
  7. package/dist/types/worker/platform.d.ts +32 -0
  8. package/dist/worker/index.js +4701 -9
  9. package/package.json +16 -10
  10. package/reference/_index.md +48 -6
  11. package/reference/_navigation.md +104 -0
  12. package/reference/cli/index.mdx +2 -1
  13. package/reference/concepts/index.mdx +203 -0
  14. package/reference/deployment/api.mdx +1 -0
  15. package/reference/deployment/index.mdx +1 -0
  16. package/reference/developer/interaction-guidance.mdx +213 -0
  17. package/reference/framework/agent.mdx +175 -0
  18. package/reference/{documentation/index.mdx → framework/documentation.mdx} +1 -0
  19. package/reference/framework/index.mdx +95 -0
  20. package/reference/framework/memory.mdx +337 -0
  21. package/reference/framework/project-structure.mdx +294 -0
  22. package/reference/getting-started/index.mdx +39 -15
  23. package/reference/index.mdx +10 -2
  24. package/reference/platform-tools/examples.mdx +1 -0
  25. package/reference/platform-tools/index.mdx +43 -2
  26. package/reference/resources/index.mdx +1 -0
  27. package/reference/resources/patterns.mdx +2 -1
  28. package/reference/resources/types.mdx +1 -0
  29. package/reference/roadmap/index.mdx +1 -0
  30. package/reference/runtime/index.mdx +1 -0
  31. package/reference/runtime/limits.mdx +1 -0
  32. package/reference/security/credentials.mdx +141 -0
  33. package/reference/templates/data-enrichment.mdx +162 -0
  34. package/reference/templates/email-sender.mdx +135 -0
  35. package/reference/templates/lead-scorer.mdx +175 -0
  36. package/reference/templates/pdf-generator.mdx +151 -0
  37. package/reference/templates/recurring-job.mdx +189 -0
  38. package/reference/templates/text-classifier.mdx +147 -0
  39. package/reference/templates/web-scraper.mdx +135 -0
  40. package/reference/troubleshooting/common-errors.mdx +210 -0
  41. package/reference/getting-started/project-structure.mdx +0 -148
@@ -0,0 +1 @@
1
+ export { claudeMdTemplate, claudeMetaCommandTemplate, claudeProfileCommandTemplate, claudeDocsCommandTemplate, claudeResourceCommandTemplate, claudeTutorialCommandTemplate, claudeHelpCommandTemplate, claudeTemplatesCommandTemplate, claudeDatabaseCommandTemplate, claudeAgentCommandTemplate, gitignoreTemplate, claudeSettingsTemplate, starterWorkflowTemplate, } from './cli/commands/init.js';
@@ -13,7 +13,13 @@
13
13
  *
14
14
  * Worker -> Parent: { type: 'tool-call', id, tool, method, params, credential? }
15
15
  * Parent -> Worker: { type: 'tool-result', id, result?, error?, code? }
16
+ *
17
+ * Worker -> Parent: { type: 'message-event', executionId, event } (agent lifecycle events)
18
+ *
19
+ * Worker -> Parent: { type: 'credential-request', id, name }
20
+ * Parent -> Worker: { type: 'credential-result', id, provider?, credentials?, error?, code? }
16
21
  */
17
22
  import type { OrganizationResources } from '../index.js';
18
23
  export { platform, PlatformToolError } from './platform.js';
24
+ export type { PlatformCredential } from './platform.js';
19
25
  export declare function startWorker(org: OrganizationResources): void;
@@ -13,6 +13,20 @@ interface ToolResultMessage {
13
13
  error?: string;
14
14
  code?: string;
15
15
  }
16
+ /** Inbound credential-result from parent */
17
+ interface CredentialResultMessage {
18
+ type: 'credential-result';
19
+ id: string;
20
+ provider?: string;
21
+ credentials?: Record<string, string>;
22
+ error?: string;
23
+ code?: string;
24
+ }
25
+ /** Resolved credential returned by platform.getCredential() */
26
+ export interface PlatformCredential {
27
+ provider: string;
28
+ credentials: Record<string, string>;
29
+ }
16
30
  export declare class PlatformToolError extends Error {
17
31
  /** ToolingErrorType code from the platform */
18
32
  readonly code: string;
@@ -29,6 +43,11 @@ export declare class PlatformToolError extends Error {
29
43
  * Called from the parentPort.on('message') handler in index.ts.
30
44
  */
31
45
  export declare function handleToolResult(msg: ToolResultMessage): void;
46
+ /**
47
+ * Handle a credential-result message from the parent process.
48
+ * Called from the parentPort.on('message') handler in index.ts.
49
+ */
50
+ export declare function handleCredentialResult(msg: CredentialResultMessage): void;
32
51
  export declare const platform: {
33
52
  /**
34
53
  * Call a platform tool from the worker thread.
@@ -46,5 +65,18 @@ export declare const platform: {
46
65
  params?: unknown;
47
66
  credential?: string;
48
67
  }): Promise<unknown>;
68
+ /**
69
+ * Request raw credential access from the platform.
70
+ *
71
+ * This is an explicit opt-in that causes the credential's secret values
72
+ * to enter worker memory. Use only when you need to initialise a
73
+ * third-party SDK (e.g. `new Stripe(key)`). Prefer `platform.call()`
74
+ * with the `http` tool for server-side credential injection.
75
+ *
76
+ * @param name - Credential name as configured in the command center
77
+ * @returns Promise resolving to { provider, credentials }
78
+ * @throws PlatformToolError on failure (credential not found, raw access denied, etc.)
79
+ */
80
+ getCredential(name: string): Promise<PlatformCredential>;
49
81
  };
50
82
  export {};