@elevasis/sdk 0.5.21 → 0.5.24
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 +78 -3
- package/dist/index.d.ts +731 -326
- package/dist/templates.js +74 -2
- package/dist/types/worker/adapters/anymailfinder.d.ts +14 -0
- package/dist/types/worker/adapters/index.d.ts +1 -0
- package/dist/types/worker/adapters/instantly.d.ts +1 -1
- package/dist/types/worker/adapters/lead.d.ts +1 -1
- package/dist/types/worker/adapters/llm.d.ts +20 -2
- package/dist/worker/index.js +48 -14
- package/package.json +10 -10
package/dist/cli.cjs
CHANGED
|
@@ -43873,7 +43873,7 @@ async function apiDelete(endpoint, apiUrl = resolveApiUrl()) {
|
|
|
43873
43873
|
// package.json
|
|
43874
43874
|
var package_default = {
|
|
43875
43875
|
name: "@elevasis/sdk",
|
|
43876
|
-
version: "0.5.
|
|
43876
|
+
version: "0.5.24",
|
|
43877
43877
|
description: "SDK for building Elevasis organization resources",
|
|
43878
43878
|
type: "module",
|
|
43879
43879
|
bin: {
|
|
@@ -45210,7 +45210,7 @@ var import_path3 = require("path");
|
|
|
45210
45210
|
var import_promises2 = require("fs/promises");
|
|
45211
45211
|
|
|
45212
45212
|
// src/cli/commands/templates/core/workspace.ts
|
|
45213
|
-
var TEMPLATE_VERSION =
|
|
45213
|
+
var TEMPLATE_VERSION = 32;
|
|
45214
45214
|
function configTemplate() {
|
|
45215
45215
|
return `import type { ElevasConfig } from '@elevasis/sdk'
|
|
45216
45216
|
|
|
@@ -46980,6 +46980,7 @@ This file is yours. The other \`.claude/rules/\` files are SDK-owned and updated
|
|
|
46980
46980
|
- \`memory-conventions.md\` -- memory system structure and pruning
|
|
46981
46981
|
- \`project-map.md\` -- auto-generated project map conventions
|
|
46982
46982
|
- \`task-tracking.md\` -- in-progress task conventions
|
|
46983
|
+
- \`logging.md\` -- context.logger usage, console.log prohibition, logging standard
|
|
46983
46984
|
|
|
46984
46985
|
## When to Add a Rule
|
|
46985
46986
|
|
|
@@ -47119,6 +47120,77 @@ When all plan steps are marked COMPLETE, **suggest** completing the task -- neve
|
|
|
47119
47120
|
- Completed tasks move OUT of \`docs/in-progress/\` to \`docs/<relevant-dir>/\`
|
|
47120
47121
|
`;
|
|
47121
47122
|
}
|
|
47123
|
+
function claudeLoggingRuleTemplate() {
|
|
47124
|
+
return `---
|
|
47125
|
+
description: Logging conventions for workflow and agent handlers
|
|
47126
|
+
paths:
|
|
47127
|
+
- src/**
|
|
47128
|
+
---
|
|
47129
|
+
|
|
47130
|
+
# Logging
|
|
47131
|
+
|
|
47132
|
+
## Always Use \`context.logger\` in Handlers
|
|
47133
|
+
|
|
47134
|
+
**Never use \`console.log\`, \`console.warn\`, or \`console.error\` in step/agent handlers.**
|
|
47135
|
+
The platform does not capture \`console.*\` output \u2014 it will not appear in execution logs.
|
|
47136
|
+
|
|
47137
|
+
\`\`\`typescript
|
|
47138
|
+
// \u274C WRONG \u2014 invisible in Command Center
|
|
47139
|
+
handler: async (rawInput) => {
|
|
47140
|
+
console.log('Processing...')
|
|
47141
|
+
}
|
|
47142
|
+
|
|
47143
|
+
// \u2705 CORRECT \u2014 visible in Command Center
|
|
47144
|
+
handler: async (rawInput, context) => {
|
|
47145
|
+
context.logger.info('Processing...')
|
|
47146
|
+
}
|
|
47147
|
+
\`\`\`
|
|
47148
|
+
|
|
47149
|
+
## Logger Methods
|
|
47150
|
+
|
|
47151
|
+
\`\`\`typescript
|
|
47152
|
+
context.logger.debug('Verbose detail \u2014 shown in debug mode only')
|
|
47153
|
+
context.logger.info('Normal progress messages')
|
|
47154
|
+
context.logger.warn('Non-fatal issue \u2014 skipped, retried, partial result')
|
|
47155
|
+
context.logger.error('Fatal error or unexpected failure')
|
|
47156
|
+
\`\`\`
|
|
47157
|
+
|
|
47158
|
+
## Extensive Logging Standard
|
|
47159
|
+
|
|
47160
|
+
Every handler should log:
|
|
47161
|
+
|
|
47162
|
+
1. **Entry** \u2014 step name + key input params (category, count, domain, etc.)
|
|
47163
|
+
2. **Progress** \u2014 inside loops: per-item status (processed, skipped, failed)
|
|
47164
|
+
3. **Decisions** \u2014 idempotency skips, early exits, conditional branches
|
|
47165
|
+
4. **Summary** \u2014 counts at the end (X processed, Y skipped, Z errors)
|
|
47166
|
+
|
|
47167
|
+
\`\`\`typescript
|
|
47168
|
+
handler: async (rawInput, context) => {
|
|
47169
|
+
const data = rawInput as SomeType
|
|
47170
|
+
context.logger.info(\`[step-name] Starting \u2014 \${data.items.length} items\`)
|
|
47171
|
+
|
|
47172
|
+
let processed = 0, skipped = 0
|
|
47173
|
+
for (const item of data.items) {
|
|
47174
|
+
if (item.alreadyDone) {
|
|
47175
|
+
skipped++
|
|
47176
|
+
context.logger.info(\`[step-name] Skipping \${item.name} \u2014 already complete\`)
|
|
47177
|
+
continue
|
|
47178
|
+
}
|
|
47179
|
+
// ...
|
|
47180
|
+
processed++
|
|
47181
|
+
context.logger.info(\`[step-name] Processed \${item.name}\`)
|
|
47182
|
+
}
|
|
47183
|
+
|
|
47184
|
+
context.logger.info(\`[step-name] Done \u2014 \${processed} processed, \${skipped} skipped\`)
|
|
47185
|
+
}
|
|
47186
|
+
\`\`\`
|
|
47187
|
+
|
|
47188
|
+
## Warnings vs Errors
|
|
47189
|
+
|
|
47190
|
+
- \`warn\`: skipped item, not found in DB, LLM timeout on one domain (processing continues)
|
|
47191
|
+
- \`error\`: step-level failures that propagate as thrown errors (log before throwing if possible)
|
|
47192
|
+
`;
|
|
47193
|
+
}
|
|
47122
47194
|
function claudePostEditValidateHookTemplate() {
|
|
47123
47195
|
return `#!/usr/bin/env node
|
|
47124
47196
|
// post-edit-validate.mjs
|
|
@@ -47498,7 +47570,8 @@ function getManagedTemplates(ctx = {}) {
|
|
|
47498
47570
|
".claude/rules/docs-authoring.md": claudeDocsAuthoringRuleTemplate,
|
|
47499
47571
|
".claude/rules/memory-conventions.md": claudeMemoryConventionsRuleTemplate,
|
|
47500
47572
|
".claude/rules/project-map.md": claudeProjectMapRuleTemplate,
|
|
47501
|
-
".claude/rules/task-tracking.md": claudeTaskTrackingRuleTemplate
|
|
47573
|
+
".claude/rules/task-tracking.md": claudeTaskTrackingRuleTemplate,
|
|
47574
|
+
".claude/rules/logging.md": claudeLoggingRuleTemplate
|
|
47502
47575
|
};
|
|
47503
47576
|
}
|
|
47504
47577
|
|
|
@@ -47713,6 +47786,7 @@ var MANAGED_FILES = [
|
|
|
47713
47786
|
".claude/rules/memory-conventions.md",
|
|
47714
47787
|
".claude/rules/project-map.md",
|
|
47715
47788
|
".claude/rules/task-tracking.md",
|
|
47789
|
+
".claude/rules/logging.md",
|
|
47716
47790
|
".claude/scripts/statusline-command.js"
|
|
47717
47791
|
];
|
|
47718
47792
|
var SCAFFOLD_FILES = [...INIT_ONLY_FILES, ...MANAGED_FILES];
|
|
@@ -47784,6 +47858,7 @@ function registerInitCommand(program3) {
|
|
|
47784
47858
|
".claude/rules/memory-conventions.md": claudeMemoryConventionsRuleTemplate(),
|
|
47785
47859
|
".claude/rules/project-map.md": claudeProjectMapRuleTemplate(),
|
|
47786
47860
|
".claude/rules/task-tracking.md": claudeTaskTrackingRuleTemplate(),
|
|
47861
|
+
".claude/rules/logging.md": claudeLoggingRuleTemplate(),
|
|
47787
47862
|
".claude/scripts/statusline-command.js": claudeStatuslineScriptTemplate()
|
|
47788
47863
|
};
|
|
47789
47864
|
if (options2.ui) {
|