@elevasis/sdk 0.7.8 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -43883,7 +43883,7 @@ function wrapAction(commandName, fn) {
43883
43883
  // package.json
43884
43884
  var package_default = {
43885
43885
  name: "@elevasis/sdk",
43886
- version: "0.7.8",
43886
+ version: "0.7.9",
43887
43887
  description: "SDK for building Elevasis organization resources",
43888
43888
  type: "module",
43889
43889
  bin: {
package/dist/index.d.ts CHANGED
@@ -1777,6 +1777,7 @@ type Database = {
1777
1777
  expires_at: string | null;
1778
1778
  human_checkpoint: string | null;
1779
1779
  id: string;
1780
+ idempotency_key: string | null;
1780
1781
  metadata: Json | null;
1781
1782
  organization_id: string;
1782
1783
  origin_execution_id: string;
@@ -1798,6 +1799,7 @@ type Database = {
1798
1799
  expires_at?: string | null;
1799
1800
  human_checkpoint?: string | null;
1800
1801
  id?: string;
1802
+ idempotency_key?: string | null;
1801
1803
  metadata?: Json | null;
1802
1804
  organization_id: string;
1803
1805
  origin_execution_id: string;
@@ -1819,6 +1821,7 @@ type Database = {
1819
1821
  expires_at?: string | null;
1820
1822
  human_checkpoint?: string | null;
1821
1823
  id?: string;
1824
+ idempotency_key?: string | null;
1822
1825
  metadata?: Json | null;
1823
1826
  organization_id?: string;
1824
1827
  origin_execution_id?: string;
@@ -3342,6 +3345,7 @@ interface CompanyEnrichmentData {
3342
3345
  scrapedAt?: string;
3343
3346
  };
3344
3347
  websiteCrawl?: {
3348
+ companyDescription?: string;
3345
3349
  services?: string[];
3346
3350
  specialties?: string[];
3347
3351
  staff?: Array<{
@@ -3349,8 +3353,16 @@ interface CompanyEnrichmentData {
3349
3353
  title?: string;
3350
3354
  email?: string;
3351
3355
  }>;
3356
+ automationGaps?: string[];
3357
+ targetAudience?: string;
3358
+ category?: string;
3359
+ segment?: string;
3360
+ recentWin?: string;
3352
3361
  emailCount?: number;
3362
+ pageCount?: number;
3363
+ totalChars?: number;
3353
3364
  crawledAt?: string;
3365
+ extractedAt?: string;
3354
3366
  };
3355
3367
  website?: {
3356
3368
  missionVision?: string;
@@ -6128,6 +6140,7 @@ type ApprovalToolMap = {
6128
6140
  humanCheckpoint?: string;
6129
6141
  metadata?: Record<string, unknown>;
6130
6142
  expiresAt?: string;
6143
+ idempotencyKey?: string;
6131
6144
  };
6132
6145
  result: {
6133
6146
  id: string;
@@ -5025,6 +5025,35 @@ var execution = createAdapter("execution", ["trigger", "triggerAsync"]);
5025
5025
  var email = createAdapter("email", ["send"]);
5026
5026
 
5027
5027
  // src/worker/index.ts
5028
+ function captureConsole(executionId, logs) {
5029
+ const origLog = console.log;
5030
+ const origWarn = console.warn;
5031
+ const origError = console.error;
5032
+ const postLog = (level, message, logContext) => {
5033
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
5034
+ const entry = { level, message, timestamp, context: logContext };
5035
+ logs.push(entry);
5036
+ parentPort.postMessage({
5037
+ type: "log",
5038
+ entry: { level, message, timestamp, executionId, context: logContext }
5039
+ });
5040
+ };
5041
+ const capture = (level, orig) => (...args) => {
5042
+ postLog(level, args.map(String).join(" "));
5043
+ orig(...args);
5044
+ };
5045
+ console.log = capture("info", origLog);
5046
+ console.warn = capture("warn", origWarn);
5047
+ console.error = capture("error", origError);
5048
+ return {
5049
+ restore: () => {
5050
+ console.log = origLog;
5051
+ console.warn = origWarn;
5052
+ console.error = origError;
5053
+ },
5054
+ postLog
5055
+ };
5056
+ }
5028
5057
  function resolveNext(next, data) {
5029
5058
  if (next === null) return null;
5030
5059
  if (next.type === "linear") return next.target;
@@ -5051,25 +5080,7 @@ function serializeNext(next) {
5051
5080
  }
5052
5081
  async function executeWorkflow(workflow, input, context) {
5053
5082
  const logs = [];
5054
- const postLog = (level, message, logContext) => {
5055
- const timestamp = (/* @__PURE__ */ new Date()).toISOString();
5056
- const entry = { level, message, timestamp, context: logContext };
5057
- logs.push(entry);
5058
- parentPort.postMessage({
5059
- type: "log",
5060
- entry: { level, message, timestamp, executionId: context.executionId, context: logContext }
5061
- });
5062
- };
5063
- const origLog = console.log;
5064
- const origWarn = console.warn;
5065
- const origError = console.error;
5066
- const capture = (level, orig) => (...args) => {
5067
- postLog(level, args.map(String).join(" "));
5068
- orig(...args);
5069
- };
5070
- console.log = capture("info", origLog);
5071
- console.warn = capture("warn", origWarn);
5072
- console.error = capture("error", origError);
5083
+ const { restore, postLog } = captureConsole(context.executionId, logs);
5073
5084
  try {
5074
5085
  let currentData = workflow.contract.inputSchema ? workflow.contract.inputSchema.parse(input) : input;
5075
5086
  let stepId = workflow.entryPoint;
@@ -5149,9 +5160,7 @@ async function executeWorkflow(workflow, input, context) {
5149
5160
  }
5150
5161
  return { output: currentData, logs };
5151
5162
  } finally {
5152
- console.log = origLog;
5153
- console.warn = origWarn;
5154
- console.error = origError;
5163
+ restore();
5155
5164
  }
5156
5165
  }
5157
5166
  function buildWorkerExecutionContext(params) {
@@ -5307,25 +5316,7 @@ function startWorker(org) {
5307
5316
  const agentDef = agents.get(resourceId);
5308
5317
  if (agentDef) {
5309
5318
  const logs = [];
5310
- const origLog = console.log;
5311
- const origWarn = console.warn;
5312
- const origError = console.error;
5313
- const postLog = (level, message) => {
5314
- const timestamp = (/* @__PURE__ */ new Date()).toISOString();
5315
- const entry = { level, message, timestamp };
5316
- logs.push(entry);
5317
- parentPort.postMessage({
5318
- type: "log",
5319
- entry: { level, message, timestamp, executionId }
5320
- });
5321
- };
5322
- const capture = (level, orig) => (...args) => {
5323
- postLog(level, args.map(String).join(" "));
5324
- orig(...args);
5325
- };
5326
- console.log = capture("info", origLog);
5327
- console.warn = capture("warn", origWarn);
5328
- console.error = capture("error", origError);
5319
+ const { restore } = captureConsole(executionId, logs);
5329
5320
  const startTime = Date.now();
5330
5321
  try {
5331
5322
  console.log(`[SDK-WORKER] Running agent '${resourceId}' (${agentDef.tools.length} tools)`);
@@ -5360,9 +5351,7 @@ function startWorker(org) {
5360
5351
  metrics: { durationMs }
5361
5352
  });
5362
5353
  } finally {
5363
- console.log = origLog;
5364
- console.warn = origWarn;
5365
- console.error = origError;
5354
+ restore();
5366
5355
  }
5367
5356
  return;
5368
5357
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "type": "module",
6
6
  "bin": {