@elevasis/sdk 0.4.12 → 0.4.14
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 +293 -32
- package/dist/index.d.ts +1 -1
- package/dist/templates.js +22 -5
- package/dist/types/worker/adapters/apify.d.ts +14 -0
- package/dist/types/worker/adapters/approval.d.ts +23 -0
- package/dist/types/worker/adapters/attio.d.ts +22 -0
- package/dist/types/worker/adapters/create-adapter.d.ts +41 -0
- package/dist/types/worker/adapters/dropbox.d.ts +14 -0
- package/dist/types/worker/adapters/email.d.ts +25 -0
- package/dist/types/worker/adapters/execution.d.ts +22 -0
- package/dist/types/worker/adapters/gmail.d.ts +14 -0
- package/dist/types/worker/adapters/google-sheets.d.ts +14 -0
- package/dist/types/worker/adapters/index.d.ts +29 -0
- package/dist/types/worker/adapters/instantly.d.ts +14 -0
- package/dist/types/worker/adapters/lead.d.ts +28 -0
- package/dist/types/worker/adapters/llm.d.ts +30 -0
- package/dist/types/worker/adapters/mailso.d.ts +14 -0
- package/dist/types/worker/adapters/notification.d.ts +28 -0
- package/dist/types/worker/adapters/notion.d.ts +14 -0
- package/dist/types/worker/adapters/pdf.d.ts +22 -0
- package/dist/types/worker/adapters/resend.d.ts +14 -0
- package/dist/types/worker/adapters/scheduler.d.ts +25 -0
- package/dist/types/worker/adapters/signature-api.d.ts +14 -0
- package/dist/types/worker/adapters/storage.d.ts +33 -0
- package/dist/types/worker/adapters/stripe.d.ts +14 -0
- package/dist/types/worker/adapters/trello.d.ts +14 -0
- package/dist/types/worker/index.d.ts +3 -1
- package/dist/worker/index.js +5 -1
- package/package.json +2 -1
- package/reference/framework/agent.mdx +5 -2
- package/reference/platform-tools/adapters.mdx +3 -1
- package/reference/platform-tools/index.mdx +5 -6
package/dist/cli.cjs
CHANGED
|
@@ -43830,7 +43830,7 @@ async function apiDelete(endpoint, apiUrl = resolveApiUrl()) {
|
|
|
43830
43830
|
// package.json
|
|
43831
43831
|
var package_default = {
|
|
43832
43832
|
name: "@elevasis/sdk",
|
|
43833
|
-
version: "0.4.
|
|
43833
|
+
version: "0.4.14",
|
|
43834
43834
|
description: "SDK for building Elevasis organization resources",
|
|
43835
43835
|
"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.",
|
|
43836
43836
|
type: "module",
|
|
@@ -43858,6 +43858,7 @@ var package_default = {
|
|
|
43858
43858
|
"dist/worker/index.js",
|
|
43859
43859
|
"dist/types/worker/index.d.ts",
|
|
43860
43860
|
"dist/types/worker/platform.d.ts",
|
|
43861
|
+
"dist/types/worker/adapters/",
|
|
43861
43862
|
"dist/cli.cjs",
|
|
43862
43863
|
"dist/templates.js",
|
|
43863
43864
|
"dist/types/templates.d.ts",
|
|
@@ -44060,6 +44061,12 @@ function registerDeployCommand(program3) {
|
|
|
44060
44061
|
if (documentation) {
|
|
44061
44062
|
console.log(source_default.gray(` docs ${source_default.white(String(documentation.length))} file${documentation.length !== 1 ? "s" : ""}`));
|
|
44062
44063
|
}
|
|
44064
|
+
const triggerCount = org.triggers?.length ?? 0;
|
|
44065
|
+
const integrationCount = org.integrations?.length ?? 0;
|
|
44066
|
+
const checkpointCount = org.humanCheckpoints?.length ?? 0;
|
|
44067
|
+
if (triggerCount > 0) console.log(source_default.gray(` triggers ${source_default.white(String(triggerCount))}`));
|
|
44068
|
+
if (integrationCount > 0) console.log(source_default.gray(` integrations ${source_default.white(String(integrationCount))}`));
|
|
44069
|
+
if (checkpointCount > 0) console.log(source_default.gray(` checkpoints ${source_default.white(String(checkpointCount))}`));
|
|
44063
44070
|
const relationshipCount = org.relationships ? Object.keys(org.relationships).length : 0;
|
|
44064
44071
|
if (relationshipCount > 0) {
|
|
44065
44072
|
console.log(source_default.gray(` rels ${source_default.white(String(relationshipCount))} resource${relationshipCount !== 1 ? "s" : ""}`));
|
|
@@ -44583,31 +44590,46 @@ var MANAGED_FILES = [
|
|
|
44583
44590
|
".claude/commands/work.md",
|
|
44584
44591
|
".claude/skills/creds/SKILL.md"
|
|
44585
44592
|
];
|
|
44593
|
+
var UI_INIT_FILES = [
|
|
44594
|
+
"ui/package.json",
|
|
44595
|
+
"ui/index.html",
|
|
44596
|
+
"ui/vite.config.ts",
|
|
44597
|
+
"ui/tsconfig.json",
|
|
44598
|
+
"ui/src/main.tsx",
|
|
44599
|
+
"ui/src/App.tsx",
|
|
44600
|
+
"ui/src/AuthRedirect.tsx",
|
|
44601
|
+
"ui/src/vite-env.d.ts",
|
|
44602
|
+
"ui/.env",
|
|
44603
|
+
"ui/.env.example"
|
|
44604
|
+
];
|
|
44586
44605
|
var SCAFFOLD_FILES = [...INIT_ONLY_FILES, ...MANAGED_FILES];
|
|
44587
|
-
|
|
44588
|
-
|
|
44589
|
-
|
|
44590
|
-
|
|
44591
|
-
|
|
44592
|
-
|
|
44593
|
-
|
|
44594
|
-
|
|
44595
|
-
|
|
44596
|
-
|
|
44597
|
-
|
|
44598
|
-
|
|
44599
|
-
|
|
44600
|
-
|
|
44601
|
-
|
|
44602
|
-
|
|
44603
|
-
|
|
44606
|
+
function getManagedTemplates(ctx = {}) {
|
|
44607
|
+
return {
|
|
44608
|
+
"elevasis.config.ts": configTemplate,
|
|
44609
|
+
".gitignore": () => gitignoreTemplate(ctx),
|
|
44610
|
+
"CLAUDE.md": () => claudeMdTemplate(ctx),
|
|
44611
|
+
".claude/settings.json": claudeSettingsTemplate,
|
|
44612
|
+
".claude/commands/docs.md": claudeDocsCommandTemplate,
|
|
44613
|
+
".claude/commands/resource.md": claudeResourceCommandTemplate,
|
|
44614
|
+
".claude/commands/tutorial.md": claudeTutorialCommandTemplate,
|
|
44615
|
+
".claude/commands/help.md": claudeHelpCommandTemplate,
|
|
44616
|
+
".claude/commands/templates.md": claudeTemplatesCommandTemplate,
|
|
44617
|
+
".claude/commands/database.md": claudeDatabaseCommandTemplate,
|
|
44618
|
+
".claude/commands/agent.md": claudeAgentCommandTemplate,
|
|
44619
|
+
".claude/commands/profile.md": claudeProfileCommandTemplate,
|
|
44620
|
+
".claude/commands/meta.md": claudeMetaCommandTemplate,
|
|
44621
|
+
".claude/commands/work.md": claudeWorkCommandTemplate,
|
|
44622
|
+
".claude/skills/creds/SKILL.md": claudeCredsSkillTemplate
|
|
44623
|
+
};
|
|
44624
|
+
}
|
|
44604
44625
|
function registerInitCommand(program3) {
|
|
44605
|
-
program3.command("init [directory]").description("Scaffold a new Elevasis workspace\n Example: elevasis init my-workspace").option("--force", "Overwrite existing files").action(wrapAction("init", async (directory, options2) => {
|
|
44626
|
+
program3.command("init [directory]").description("Scaffold a new Elevasis workspace\n Example: elevasis init my-workspace").option("--force", "Overwrite existing files").option("--ui", "Include a Vite + React UI app in ui/").action(wrapAction("init", async (directory, options2) => {
|
|
44606
44627
|
const targetDir = directory ? (0, import_path3.resolve)(directory) : process.cwd();
|
|
44607
44628
|
const orgSlug = toSlug((0, import_path3.basename)(targetDir));
|
|
44608
44629
|
if (!options2.force) {
|
|
44630
|
+
const filesToCheck = options2.ui ? [...SCAFFOLD_FILES, ...UI_INIT_FILES] : SCAFFOLD_FILES;
|
|
44609
44631
|
const conflicts = [];
|
|
44610
|
-
for (const file2 of
|
|
44632
|
+
for (const file2 of filesToCheck) {
|
|
44611
44633
|
try {
|
|
44612
44634
|
await (0, import_promises2.access)((0, import_path3.resolve)(targetDir, file2));
|
|
44613
44635
|
conflicts.push(file2);
|
|
@@ -44629,6 +44651,9 @@ function registerInitCommand(program3) {
|
|
|
44629
44651
|
await (0, import_promises2.mkdir)((0, import_path3.resolve)(targetDir, "docs/in-progress"), { recursive: true });
|
|
44630
44652
|
await (0, import_promises2.mkdir)((0, import_path3.resolve)(targetDir, ".claude/commands"), { recursive: true });
|
|
44631
44653
|
await (0, import_promises2.mkdir)((0, import_path3.resolve)(targetDir, ".claude/skills/creds"), { recursive: true });
|
|
44654
|
+
if (options2.ui) {
|
|
44655
|
+
await (0, import_promises2.mkdir)((0, import_path3.resolve)(targetDir, "ui/src"), { recursive: true });
|
|
44656
|
+
}
|
|
44632
44657
|
const files = {
|
|
44633
44658
|
"elevasis.config.ts": configTemplate(),
|
|
44634
44659
|
"package.json": packageJsonTemplate(orgSlug),
|
|
@@ -44637,7 +44662,7 @@ function registerInitCommand(program3) {
|
|
|
44637
44662
|
".env": envTemplate(),
|
|
44638
44663
|
".env.example": envExampleTemplate(),
|
|
44639
44664
|
".npmrc": npmrcTemplate(),
|
|
44640
|
-
".gitignore": gitignoreTemplate(),
|
|
44665
|
+
".gitignore": gitignoreTemplate({ hasUI: options2.ui }),
|
|
44641
44666
|
"src/index.ts": starterTemplate(),
|
|
44642
44667
|
"src/operations/platform-status.ts": platformStatusTemplate(),
|
|
44643
44668
|
"src/operations/index.ts": operationsBarrelTemplate(),
|
|
@@ -44646,7 +44671,7 @@ function registerInitCommand(program3) {
|
|
|
44646
44671
|
"src/shared/.gitkeep": "",
|
|
44647
44672
|
"docs/index.mdx": docsIndexTemplate(orgSlug),
|
|
44648
44673
|
"docs/in-progress/.gitkeep": "",
|
|
44649
|
-
"CLAUDE.md": claudeMdTemplate(),
|
|
44674
|
+
"CLAUDE.md": claudeMdTemplate({ hasUI: options2.ui }),
|
|
44650
44675
|
".claude/settings.json": claudeSettingsTemplate(),
|
|
44651
44676
|
".claude/commands/docs.md": claudeDocsCommandTemplate(),
|
|
44652
44677
|
".claude/commands/resource.md": claudeResourceCommandTemplate(),
|
|
@@ -44660,6 +44685,9 @@ function registerInitCommand(program3) {
|
|
|
44660
44685
|
".claude/commands/work.md": claudeWorkCommandTemplate(),
|
|
44661
44686
|
".claude/skills/creds/SKILL.md": claudeCredsSkillTemplate()
|
|
44662
44687
|
};
|
|
44688
|
+
if (options2.ui) {
|
|
44689
|
+
Object.assign(files, getUIFiles(orgSlug));
|
|
44690
|
+
}
|
|
44663
44691
|
for (const [filePath, content] of Object.entries(files)) {
|
|
44664
44692
|
await (0, import_promises2.writeFile)((0, import_path3.resolve)(targetDir, filePath), content, "utf-8");
|
|
44665
44693
|
}
|
|
@@ -44673,6 +44701,13 @@ function registerInitCommand(program3) {
|
|
|
44673
44701
|
console.log(source_default.gray(" # Copy .env.example to .env and add your API key"));
|
|
44674
44702
|
console.log(source_default.gray(" elevasis check"));
|
|
44675
44703
|
console.log(source_default.gray(" elevasis deploy"));
|
|
44704
|
+
if (options2.ui) {
|
|
44705
|
+
console.log("");
|
|
44706
|
+
console.log(source_default.gray(" UI app:"));
|
|
44707
|
+
console.log(source_default.gray(" cd ui && pnpm install"));
|
|
44708
|
+
console.log(source_default.gray(" # Set VITE_WORKOS_CLIENT_ID in ui/.env"));
|
|
44709
|
+
console.log(source_default.gray(" pnpm dev"));
|
|
44710
|
+
}
|
|
44676
44711
|
}));
|
|
44677
44712
|
}
|
|
44678
44713
|
function toSlug(name) {
|
|
@@ -44740,14 +44775,20 @@ function npmrcTemplate() {
|
|
|
44740
44775
|
return `auto-install-peers = true
|
|
44741
44776
|
`;
|
|
44742
44777
|
}
|
|
44743
|
-
function gitignoreTemplate() {
|
|
44744
|
-
|
|
44778
|
+
function gitignoreTemplate(ctx = {}) {
|
|
44779
|
+
let content = `node_modules/
|
|
44745
44780
|
.env
|
|
44746
44781
|
dist/
|
|
44747
44782
|
__elevasis_worker.ts
|
|
44748
44783
|
.claude/settings.local.json
|
|
44749
44784
|
.claude/memory/
|
|
44750
44785
|
`;
|
|
44786
|
+
if (ctx.hasUI) {
|
|
44787
|
+
content += `ui/node_modules/
|
|
44788
|
+
ui/dist/
|
|
44789
|
+
`;
|
|
44790
|
+
}
|
|
44791
|
+
return content;
|
|
44751
44792
|
}
|
|
44752
44793
|
function docsIndexTemplate(organization) {
|
|
44753
44794
|
return `---
|
|
@@ -44823,7 +44864,7 @@ elevasis exec echo --input '{"message": "hello"}'
|
|
|
44823
44864
|
function claudeSettingsTemplate() {
|
|
44824
44865
|
return JSON.stringify({ autoCompact: false }, null, 2) + "\n";
|
|
44825
44866
|
}
|
|
44826
|
-
function claudeMdTemplate() {
|
|
44867
|
+
function claudeMdTemplate(ctx = {}) {
|
|
44827
44868
|
return `<!-- initialized: false -->
|
|
44828
44869
|
|
|
44829
44870
|
# CLAUDE.md
|
|
@@ -44876,7 +44917,8 @@ proactivity -- to their assessed levels.
|
|
|
44876
44917
|
| Project resource map | \`docs/navigation.mdx\` | Understanding what's deployed |
|
|
44877
44918
|
| Project priorities | \`docs/priorities.mdx\` | Deciding what to work on next |
|
|
44878
44919
|
| User profile and skills | \`.claude/memory/profile/skills.md\` | Session start (mandatory) |
|
|
44879
|
-
| Cross-session memory | \`.claude/memory/index.md\` | Session start, recalling past context
|
|
44920
|
+
| Cross-session memory | \`.claude/memory/index.md\` | Session start, recalling past context |${ctx.hasUI ? `
|
|
44921
|
+
| UI app source | \`ui/src/\` | Modifying the frontend, adding routes or components |` : ""}
|
|
44880
44922
|
|
|
44881
44923
|
All \`reference/\` paths resolve to \`node_modules/@elevasis/sdk/reference/\`.
|
|
44882
44924
|
|
|
@@ -44898,7 +44940,17 @@ All \`reference/\` paths resolve to \`node_modules/@elevasis/sdk/reference/\`.
|
|
|
44898
44940
|
- When an error occurs, check \`.claude/memory/errors/\` first for past fixes.
|
|
44899
44941
|
If the error is new, check \`reference/troubleshooting/common-errors.mdx\`.
|
|
44900
44942
|
After resolving, record the error in \`memory/errors/\` with context and fix.
|
|
44901
|
-
If an error recurs 3+ times, promote it to a rule in this section.
|
|
44943
|
+
If an error recurs 3+ times, promote it to a rule in this section.${ctx.hasUI ? `
|
|
44944
|
+
|
|
44945
|
+
### UI App (\`ui/\`)
|
|
44946
|
+
|
|
44947
|
+
- \`ui/\` is a standalone Vite + React app with its own \`package.json\` -- not part of the pnpm workspace
|
|
44948
|
+
- Import from \`@elevasis/sdk-ui\`, never from \`@elevasis/sdk\` or \`@repo/ui\`
|
|
44949
|
+
- Dev server runs on port 5100: \`cd ui && pnpm dev\`
|
|
44950
|
+
- Set \`VITE_WORKOS_CLIENT_ID\` in \`ui/.env\` before running
|
|
44951
|
+
- \`ElevasisProvider\` is pre-configured in \`ui/src/App.tsx\` (oauth mode, redirectUri \`http://localhost:5100/auth-redirect\`, apiUrl \`http://localhost:5170\`)
|
|
44952
|
+
- OAuth redirect is handled by the \`AuthRedirect\` component at \`/auth-redirect\` -- it uses \`useAuthContext()\` from \`@elevasis/sdk-ui/auth\` and navigates home once \`user\` is set
|
|
44953
|
+
- API must be running on port 5170 for the UI to work (\`pnpm --filter api dev\` from the platform monorepo)` : ""}
|
|
44902
44954
|
|
|
44903
44955
|
## Interaction Guidance
|
|
44904
44956
|
|
|
@@ -45837,12 +45889,166 @@ export const workflows = [echo]
|
|
|
45837
45889
|
export const agents = []
|
|
45838
45890
|
`;
|
|
45839
45891
|
}
|
|
45892
|
+
function getUIFiles(orgSlug) {
|
|
45893
|
+
return {
|
|
45894
|
+
"ui/package.json": uiPackageJsonTemplate(orgSlug),
|
|
45895
|
+
"ui/index.html": uiIndexHtmlTemplate(),
|
|
45896
|
+
"ui/vite.config.ts": uiViteConfigTemplate(),
|
|
45897
|
+
"ui/tsconfig.json": uiTsconfigTemplate(),
|
|
45898
|
+
"ui/src/main.tsx": uiMainTsxTemplate(),
|
|
45899
|
+
"ui/src/App.tsx": uiAppTsxTemplate(),
|
|
45900
|
+
"ui/src/AuthRedirect.tsx": uiAuthRedirectTemplate(),
|
|
45901
|
+
"ui/src/vite-env.d.ts": uiViteEnvDtsTemplate(),
|
|
45902
|
+
"ui/.env": uiEnvTemplate(),
|
|
45903
|
+
"ui/.env.example": uiEnvExampleTemplate()
|
|
45904
|
+
};
|
|
45905
|
+
}
|
|
45906
|
+
function uiPackageJsonTemplate(orgSlug) {
|
|
45907
|
+
return JSON.stringify({
|
|
45908
|
+
name: `${orgSlug}-ui`,
|
|
45909
|
+
private: true,
|
|
45910
|
+
type: "module",
|
|
45911
|
+
scripts: {
|
|
45912
|
+
dev: "vite",
|
|
45913
|
+
build: "tsc && vite build",
|
|
45914
|
+
preview: "vite preview"
|
|
45915
|
+
},
|
|
45916
|
+
dependencies: {
|
|
45917
|
+
"@elevasis/sdk-ui": "latest",
|
|
45918
|
+
"@mantine/core": "^8.0.0",
|
|
45919
|
+
"@mantine/hooks": "^8.0.0",
|
|
45920
|
+
"react": "^19.0.0",
|
|
45921
|
+
"react-dom": "^19.0.0",
|
|
45922
|
+
"react-router-dom": "^7.0.0"
|
|
45923
|
+
},
|
|
45924
|
+
devDependencies: {
|
|
45925
|
+
"@types/react": "^19.0.0",
|
|
45926
|
+
"@types/react-dom": "^19.0.0",
|
|
45927
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
45928
|
+
"typescript": "^5.7.0",
|
|
45929
|
+
"vite": "^6.0.0"
|
|
45930
|
+
}
|
|
45931
|
+
}, null, 2) + "\n";
|
|
45932
|
+
}
|
|
45933
|
+
function uiIndexHtmlTemplate() {
|
|
45934
|
+
return `<!doctype html>
|
|
45935
|
+
<html lang="en">
|
|
45936
|
+
<head>
|
|
45937
|
+
<meta charset="UTF-8" />
|
|
45938
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
45939
|
+
<title>Elevasis UI</title>
|
|
45940
|
+
</head>
|
|
45941
|
+
<body>
|
|
45942
|
+
<div id="root"></div>
|
|
45943
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
45944
|
+
</body>
|
|
45945
|
+
</html>
|
|
45946
|
+
`;
|
|
45947
|
+
}
|
|
45948
|
+
function uiViteConfigTemplate() {
|
|
45949
|
+
return `import { defineConfig } from 'vite'
|
|
45950
|
+
import react from '@vitejs/plugin-react'
|
|
45951
|
+
|
|
45952
|
+
export default defineConfig({
|
|
45953
|
+
plugins: [react()],
|
|
45954
|
+
server: {
|
|
45955
|
+
port: 5100,
|
|
45956
|
+
},
|
|
45957
|
+
})
|
|
45958
|
+
`;
|
|
45959
|
+
}
|
|
45960
|
+
function uiTsconfigTemplate() {
|
|
45961
|
+
return JSON.stringify({
|
|
45962
|
+
compilerOptions: {
|
|
45963
|
+
target: "ES2022",
|
|
45964
|
+
lib: ["ES2022", "DOM", "DOM.Iterable"],
|
|
45965
|
+
module: "ESNext",
|
|
45966
|
+
moduleResolution: "bundler",
|
|
45967
|
+
jsx: "react-jsx",
|
|
45968
|
+
strict: true,
|
|
45969
|
+
esModuleInterop: true,
|
|
45970
|
+
skipLibCheck: true,
|
|
45971
|
+
forceConsistentCasingInFileNames: true,
|
|
45972
|
+
isolatedModules: true,
|
|
45973
|
+
noEmit: true
|
|
45974
|
+
},
|
|
45975
|
+
include: ["src"]
|
|
45976
|
+
}, null, 2) + "\n";
|
|
45977
|
+
}
|
|
45978
|
+
function uiMainTsxTemplate() {
|
|
45979
|
+
return `import { StrictMode } from 'react'
|
|
45980
|
+
import { createRoot } from 'react-dom/client'
|
|
45981
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
45982
|
+
import { App } from './App'
|
|
45983
|
+
|
|
45984
|
+
createRoot(document.getElementById('root')!).render(
|
|
45985
|
+
<StrictMode>
|
|
45986
|
+
<BrowserRouter>
|
|
45987
|
+
<App />
|
|
45988
|
+
</BrowserRouter>
|
|
45989
|
+
</StrictMode>,
|
|
45990
|
+
)
|
|
45991
|
+
`;
|
|
45992
|
+
}
|
|
45993
|
+
function uiAppTsxTemplate() {
|
|
45994
|
+
return `import { Routes, Route } from 'react-router-dom'
|
|
45995
|
+
import { ElevasisProvider } from '@elevasis/sdk-ui'
|
|
45996
|
+
import { AuthRedirect } from './AuthRedirect'
|
|
45997
|
+
|
|
45998
|
+
export function App() {
|
|
45999
|
+
return (
|
|
46000
|
+
<ElevasisProvider
|
|
46001
|
+
mode="oauth"
|
|
46002
|
+
clientId={import.meta.env.VITE_WORKOS_CLIENT_ID}
|
|
46003
|
+
redirectUri="http://localhost:5100/auth-redirect"
|
|
46004
|
+
apiUrl="http://localhost:5170"
|
|
46005
|
+
>
|
|
46006
|
+
<Routes>
|
|
46007
|
+
<Route path="/" element={<h1>Home</h1>} />
|
|
46008
|
+
<Route path="/auth-redirect" element={<AuthRedirect />} />
|
|
46009
|
+
</Routes>
|
|
46010
|
+
</ElevasisProvider>
|
|
46011
|
+
)
|
|
46012
|
+
}
|
|
46013
|
+
`;
|
|
46014
|
+
}
|
|
46015
|
+
function uiAuthRedirectTemplate() {
|
|
46016
|
+
return `import { useEffect } from 'react'
|
|
46017
|
+
import { useNavigate } from 'react-router-dom'
|
|
46018
|
+
import { useAuthContext } from '@elevasis/sdk-ui/auth'
|
|
46019
|
+
|
|
46020
|
+
export function AuthRedirect() {
|
|
46021
|
+
const { user } = useAuthContext()
|
|
46022
|
+
const navigate = useNavigate()
|
|
46023
|
+
|
|
46024
|
+
useEffect(() => {
|
|
46025
|
+
if (user) {
|
|
46026
|
+
navigate('/', { replace: true })
|
|
46027
|
+
}
|
|
46028
|
+
}, [user, navigate])
|
|
46029
|
+
|
|
46030
|
+
return <p>Signing in...</p>
|
|
46031
|
+
}
|
|
46032
|
+
`;
|
|
46033
|
+
}
|
|
46034
|
+
function uiViteEnvDtsTemplate() {
|
|
46035
|
+
return `/// <reference types="vite/client" />
|
|
46036
|
+
`;
|
|
46037
|
+
}
|
|
46038
|
+
function uiEnvTemplate() {
|
|
46039
|
+
return `VITE_WORKOS_CLIENT_ID=
|
|
46040
|
+
`;
|
|
46041
|
+
}
|
|
46042
|
+
function uiEnvExampleTemplate() {
|
|
46043
|
+
return `VITE_WORKOS_CLIENT_ID=your_workos_client_id
|
|
46044
|
+
`;
|
|
46045
|
+
}
|
|
45840
46046
|
|
|
45841
46047
|
// src/cli/commands/update.ts
|
|
45842
46048
|
var import_path4 = require("path");
|
|
45843
46049
|
var import_promises3 = require("fs/promises");
|
|
45844
46050
|
function registerUpdateCommand(program3) {
|
|
45845
|
-
program3.command("update").description("Update project scaffold to latest template version").action(wrapAction("update", async () => {
|
|
46051
|
+
program3.command("update").description("Update project scaffold to latest template version").option("--ui", "Add a Vite + React UI app in ui/").action(wrapAction("update", async (options2 = {}) => {
|
|
45846
46052
|
const cwd = process.cwd();
|
|
45847
46053
|
const configPath = (0, import_path4.resolve)(cwd, "elevasis.config.ts");
|
|
45848
46054
|
let currentVersion = 0;
|
|
@@ -45855,16 +46061,28 @@ function registerUpdateCommand(program3) {
|
|
|
45855
46061
|
}
|
|
45856
46062
|
} catch {
|
|
45857
46063
|
}
|
|
45858
|
-
|
|
46064
|
+
const upToDate = currentVersion >= TEMPLATE_VERSION;
|
|
46065
|
+
if (upToDate && !options2.ui) {
|
|
45859
46066
|
console.log(source_default.green(` Project is up to date (template version ${TEMPLATE_VERSION})`));
|
|
45860
46067
|
return;
|
|
45861
46068
|
}
|
|
46069
|
+
let hasUI = !!options2.ui;
|
|
46070
|
+
if (!hasUI) {
|
|
46071
|
+
try {
|
|
46072
|
+
await (0, import_promises3.access)((0, import_path4.resolve)(cwd, "ui"));
|
|
46073
|
+
hasUI = true;
|
|
46074
|
+
} catch {
|
|
46075
|
+
}
|
|
46076
|
+
}
|
|
46077
|
+
const managedTemplates = getManagedTemplates({ hasUI });
|
|
45862
46078
|
const added = [];
|
|
45863
46079
|
const flagged = [];
|
|
45864
46080
|
const appendedGitignore = [];
|
|
45865
|
-
|
|
46081
|
+
const uiAffectedFiles = /* @__PURE__ */ new Set([".gitignore", "CLAUDE.md"]);
|
|
46082
|
+
const filesToProcess = upToDate ? MANAGED_FILES.filter((f) => uiAffectedFiles.has(f)) : MANAGED_FILES;
|
|
46083
|
+
for (const file2 of filesToProcess) {
|
|
45866
46084
|
const filePath = (0, import_path4.resolve)(cwd, file2);
|
|
45867
|
-
const templateFn =
|
|
46085
|
+
const templateFn = managedTemplates[file2];
|
|
45868
46086
|
if (!templateFn) continue;
|
|
45869
46087
|
const templateContent = templateFn();
|
|
45870
46088
|
if (file2 === ".gitignore") {
|
|
@@ -45933,8 +46151,34 @@ function registerUpdateCommand(program3) {
|
|
|
45933
46151
|
}
|
|
45934
46152
|
}
|
|
45935
46153
|
}
|
|
46154
|
+
const uiAdded = [];
|
|
46155
|
+
const uiSkipped = [];
|
|
46156
|
+
if (options2.ui) {
|
|
46157
|
+
const orgSlug = (0, import_path4.basename)(cwd).toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/^[^a-z]+/, "").replace(/-+/g, "-").replace(/-$/, "") || "my-workspace";
|
|
46158
|
+
await (0, import_promises3.mkdir)((0, import_path4.resolve)(cwd, "ui/src"), { recursive: true });
|
|
46159
|
+
const uiFiles = getUIFiles(orgSlug);
|
|
46160
|
+
for (const [file2, content] of Object.entries(uiFiles)) {
|
|
46161
|
+
const filePath = (0, import_path4.resolve)(cwd, file2);
|
|
46162
|
+
let exists = false;
|
|
46163
|
+
try {
|
|
46164
|
+
await (0, import_promises3.access)(filePath);
|
|
46165
|
+
exists = true;
|
|
46166
|
+
} catch {
|
|
46167
|
+
}
|
|
46168
|
+
if (!exists) {
|
|
46169
|
+
await (0, import_promises3.writeFile)(filePath, content, "utf-8");
|
|
46170
|
+
uiAdded.push(file2);
|
|
46171
|
+
} else {
|
|
46172
|
+
uiSkipped.push(file2);
|
|
46173
|
+
}
|
|
46174
|
+
}
|
|
46175
|
+
}
|
|
45936
46176
|
console.log("");
|
|
45937
|
-
|
|
46177
|
+
if (upToDate) {
|
|
46178
|
+
console.log(source_default.green.bold(` Added UI to project (template version ${TEMPLATE_VERSION})`));
|
|
46179
|
+
} else {
|
|
46180
|
+
console.log(source_default.green.bold(` Updated @elevasis/sdk template v${currentVersion} -> v${TEMPLATE_VERSION}`));
|
|
46181
|
+
}
|
|
45938
46182
|
if (added.length > 0) {
|
|
45939
46183
|
console.log("");
|
|
45940
46184
|
console.log(" Added:");
|
|
@@ -45961,6 +46205,23 @@ function registerUpdateCommand(program3) {
|
|
|
45961
46205
|
console.log(source_default.gray(" Run /meta update in Claude Code to merge flagged files."));
|
|
45962
46206
|
console.log(source_default.gray(" Or run /meta fix to verify and repair the full framework."));
|
|
45963
46207
|
}
|
|
46208
|
+
if (uiAdded.length > 0) {
|
|
46209
|
+
console.log("");
|
|
46210
|
+
console.log(" UI scaffold added:");
|
|
46211
|
+
for (const file2 of uiAdded) {
|
|
46212
|
+
console.log(source_default.green(` ${file2}`));
|
|
46213
|
+
}
|
|
46214
|
+
console.log("");
|
|
46215
|
+
console.log(source_default.gray(" Next: cd ui && pnpm install"));
|
|
46216
|
+
console.log(source_default.gray(" Set VITE_WORKOS_CLIENT_ID in ui/.env"));
|
|
46217
|
+
}
|
|
46218
|
+
if (uiSkipped.length > 0) {
|
|
46219
|
+
console.log("");
|
|
46220
|
+
console.log(" UI files already exist (skipped):");
|
|
46221
|
+
for (const file2 of uiSkipped) {
|
|
46222
|
+
console.log(source_default.gray(` ${file2}`));
|
|
46223
|
+
}
|
|
46224
|
+
}
|
|
45964
46225
|
console.log("");
|
|
45965
46226
|
}));
|
|
45966
46227
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -6355,4 +6355,4 @@ declare class ToolingError extends ExecutionError {
|
|
|
6355
6355
|
}
|
|
6356
6356
|
|
|
6357
6357
|
export { ExecutionError, RegistryValidationError, ResourceRegistry, StepType, ToolingError };
|
|
6358
|
-
export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqList, AddChecklistItemParams, AddChecklistItemResult, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, ApifyToolMap, AppendBlocksParams, AppendBlocksResult, AppendRowsParams, AppendRowsResult, ApprovalToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BulkImportParams, BulkImportResult, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, CompanyFilters, ConditionalNext, ContactFilters, Contract, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCardParams, CreateCardResult, CreateChecklistParams, CreateChecklistResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePageParams, CreatePageResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, DeleteBlocksParams, DeleteBlocksResult, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeletePageParams, DeletePageResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DomainDefinition, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetBoardParams, GetBoardResult, GetCardChecklistsParams, GetCardChecklistsResult, GetCardsParams, GetCardsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetListsParams, GetListsResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, InstantlyToolMap, IntegrationDefinition, LLMAdapterFactory, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadToolMap, LinearNext, ListAllPagesResult, ListAttributesParams, ListAttributesResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, MailsoToolMap, MailsoVerifyEmailParams, MailsoVerifyEmailResult, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap, NotionToolMap, OrganizationResources, PageWithChildren, PaginatedResult, PaginationParams$1 as PaginationParams, PdfToolMap, QueryRecordsParams, QueryRecordsResult, ReadPageParams, ReadPageResult, ReadSheetParams, ReadSheetResult, Recipient, RecurringScheduleConfig, RelationshipDeclaration, RelativeScheduleConfig, RemoveFromSubsequenceParams, RemoveFromSubsequenceResult, ResendGetEmailParams, ResendGetEmailResult, ResendSendEmailParams, ResendSendEmailResult, ResendToolMap, ResourceDefinition, ResourceDomain, ResourceMetricsConfig, ResourceRelationships, ResourceStatus, ResourceType, RunActorParams, RunActorResult, ScheduleOriginTracking, ScheduleTarget, ScheduleTriggerConfig, SchedulerToolMap, SendReplyParams, SendReplyResult, SetContactNurtureParams, SheetInfo, SignatureApiFieldType, SignatureApiToolMap, SigningPlace, SortCriteria, StepHandler, StorageDeleteInput, StorageDeleteOutput, StorageDownloadInput, StorageDownloadOutput, StorageListInput, StorageListOutput, StorageSignedUrlInput, StorageSignedUrlOutput, StorageToolMap, StorageUploadInput, StorageUploadOutput, StripeToolMap, SyncDealStageParams, TaskSchedule, TaskScheduleConfig, Tool, ToolExecutionOptions, ToolMethodMap, ToolingErrorType, TrelloCreateListParams, TrelloCreateListResult, TrelloToolMap, TriggerConfig, TriggerDefinition, UpdateAttributeParams, UpdateAttributeResult, UpdateBlocksParams, UpdateBlocksResult, UpdateCardParams, UpdateCardResult, UpdateChecklistItemParams, UpdateChecklistItemResult, UpdateCloseLostReasonParams, UpdateCompanyParams, UpdateContactParams, UpdateDiscoveryDataParams, UpdateFeesParams, UpdateInterestStatusParams, UpdateInterestStatusResult, UpdateListParams, UpdatePageTitleParams, UpdatePageTitleResult, UpdatePaymentLinkParams, UpdatePaymentLinkResult, UpdateProposalDataParams, UpdateRecordParams, UpdateRecordResult, UpdateRowByValueParams, UpdateRowByValueResult, UploadFileParams, UploadFileResult, UpsertCompanyParams, UpsertContactParams, UpsertDealParams, UpsertRowParams, UpsertRowResult, VoidEnvelopeParams, VoidEnvelopeResult, WebhookProviderType, WebhookTriggerConfig, WorkflowConfig, WorkflowDefinition, WorkflowStep, WriteSheetParams, WriteSheetResult };
|
|
6358
|
+
export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqList, AddChecklistItemParams, AddChecklistItemResult, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, ApifyToolMap, AppendBlocksParams, AppendBlocksResult, AppendRowsParams, AppendRowsResult, ApprovalToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BulkImportParams, BulkImportResult, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, CompanyFilters, ConditionalNext, ContactFilters, Contract, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCardParams, CreateCardResult, CreateChecklistParams, CreateChecklistResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePageParams, CreatePageResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, DeleteBlocksParams, DeleteBlocksResult, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeletePageParams, DeletePageResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DomainDefinition, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetBoardParams, GetBoardResult, GetCardChecklistsParams, GetCardChecklistsResult, GetCardsParams, GetCardsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetListsParams, GetListsResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, HumanCheckpointDefinition, InstantlyToolMap, IntegrationDefinition, LLMAdapterFactory, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadToolMap, LinearNext, ListAllPagesResult, ListAttributesParams, ListAttributesResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, MailsoToolMap, MailsoVerifyEmailParams, MailsoVerifyEmailResult, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap, NotionToolMap, OrganizationResources, PageWithChildren, PaginatedResult, PaginationParams$1 as PaginationParams, PdfToolMap, QueryRecordsParams, QueryRecordsResult, ReadPageParams, ReadPageResult, ReadSheetParams, ReadSheetResult, Recipient, RecurringScheduleConfig, RelationshipDeclaration, RelativeScheduleConfig, RemoveFromSubsequenceParams, RemoveFromSubsequenceResult, ResendGetEmailParams, ResendGetEmailResult, ResendSendEmailParams, ResendSendEmailResult, ResendToolMap, ResourceDefinition, ResourceDomain, ResourceMetricsConfig, ResourceRelationships, ResourceStatus, ResourceType, RunActorParams, RunActorResult, ScheduleOriginTracking, ScheduleTarget, ScheduleTriggerConfig, SchedulerToolMap, SendReplyParams, SendReplyResult, SetContactNurtureParams, SheetInfo, SignatureApiFieldType, SignatureApiToolMap, SigningPlace, SortCriteria, StepHandler, StorageDeleteInput, StorageDeleteOutput, StorageDownloadInput, StorageDownloadOutput, StorageListInput, StorageListOutput, StorageSignedUrlInput, StorageSignedUrlOutput, StorageToolMap, StorageUploadInput, StorageUploadOutput, StripeToolMap, SyncDealStageParams, TaskSchedule, TaskScheduleConfig, Tool, ToolExecutionOptions, ToolMethodMap, ToolingErrorType, TrelloCreateListParams, TrelloCreateListResult, TrelloToolMap, TriggerConfig, TriggerDefinition, UpdateAttributeParams, UpdateAttributeResult, UpdateBlocksParams, UpdateBlocksResult, UpdateCardParams, UpdateCardResult, UpdateChecklistItemParams, UpdateChecklistItemResult, UpdateCloseLostReasonParams, UpdateCompanyParams, UpdateContactParams, UpdateDiscoveryDataParams, UpdateFeesParams, UpdateInterestStatusParams, UpdateInterestStatusResult, UpdateListParams, UpdatePageTitleParams, UpdatePageTitleResult, 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
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
function gitignoreTemplate() {
|
|
3
|
-
|
|
2
|
+
function gitignoreTemplate(ctx = {}) {
|
|
3
|
+
let content = `node_modules/
|
|
4
4
|
.env
|
|
5
5
|
dist/
|
|
6
6
|
__elevasis_worker.ts
|
|
7
7
|
.claude/settings.local.json
|
|
8
8
|
.claude/memory/
|
|
9
9
|
`;
|
|
10
|
+
if (ctx.hasUI) {
|
|
11
|
+
content += `ui/node_modules/
|
|
12
|
+
ui/dist/
|
|
13
|
+
`;
|
|
14
|
+
}
|
|
15
|
+
return content;
|
|
10
16
|
}
|
|
11
17
|
function claudeSettingsTemplate() {
|
|
12
18
|
return JSON.stringify({ autoCompact: false }, null, 2) + "\n";
|
|
13
19
|
}
|
|
14
|
-
function claudeMdTemplate() {
|
|
20
|
+
function claudeMdTemplate(ctx = {}) {
|
|
15
21
|
return `<!-- initialized: false -->
|
|
16
22
|
|
|
17
23
|
# CLAUDE.md
|
|
@@ -64,7 +70,8 @@ proactivity -- to their assessed levels.
|
|
|
64
70
|
| Project resource map | \`docs/navigation.mdx\` | Understanding what's deployed |
|
|
65
71
|
| Project priorities | \`docs/priorities.mdx\` | Deciding what to work on next |
|
|
66
72
|
| User profile and skills | \`.claude/memory/profile/skills.md\` | Session start (mandatory) |
|
|
67
|
-
| Cross-session memory | \`.claude/memory/index.md\` | Session start, recalling past context
|
|
73
|
+
| Cross-session memory | \`.claude/memory/index.md\` | Session start, recalling past context |${ctx.hasUI ? `
|
|
74
|
+
| UI app source | \`ui/src/\` | Modifying the frontend, adding routes or components |` : ""}
|
|
68
75
|
|
|
69
76
|
All \`reference/\` paths resolve to \`node_modules/@elevasis/sdk/reference/\`.
|
|
70
77
|
|
|
@@ -86,7 +93,17 @@ All \`reference/\` paths resolve to \`node_modules/@elevasis/sdk/reference/\`.
|
|
|
86
93
|
- When an error occurs, check \`.claude/memory/errors/\` first for past fixes.
|
|
87
94
|
If the error is new, check \`reference/troubleshooting/common-errors.mdx\`.
|
|
88
95
|
After resolving, record the error in \`memory/errors/\` with context and fix.
|
|
89
|
-
If an error recurs 3+ times, promote it to a rule in this section.
|
|
96
|
+
If an error recurs 3+ times, promote it to a rule in this section.${ctx.hasUI ? `
|
|
97
|
+
|
|
98
|
+
### UI App (\`ui/\`)
|
|
99
|
+
|
|
100
|
+
- \`ui/\` is a standalone Vite + React app with its own \`package.json\` -- not part of the pnpm workspace
|
|
101
|
+
- Import from \`@elevasis/sdk-ui\`, never from \`@elevasis/sdk\` or \`@repo/ui\`
|
|
102
|
+
- Dev server runs on port 5100: \`cd ui && pnpm dev\`
|
|
103
|
+
- Set \`VITE_WORKOS_CLIENT_ID\` in \`ui/.env\` before running
|
|
104
|
+
- \`ElevasisProvider\` is pre-configured in \`ui/src/App.tsx\` (oauth mode, redirectUri \`http://localhost:5100/auth-redirect\`, apiUrl \`http://localhost:5170\`)
|
|
105
|
+
- OAuth redirect is handled by the \`AuthRedirect\` component at \`/auth-redirect\` -- it uses \`useAuthContext()\` from \`@elevasis/sdk-ui/auth\` and navigates home once \`user\` is set
|
|
106
|
+
- API must be running on port 5170 for the UI to work (\`pnpm --filter api dev\` from the platform monorepo)` : ""}
|
|
90
107
|
|
|
91
108
|
## Interaction Guidance
|
|
92
109
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apify Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Apify actor operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { ApifyToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Apify adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 1 typed method for Apify actor operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createApifyAdapter(credential: string): import("./create-adapter.js").TypedAdapter<ApifyToolMap>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Approval Platform Tool Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for HITL (human-in-the-loop) tasks.
|
|
5
|
+
* Singleton export -- no credential needed (platform tool).
|
|
6
|
+
*/
|
|
7
|
+
import type { ApprovalToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Typed approval adapter for creating and managing HITL tasks.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { approval } from '@elevasis/sdk/worker'
|
|
14
|
+
*
|
|
15
|
+
* const task = await approval.create({
|
|
16
|
+
* actions: [{ id: 'approve', label: 'Approve', type: 'primary' }],
|
|
17
|
+
* context: { dealId: 'deal-123' },
|
|
18
|
+
* description: 'Review proposal for Acme Corp',
|
|
19
|
+
* humanCheckpoint: 'proposal-review',
|
|
20
|
+
* })
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const approval: import("./create-adapter.js").TypedAdapter<ApprovalToolMap>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attio Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Attio CRM operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*
|
|
7
|
+
* Types are shared with the server-side Attio adapter via @repo/core/execution.
|
|
8
|
+
*/
|
|
9
|
+
import type { AttioToolMap } from '../../types/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create a typed Attio adapter bound to a specific credential.
|
|
12
|
+
*
|
|
13
|
+
* @param credential - Credential name as configured in the command center
|
|
14
|
+
* @returns Object with 12 typed methods for Attio CRM operations
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const attio = createAttioAdapter('my-attio-credential')
|
|
19
|
+
* const records = await attio.listRecords({ object: 'deals', filter: { ... } })
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function createAttioAdapter(credential: string): import("./create-adapter.js").TypedAdapter<AttioToolMap>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic Typed Adapter Factory
|
|
3
|
+
*
|
|
4
|
+
* Given a ToolMethodMap type, tool name, and optional credential,
|
|
5
|
+
* generates a fully typed object where each key is a method name
|
|
6
|
+
* and each value is a typed function that calls platform.call().
|
|
7
|
+
*
|
|
8
|
+
* Eliminates: manual `as Promise<T>` casts, stringly-typed method names,
|
|
9
|
+
* per-method boilerplate.
|
|
10
|
+
*/
|
|
11
|
+
/** A single method entry: what params go in, what result comes out */
|
|
12
|
+
interface MethodEntry {
|
|
13
|
+
params: unknown;
|
|
14
|
+
result: unknown;
|
|
15
|
+
}
|
|
16
|
+
/** A tool's complete method map */
|
|
17
|
+
type ToolMethodMap = Record<string, MethodEntry>;
|
|
18
|
+
/**
|
|
19
|
+
* Derive the typed adapter interface from a ToolMethodMap.
|
|
20
|
+
* Methods with `Record<string, never>` params become zero-arg functions.
|
|
21
|
+
*/
|
|
22
|
+
export type TypedAdapter<TMap extends ToolMethodMap> = {
|
|
23
|
+
[K in keyof TMap]: TMap[K]['params'] extends Record<string, never> ? () => Promise<TMap[K]['result']> : (params: TMap[K]['params']) => Promise<TMap[K]['result']>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Create a typed adapter for a platform or integration tool.
|
|
27
|
+
*
|
|
28
|
+
* @param tool - Tool name (e.g., 'attio', 'storage', 'scheduler')
|
|
29
|
+
* @param methods - Array of method name strings (must match TMap keys -- misspellings are compile errors)
|
|
30
|
+
* @param credential - Optional credential name (required for integration tools)
|
|
31
|
+
* @returns Fully typed adapter object
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const attio = createAdapter<AttioToolMap>('attio', ['createRecord', 'listRecords', ...], 'my-cred')
|
|
36
|
+
* const result = await attio.createRecord({ object: 'deals', ... })
|
|
37
|
+
* // ^-- CreateRecordResult (fully typed)
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function createAdapter<TMap extends ToolMethodMap>(tool: string, methods: (keyof TMap & string)[], credential?: string): TypedAdapter<TMap>;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dropbox Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Dropbox file operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { DropboxToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Dropbox adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 2 typed methods for Dropbox file operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createDropboxAdapter(credential: string): import("./create-adapter.js").TypedAdapter<DropboxToolMap>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email Platform Tool Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for sending platform emails.
|
|
5
|
+
* Singleton export -- no credential needed (platform tool).
|
|
6
|
+
*
|
|
7
|
+
* Note: This is for internal organization notifications (from notifications@elevasis.io).
|
|
8
|
+
* For client-facing emails, use the resend or instantly integration adapters.
|
|
9
|
+
*/
|
|
10
|
+
import type { EmailToolMap } from '../../types/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Typed email adapter for sending platform emails to organization members.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { email } from '@elevasis/sdk/worker'
|
|
17
|
+
*
|
|
18
|
+
* await email.send({
|
|
19
|
+
* subject: 'New deal closed',
|
|
20
|
+
* text: 'Acme Corp has signed the contract.',
|
|
21
|
+
* targetAll: true,
|
|
22
|
+
* })
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const email: import("./create-adapter.js").TypedAdapter<EmailToolMap>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution Platform Tool Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for cross-resource invocation.
|
|
5
|
+
* Singleton export -- no credential needed (platform tool).
|
|
6
|
+
*/
|
|
7
|
+
import type { ExecutionToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Typed execution adapter for triggering other resources (workflows/agents).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { execution } from '@elevasis/sdk/worker'
|
|
14
|
+
*
|
|
15
|
+
* const result = await execution.trigger({
|
|
16
|
+
* resourceId: 'acq-04-demo-send-link-workflow',
|
|
17
|
+
* input: { contactEmail: 'jane@acme.com' },
|
|
18
|
+
* })
|
|
19
|
+
* console.log(result.executionId)
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const execution: import("./create-adapter.js").TypedAdapter<ExecutionToolMap>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gmail Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Gmail operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { GmailToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Gmail adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 1 typed method for Gmail operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createGmailAdapter(credential: string): import("./create-adapter.js").TypedAdapter<GmailToolMap>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Sheets Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Google Sheets operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { GoogleSheetsToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Google Sheets adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 13 typed methods for Google Sheets operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createGoogleSheetsAdapter(credential: string): import("./create-adapter.js").TypedAdapter<GoogleSheetsToolMap>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK Adapters Barrel
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all typed adapters for platform.call() wrappers.
|
|
5
|
+
* Integration adapters use factory pattern (credential binding).
|
|
6
|
+
* Platform tool adapters are singletons.
|
|
7
|
+
*/
|
|
8
|
+
export { createAdapter, type TypedAdapter } from './create-adapter.js';
|
|
9
|
+
export { createAttioAdapter } from './attio.js';
|
|
10
|
+
export { createApifyAdapter } from './apify.js';
|
|
11
|
+
export { createDropboxAdapter } from './dropbox.js';
|
|
12
|
+
export { createGmailAdapter } from './gmail.js';
|
|
13
|
+
export { createGoogleSheetsAdapter } from './google-sheets.js';
|
|
14
|
+
export { createInstantlyAdapter } from './instantly.js';
|
|
15
|
+
export { createMailsoAdapter } from './mailso.js';
|
|
16
|
+
export { createNotionAdapter } from './notion.js';
|
|
17
|
+
export { createResendAdapter } from './resend.js';
|
|
18
|
+
export { createSignatureApiAdapter } from './signature-api.js';
|
|
19
|
+
export { createStripeAdapter } from './stripe.js';
|
|
20
|
+
export { createTrelloAdapter } from './trello.js';
|
|
21
|
+
export { scheduler } from './scheduler.js';
|
|
22
|
+
export { llm } from './llm.js';
|
|
23
|
+
export { storage } from './storage.js';
|
|
24
|
+
export { notifications, type NotificationInput } from './notification.js';
|
|
25
|
+
export { lead } from './lead.js';
|
|
26
|
+
export { pdf } from './pdf.js';
|
|
27
|
+
export { approval } from './approval.js';
|
|
28
|
+
export { execution } from './execution.js';
|
|
29
|
+
export { email } from './email.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instantly Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Instantly email outreach operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { InstantlyToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Instantly adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 5 typed methods for Instantly email outreach operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createInstantlyAdapter(credential: string): import("./create-adapter.js").TypedAdapter<InstantlyToolMap>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lead Platform Tool Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for acquisition lead management.
|
|
5
|
+
* Singleton export -- no credential needed (platform tool).
|
|
6
|
+
*
|
|
7
|
+
* 35 methods covering lists, companies, contacts, deals, and deal-sync operations.
|
|
8
|
+
* organizationId is injected server-side by the dispatcher -- never sent from the SDK.
|
|
9
|
+
*/
|
|
10
|
+
import { type TypedAdapter } from './create-adapter.js';
|
|
11
|
+
import type { LeadToolMap } from '../../types/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* Typed lead adapter for acquisition data management.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { lead } from '@elevasis/sdk/worker'
|
|
18
|
+
*
|
|
19
|
+
* const deal = await lead.getDealByEmail({ email: 'jane@acme.com' })
|
|
20
|
+
* if (!deal) {
|
|
21
|
+
* const newDeal = await lead.upsertDeal({
|
|
22
|
+
* attioDealId: 'deal-123',
|
|
23
|
+
* contactEmail: 'jane@acme.com',
|
|
24
|
+
* })
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const lead: TypedAdapter<LeadToolMap>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Platform Tool Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for LLM generation.
|
|
5
|
+
* Singleton export -- no credential needed (platform tool).
|
|
6
|
+
*
|
|
7
|
+
* Types are shared with the server-side LLM engine via @repo/core/execution.
|
|
8
|
+
*/
|
|
9
|
+
import type { LLMGenerateRequest, LLMGenerateResponse } from '../../types/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Typed LLM adapter for structured output generation.
|
|
12
|
+
*
|
|
13
|
+
* Note: The `signal` property on LLMGenerateRequest is NOT serializable
|
|
14
|
+
* over the postMessage boundary. Abort signals are handled at the worker
|
|
15
|
+
* level via the parent process sending an 'abort' message.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { llm } from '@elevasis/sdk/worker'
|
|
20
|
+
*
|
|
21
|
+
* const response = await llm.generate({
|
|
22
|
+
* messages: [{ role: 'user', content: 'Summarize this document...' }],
|
|
23
|
+
* responseSchema: { type: 'object', properties: { summary: { type: 'string' } } },
|
|
24
|
+
* })
|
|
25
|
+
* console.log(response.output)
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const llm: {
|
|
29
|
+
generate: <T = unknown>(params: Omit<LLMGenerateRequest, "signal">) => Promise<LLMGenerateResponse<T>>;
|
|
30
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mailso Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Mails.so email verification operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { MailsoToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Mailso adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 1 typed method for Mails.so email verification
|
|
13
|
+
*/
|
|
14
|
+
export declare function createMailsoAdapter(credential: string): import("./create-adapter.js").TypedAdapter<MailsoToolMap>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Platform Tool Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for sending team notifications.
|
|
5
|
+
* Singleton export -- no credential needed (platform tool).
|
|
6
|
+
*
|
|
7
|
+
* NotificationInput is derived from CreateNotificationParams via Omit,
|
|
8
|
+
* since userId and organizationId are injected server-side from the execution context.
|
|
9
|
+
*/
|
|
10
|
+
import type { NotificationToolMap, NotificationSDKInput } from '../../types/index.js';
|
|
11
|
+
/** @deprecated Use NotificationSDKInput directly. Kept for backward compatibility. */
|
|
12
|
+
export type NotificationInput = NotificationSDKInput;
|
|
13
|
+
/**
|
|
14
|
+
* Typed notification adapter for sending team notifications.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { notifications } from '@elevasis/sdk/worker'
|
|
19
|
+
*
|
|
20
|
+
* await notifications.create({
|
|
21
|
+
* category: 'acquisition',
|
|
22
|
+
* title: 'New lead qualified',
|
|
23
|
+
* message: 'Acme Corp has been qualified and moved to proposal stage.',
|
|
24
|
+
* actionUrl: '/deals/deal-123',
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const notifications: import("./create-adapter.js").TypedAdapter<NotificationToolMap>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notion Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Notion page operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { NotionToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Notion adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 8 typed methods for Notion page operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createNotionAdapter(credential: string): import("./create-adapter.js").TypedAdapter<NotionToolMap>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDF Platform Tool Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for PDF rendering.
|
|
5
|
+
* Singleton export -- no credential needed (platform tool).
|
|
6
|
+
*/
|
|
7
|
+
import type { PdfToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Typed PDF adapter for document rendering.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { pdf } from '@elevasis/sdk/worker'
|
|
14
|
+
*
|
|
15
|
+
* const result = await pdf.render({
|
|
16
|
+
* document: { pages: [...] },
|
|
17
|
+
* storage: { bucket: 'acquisition', path: 'proposals/doc.pdf' },
|
|
18
|
+
* })
|
|
19
|
+
* console.log(result.pdfUrl)
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const pdf: import("./create-adapter.js").TypedAdapter<PdfToolMap>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resend Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Resend email operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { ResendToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Resend adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 2 typed methods for Resend email operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createResendAdapter(credential: string): import("./create-adapter.js").TypedAdapter<ResendToolMap>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduler Platform Tool Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for task schedule operations.
|
|
5
|
+
* Singleton export -- no credential needed (platform tool).
|
|
6
|
+
*
|
|
7
|
+
* Types are shared with the server-side scheduler via @repo/core/execution.
|
|
8
|
+
*/
|
|
9
|
+
import type { SchedulerToolMap } from '../../types/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Typed scheduler adapter for creating and managing task schedules.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { scheduler } from '@elevasis/sdk/worker'
|
|
16
|
+
*
|
|
17
|
+
* const schedule = await scheduler.createSchedule({
|
|
18
|
+
* organizationId: '...',
|
|
19
|
+
* name: 'Follow-up sequence',
|
|
20
|
+
* target: { resourceType: 'workflow', resourceId: 'follow-up' },
|
|
21
|
+
* scheduleConfig: { type: 'relative', anchorAt: '2026-03-15', items: [...] },
|
|
22
|
+
* })
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const scheduler: import("./create-adapter.js").TypedAdapter<SchedulerToolMap>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SignatureAPI Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for SignatureAPI eSignature operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { SignatureApiToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed SignatureAPI adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 4 typed methods for SignatureAPI eSignature operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createSignatureApiAdapter(credential: string): import("./create-adapter.js").TypedAdapter<SignatureApiToolMap>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage Platform Tool Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Supabase Storage operations.
|
|
5
|
+
* Singleton export -- no credential needed (platform tool).
|
|
6
|
+
*
|
|
7
|
+
* Types are shared with the server-side storage tools via @repo/core/execution.
|
|
8
|
+
*/
|
|
9
|
+
import type { StorageToolMap } from '../../types/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Typed storage adapter for file upload, download, and management.
|
|
12
|
+
*
|
|
13
|
+
* All paths are relative to the organization's storage prefix.
|
|
14
|
+
* The platform injects the organization prefix server-side.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { storage } from '@elevasis/sdk/worker'
|
|
19
|
+
*
|
|
20
|
+
* await storage.upload({
|
|
21
|
+
* bucket: 'acquisition',
|
|
22
|
+
* path: 'proposals/deal-123/proposal.pdf',
|
|
23
|
+
* content: base64Content,
|
|
24
|
+
* contentType: 'application/pdf',
|
|
25
|
+
* })
|
|
26
|
+
*
|
|
27
|
+
* const { signedUrl } = await storage.createSignedUrl({
|
|
28
|
+
* bucket: 'acquisition',
|
|
29
|
+
* path: 'proposals/deal-123/proposal.pdf',
|
|
30
|
+
* })
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const storage: import("./create-adapter.js").TypedAdapter<StorageToolMap>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stripe Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Stripe payment operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { StripeToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Stripe adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 6 typed methods for Stripe payment operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createStripeAdapter(credential: string): import("./create-adapter.js").TypedAdapter<StripeToolMap>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trello Integration Adapter
|
|
3
|
+
*
|
|
4
|
+
* Typed wrapper over platform.call() for Trello board operations.
|
|
5
|
+
* Uses factory pattern -- credential is bound once at construction time.
|
|
6
|
+
*/
|
|
7
|
+
import type { TrelloToolMap } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed Trello adapter bound to a specific credential.
|
|
10
|
+
*
|
|
11
|
+
* @param credential - Credential name as configured in the command center
|
|
12
|
+
* @returns Object with 10 typed methods for Trello board operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createTrelloAdapter(credential: string): import("./create-adapter.js").TypedAdapter<TrelloToolMap>;
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Message protocol:
|
|
8
8
|
* Parent -> Worker: { type: 'manifest' }
|
|
9
|
-
* Worker -> Parent: { type: 'manifest', workflows: [...], agents: [...]
|
|
9
|
+
* Worker -> Parent: { type: 'manifest', workflows: [...], agents: [...],
|
|
10
|
+
* triggers?: [...], integrations?: [...], humanCheckpoints?: [...],
|
|
11
|
+
* relationships?: {...} }
|
|
10
12
|
*
|
|
11
13
|
* Parent -> Worker: { type: 'execute', resourceId, executionId, input, organizationId?, organizationName?,
|
|
12
14
|
* sessionId?, sessionTurnNumber?, parentExecutionId?, executionDepth }
|
package/dist/worker/index.js
CHANGED
|
@@ -5130,7 +5130,11 @@ function startWorker(org) {
|
|
|
5130
5130
|
status: a.config.status,
|
|
5131
5131
|
description: a.config.description,
|
|
5132
5132
|
version: a.config.version
|
|
5133
|
-
}))
|
|
5133
|
+
})),
|
|
5134
|
+
triggers: org.triggers ?? [],
|
|
5135
|
+
integrations: org.integrations ?? [],
|
|
5136
|
+
humanCheckpoints: org.humanCheckpoints ?? [],
|
|
5137
|
+
relationships: org.relationships ?? void 0
|
|
5134
5138
|
});
|
|
5135
5139
|
return;
|
|
5136
5140
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.14",
|
|
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",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"dist/worker/index.js",
|
|
29
29
|
"dist/types/worker/index.d.ts",
|
|
30
30
|
"dist/types/worker/platform.d.ts",
|
|
31
|
+
"dist/types/worker/adapters/",
|
|
31
32
|
"dist/cli.cjs",
|
|
32
33
|
"dist/templates.js",
|
|
33
34
|
"dist/types/templates.d.ts",
|
|
@@ -40,7 +40,7 @@ At the start of every session the agent runs these steps silently before respond
|
|
|
40
40
|
|
|
41
41
|
Slash commands are short Markdown instruction files in `.claude/commands/`. When you type `/command-name` in a Claude Code session, the agent reads the corresponding file and follows its instructions.
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Ten commands and one skill are scaffolded by `elevasis init` and committed to version control so collaborators get the same experience:
|
|
44
44
|
|
|
45
45
|
| Command | File | Purpose |
|
|
46
46
|
| --- | --- | --- |
|
|
@@ -53,6 +53,9 @@ All nine commands are scaffolded by `elevasis init` and committed to version con
|
|
|
53
53
|
| `/tutorial` | `tutorial.md` | Progressive learning path for new developers |
|
|
54
54
|
| `/help` | `help.md` | Displays the full command tree and navigation map |
|
|
55
55
|
| `/profile` | `profile.md` | Views and updates the developer profile in `memory/profile/` |
|
|
56
|
+
| `/work` | `work.md` | In-progress task tracking -- save, resume, list |
|
|
57
|
+
|
|
58
|
+
The `/creds` skill (`.claude/skills/creds/SKILL.md`) is also scaffolded. It auto-triggers when the agent detects credential-related context and manages credential storage and retrieval.
|
|
56
59
|
|
|
57
60
|
### `/meta` Command
|
|
58
61
|
|
|
@@ -172,4 +175,4 @@ Applies when TypeScript level is `advanced` and automation level is `experienced
|
|
|
172
175
|
|
|
173
176
|
---
|
|
174
177
|
|
|
175
|
-
**Last Updated:** 2026-02
|
|
178
|
+
**Last Updated:** 2026-03-02
|
|
@@ -853,7 +853,7 @@ Method names are compile-time checked against the type map keys -- misspelling a
|
|
|
853
853
|
| Tool has a typed adapter (all integrations + platform tools) | Adapter |
|
|
854
854
|
| Need autocomplete and type safety | Adapter |
|
|
855
855
|
| New dispatcher method added server-side, no SDK update yet | `platform.call()` |
|
|
856
|
-
| Tool without a typed adapter (supabase, session-memory,
|
|
856
|
+
| Tool without a typed adapter (supabase, session-memory, status, http) | `platform.call()` |
|
|
857
857
|
|
|
858
858
|
`platform.call()` remains the universal escape hatch. Every adapter call compiles down to it. Both approaches work simultaneously with no conflicts.
|
|
859
859
|
|
|
@@ -925,3 +925,5 @@ Timeouts: LLM calls have a 120s timeout. All other tool calls have a 60s timeout
|
|
|
925
925
|
---
|
|
926
926
|
|
|
927
927
|
**Last Updated:** 2026-03-02
|
|
928
|
+
|
|
929
|
+
|
|
@@ -40,23 +40,22 @@ Both patterns return a Promise that resolves with the tool result or rejects wit
|
|
|
40
40
|
|
|
41
41
|
## Integration Adapters
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Twelve integration adapters give you access to 60+ tool methods covering third-party APIs. Pass the `credential` field with the name of the stored credential for that service. Supabase is listed separately under [Database Access](#database-access) below.
|
|
44
44
|
|
|
45
45
|
| Adapter | Tools | Credential Shape |
|
|
46
46
|
| --- | --- | --- |
|
|
47
|
-
| Attio |
|
|
47
|
+
| Attio | 12 (CRUD + schema + notes) | `{ apiKey }` |
|
|
48
48
|
| Google Sheets | 13 (read/write/filter/upsert) | OAuth2 / service account |
|
|
49
49
|
| Trello | 10 (cards/lists/checklists) | `{ apiKey, token }` |
|
|
50
50
|
| Notion | 8 (pages + blocks) | `{ token }` |
|
|
51
51
|
| Stripe | 6 (payment links + checkout) | `{ secretKey }` |
|
|
52
52
|
| Instantly | 5 (email campaigns) | `{ apiKey }` |
|
|
53
53
|
| Gmail | 2 (send email) | OAuth2 / service account |
|
|
54
|
-
| Resend |
|
|
55
|
-
| SignatureAPI |
|
|
54
|
+
| Resend | 2 (send/get email) | `{ apiKey }` |
|
|
55
|
+
| SignatureAPI | 4 (envelopes) | `{ apiKey }` |
|
|
56
56
|
| Dropbox | 2 (upload/folder) | `{ accessToken }` |
|
|
57
57
|
| Apify | 1 (run actor) | `{ token }` |
|
|
58
58
|
| Mailso | 1 (verify email) | `{ apiKey }` |
|
|
59
|
-
| Supabase | 7 (insert/select/update/delete/upsert/rpc/count) | `{ url, serviceRoleKey }` |
|
|
60
59
|
|
|
61
60
|
Credentials are stored in the Elevasis credentials table and injected server-side. The credential name you pass in `credential` must match the name you set when storing the credential.
|
|
62
61
|
|
|
@@ -188,7 +187,7 @@ const qualified = await platform.call({
|
|
|
188
187
|
|
|
189
188
|
## Documentation
|
|
190
189
|
|
|
191
|
-
- [Typed Adapters](adapters.mdx) - Type-safe wrappers for all 12 integrations +
|
|
190
|
+
- [Typed Adapters](adapters.mdx) - Type-safe wrappers for all 12 integrations + 9 platform services with full autocomplete (recommended)
|
|
192
191
|
- [Integration Examples](examples.mdx) - Working code examples for email, CRM, PDF, LLM, and more
|
|
193
192
|
|
|
194
193
|
---
|