openmates 0.17.0-alpha.2 → 0.17.0-alpha.4

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.
@@ -14392,6 +14392,17 @@ var APP_SKILL_METADATA = [
14392
14392
  "required": [
14393
14393
  "prompt"
14394
14394
  ]
14395
+ },
14396
+ "output_schema": {
14397
+ "type": "object",
14398
+ "properties": {
14399
+ "answer": {
14400
+ "type": "string"
14401
+ },
14402
+ "conversation": {
14403
+ "type": "string"
14404
+ }
14405
+ }
14395
14406
  }
14396
14407
  },
14397
14408
  {
@@ -14682,6 +14693,23 @@ var APP_SKILL_METADATA = [
14682
14693
  "required": [
14683
14694
  "companies"
14684
14695
  ]
14696
+ },
14697
+ "output_schema": {
14698
+ "type": "object",
14699
+ "properties": {
14700
+ "summary": {
14701
+ "type": "string"
14702
+ },
14703
+ "result_count": {
14704
+ "type": "integer"
14705
+ },
14706
+ "provider": {
14707
+ "type": "string"
14708
+ },
14709
+ "results": {
14710
+ "type": "array"
14711
+ }
14712
+ }
14685
14713
  }
14686
14714
  },
14687
14715
  {
@@ -14752,6 +14780,251 @@ var APP_SKILL_METADATA = [
14752
14780
  ]
14753
14781
  }
14754
14782
  },
14783
+ {
14784
+ "app_id": "code",
14785
+ "skill_id": "run",
14786
+ "app_namespace_ts": "code",
14787
+ "skill_method_ts": "run",
14788
+ "app_namespace_py": "code",
14789
+ "skill_method_py": "run",
14790
+ "description_key": "app_skills.code.run.description",
14791
+ "description": "Run a code embed in an isolated E2B sandbox. Use automatically only for code the assistant created or edited in the current turn; ask the user before running unmodified user-supplied code or after the initial run plus two unprompted reruns. The sandbox receives code files from the current chat, installs supported dependency manifests, executes the selected file, streams terminal status, and returns safe artifact metadata. Pricing is 5 credits per started minute of sandbox runtime.",
14792
+ "schema": {
14793
+ "type": "object",
14794
+ "properties": {
14795
+ "requests": {
14796
+ "type": "array",
14797
+ "minItems": 1,
14798
+ "maxItems": 10,
14799
+ "description": "Array of direct or chat-bound Code Run requests for the custom REST/SDK route.",
14800
+ "items": {
14801
+ "type": "object",
14802
+ "properties": {
14803
+ "mode": {
14804
+ "type": "string",
14805
+ "enum": [
14806
+ "direct",
14807
+ "chat_bound"
14808
+ ],
14809
+ "default": "direct",
14810
+ "description": "Direct runs use caller-supplied files and stay transient; chat_bound runs use a chat/embed target and persist encrypted output."
14811
+ },
14812
+ "entry_path": {
14813
+ "type": "string",
14814
+ "description": "Entrypoint file path for direct runs."
14815
+ },
14816
+ "files": {
14817
+ "type": "array",
14818
+ "maxItems": 50,
14819
+ "description": "Direct-run files with base64-encoded content. The backend never fetches local paths or URLs.",
14820
+ "items": {
14821
+ "type": "object",
14822
+ "properties": {
14823
+ "path": {
14824
+ "type": "string"
14825
+ },
14826
+ "content_base64": {
14827
+ "type": "string"
14828
+ },
14829
+ "language": {
14830
+ "type": "string"
14831
+ },
14832
+ "mime_type": {
14833
+ "type": "string",
14834
+ "default": "text/plain"
14835
+ },
14836
+ "is_target": {
14837
+ "type": "boolean",
14838
+ "default": false
14839
+ }
14840
+ },
14841
+ "required": [
14842
+ "path",
14843
+ "content_base64"
14844
+ ]
14845
+ }
14846
+ },
14847
+ "chat_id": {
14848
+ "type": "string",
14849
+ "description": "Chat ID for chat-bound runs."
14850
+ },
14851
+ "target_embed_id": {
14852
+ "type": "string",
14853
+ "description": "Target code embed ID for chat-bound runs."
14854
+ },
14855
+ "selected_embed_ids": {
14856
+ "type": "array",
14857
+ "items": {
14858
+ "type": "string"
14859
+ },
14860
+ "description": "Optional related embed IDs to include in chat-bound runs."
14861
+ },
14862
+ "dependency_installs": {
14863
+ "type": "array",
14864
+ "maxItems": 20,
14865
+ "description": "Optional explicit dependency installs.",
14866
+ "items": {
14867
+ "type": "object",
14868
+ "properties": {
14869
+ "ecosystem": {
14870
+ "type": "string",
14871
+ "enum": [
14872
+ "python",
14873
+ "npm"
14874
+ ]
14875
+ },
14876
+ "packages": {
14877
+ "type": "array",
14878
+ "items": {
14879
+ "type": "string"
14880
+ }
14881
+ }
14882
+ },
14883
+ "required": [
14884
+ "ecosystem",
14885
+ "packages"
14886
+ ]
14887
+ }
14888
+ },
14889
+ "enable_internet": {
14890
+ "type": "boolean",
14891
+ "default": true,
14892
+ "description": "Allow outbound internet access from the E2B sandbox."
14893
+ }
14894
+ }
14895
+ }
14896
+ }
14897
+ },
14898
+ "required": [
14899
+ "requests"
14900
+ ]
14901
+ },
14902
+ "output_schema": {
14903
+ "type": "object",
14904
+ "properties": {
14905
+ "results": {
14906
+ "type": "array",
14907
+ "items": {
14908
+ "type": "object",
14909
+ "properties": {
14910
+ "execution_id": {
14911
+ "type": "string"
14912
+ },
14913
+ "status": {
14914
+ "type": "string"
14915
+ },
14916
+ "target_filename": {
14917
+ "type": "string"
14918
+ },
14919
+ "files": {
14920
+ "type": "array",
14921
+ "items": {
14922
+ "type": "string"
14923
+ }
14924
+ },
14925
+ "credits_per_minute": {
14926
+ "type": "integer"
14927
+ },
14928
+ "persisted_output": {
14929
+ "type": "boolean"
14930
+ },
14931
+ "stream_path": {
14932
+ "type": "string"
14933
+ },
14934
+ "status_path": {
14935
+ "type": "string"
14936
+ },
14937
+ "final": {
14938
+ "type": "object",
14939
+ "description": "Final status fetched from status_path by SDK helpers. Direct runs remain transient.",
14940
+ "properties": {
14941
+ "status": {
14942
+ "type": "string"
14943
+ },
14944
+ "exit_code": {
14945
+ "type": "integer"
14946
+ },
14947
+ "output": {
14948
+ "type": "string"
14949
+ },
14950
+ "error": {
14951
+ "type": "string"
14952
+ },
14953
+ "duration_seconds": {
14954
+ "type": "number"
14955
+ },
14956
+ "charged_credits": {
14957
+ "type": "integer"
14958
+ },
14959
+ "charged_minutes": {
14960
+ "type": "integer"
14961
+ },
14962
+ "artifacts": {
14963
+ "type": "array",
14964
+ "items": {
14965
+ "type": "object",
14966
+ "properties": {
14967
+ "path": {
14968
+ "type": "string"
14969
+ },
14970
+ "normalized_path": {
14971
+ "type": "string"
14972
+ },
14973
+ "mime_type": {
14974
+ "type": "string"
14975
+ },
14976
+ "kind": {
14977
+ "type": "string"
14978
+ },
14979
+ "size_bytes": {
14980
+ "type": "integer"
14981
+ },
14982
+ "status": {
14983
+ "type": "string"
14984
+ },
14985
+ "asset_id": {
14986
+ "type": "string"
14987
+ },
14988
+ "file_id": {
14989
+ "type": "string"
14990
+ },
14991
+ "variant": {
14992
+ "type": "string"
14993
+ },
14994
+ "version": {
14995
+ "type": "integer"
14996
+ },
14997
+ "download_url": {
14998
+ "type": "string"
14999
+ }
15000
+ }
15001
+ }
15002
+ },
15003
+ "skipped_artifacts": {
15004
+ "type": "array",
15005
+ "items": {
15006
+ "type": "object",
15007
+ "properties": {
15008
+ "path": {
15009
+ "type": "string"
15010
+ },
15011
+ "normalized_path": {
15012
+ "type": "string"
15013
+ },
15014
+ "reason": {
15015
+ "type": "string"
15016
+ }
15017
+ }
15018
+ }
15019
+ }
15020
+ }
15021
+ }
15022
+ }
15023
+ }
15024
+ }
15025
+ }
15026
+ }
15027
+ },
14755
15028
  {
14756
15029
  "app_id": "code",
14757
15030
  "skill_id": "image_to_html",
@@ -15190,6 +15463,17 @@ Note: The 'id' field is auto-generated if not provided.
15190
15463
  "required": [
15191
15464
  "requests"
15192
15465
  ]
15466
+ },
15467
+ "output_schema": {
15468
+ "type": "object",
15469
+ "properties": {
15470
+ "summary": {
15471
+ "type": "string"
15472
+ },
15473
+ "result_count": {
15474
+ "type": "integer"
15475
+ }
15476
+ }
15193
15477
  }
15194
15478
  },
15195
15479
  {
@@ -16202,6 +16486,17 @@ Note: The 'id' field is auto-generated if not provided - you don't need to inclu
16202
16486
  "required": [
16203
16487
  "requests"
16204
16488
  ]
16489
+ },
16490
+ "output_schema": {
16491
+ "type": "object",
16492
+ "properties": {
16493
+ "summary": {
16494
+ "type": "string"
16495
+ },
16496
+ "result_count": {
16497
+ "type": "integer"
16498
+ }
16499
+ }
16205
16500
  }
16206
16501
  },
16207
16502
  {
@@ -17929,6 +18224,20 @@ Note: The 'id' field is auto-generated if not provided - you don't need to inclu
17929
18224
  "required": [
17930
18225
  "location"
17931
18226
  ]
18227
+ },
18228
+ "output_schema": {
18229
+ "type": "object",
18230
+ "properties": {
18231
+ "summary": {
18232
+ "type": "string"
18233
+ },
18234
+ "rain_probability": {
18235
+ "type": "number"
18236
+ },
18237
+ "max_temperature_c": {
18238
+ "type": "number"
18239
+ }
18240
+ }
17932
18241
  }
17933
18242
  },
17934
18243
  {
@@ -18120,6 +18429,17 @@ Note: The 'id' field is auto-generated if not provided - you don't need to inclu
18120
18429
  "required": [
18121
18430
  "requests"
18122
18431
  ]
18432
+ },
18433
+ "output_schema": {
18434
+ "type": "object",
18435
+ "properties": {
18436
+ "summary": {
18437
+ "type": "string"
18438
+ },
18439
+ "result_count": {
18440
+ "type": "integer"
18441
+ }
18442
+ }
18123
18443
  }
18124
18444
  },
18125
18445
  {
@@ -18363,6 +18683,14 @@ var CodeAppSkills = class {
18363
18683
  async removeSecrets(input, options) {
18364
18684
  return this.runSkill("code", "remove_secrets", input, options);
18365
18685
  }
18686
+ /**
18687
+ * Run a code embed in an isolated E2B sandbox. Use automatically only for code the assistant created or edited in the current turn; ask the user before running unmodified user-supplied code or after the initial run plus two unprompted reruns. The sandbox receives code files from the current chat, installs supported dependency manifests, executes the selected file, streams terminal status, and returns safe artifact metadata. Pricing is 5 credits per started minute of sandbox runtime.
18688
+ * Description key: app_skills.code.run.description
18689
+ * Skill: code/run
18690
+ */
18691
+ async run(input, options) {
18692
+ return this.runSkill("code", "run", input, options);
18693
+ }
18366
18694
  /**
18367
18695
  * Search GitHub repositories. Use this instead of web.search whenever the user asks to find GitHub repos, repositories, open-source libraries, starred repos, or repo examples by topic, language, framework, or project need. Returns licensed repository embeds. Costs 10 credits per search.
18368
18696
  * Description key: code.search_repos.description
@@ -19383,6 +19711,9 @@ var DEFAULT_RECOVERY_TIMEOUT_MS = 6e4;
19383
19711
  var SKILL_TASK_POLL_INTERVAL_MS2 = 2e3;
19384
19712
  var SKILL_TASK_POLL_TIMEOUT_MS2 = 12e5;
19385
19713
  var SKILL_TASK_POLL_TRANSIENT_ERROR_STATUS2 = 500;
19714
+ var CODE_RUN_POLL_INTERVAL_MS = 1e3;
19715
+ var CODE_RUN_POLL_TIMEOUT_MS = 12e5;
19716
+ var CODE_RUN_TERMINAL_STATUSES = /* @__PURE__ */ new Set(["finished", "failed", "timeout", "cancelled"]);
19386
19717
  var PROMPT_INJECTION_DISABLED2 = "disabled";
19387
19718
  var CANONICAL_UUID_PATTERN2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
19388
19719
  function withAppSkillRunOptions(input, options) {
@@ -19498,6 +19829,9 @@ var OpenMates = class {
19498
19829
  }
19499
19830
  async runAppSkill(appId, skillId, input, options) {
19500
19831
  const response = await this.request(`/v1/apps/${appId}/skills/${skillId}`, withAppSkillRunOptions(input, options));
19832
+ if (appId === "code" && skillId === "run") {
19833
+ return this.resolveCodeRunSkillResponse(response);
19834
+ }
19501
19835
  return this.resolveAsyncSkillResponse(response);
19502
19836
  }
19503
19837
  async runConnectedAccountSkill(appId, skillId, input, options = {}) {
@@ -19766,6 +20100,65 @@ var OpenMates = class {
19766
20100
  }
19767
20101
  return responseData;
19768
20102
  }
20103
+ async resolveCodeRunSkillResponse(responseData) {
20104
+ const envelope = responseData;
20105
+ const data = envelope?.data ?? envelope;
20106
+ const results = Array.isArray(data?.results) ? data.results : [];
20107
+ if (results.length === 0) return responseData;
20108
+ const resolvedResults = await Promise.all(results.map(async (result) => {
20109
+ if (!result || typeof result !== "object" || Array.isArray(result)) return result;
20110
+ const item = result;
20111
+ const statusPath = typeof item.status_path === "string" ? item.status_path : null;
20112
+ if (!statusPath) return item;
20113
+ return { ...item, final: await this.pollCodeRunUntilComplete(statusPath) };
20114
+ }));
20115
+ const resolvedData = { ...data, results: resolvedResults };
20116
+ if (envelope && typeof envelope === "object" && "success" in envelope) {
20117
+ return { ...envelope, data: resolvedData };
20118
+ }
20119
+ return resolvedData;
20120
+ }
20121
+ async pollCodeRunUntilComplete(statusPath) {
20122
+ const path2 = this.normalizeCodeRunStatusPath(statusPath);
20123
+ const started = Date.now();
20124
+ let lastTransientError = null;
20125
+ while (Date.now() - started < CODE_RUN_POLL_TIMEOUT_MS) {
20126
+ let response;
20127
+ try {
20128
+ response = await fetch(`${this.apiUrl}${path2}`, {
20129
+ method: "GET",
20130
+ headers: this.headers(false)
20131
+ });
20132
+ } catch (error) {
20133
+ lastTransientError = error instanceof Error ? error.message : String(error);
20134
+ await new Promise((resolve10) => setTimeout(resolve10, CODE_RUN_POLL_INTERVAL_MS));
20135
+ continue;
20136
+ }
20137
+ if (!response.ok) {
20138
+ if (response.status >= SKILL_TASK_POLL_TRANSIENT_ERROR_STATUS2) {
20139
+ lastTransientError = `HTTP ${response.status}`;
20140
+ await new Promise((resolve10) => setTimeout(resolve10, CODE_RUN_POLL_INTERVAL_MS));
20141
+ continue;
20142
+ }
20143
+ throw new OpenMatesApiError(response.status, await this.safeJson(response));
20144
+ }
20145
+ lastTransientError = null;
20146
+ const status = await this.parseResponse(response);
20147
+ const value = typeof status.status === "string" ? status.status : "";
20148
+ if (CODE_RUN_TERMINAL_STATUSES.has(value)) return status;
20149
+ await new Promise((resolve10) => setTimeout(resolve10, CODE_RUN_POLL_INTERVAL_MS));
20150
+ }
20151
+ if (lastTransientError) {
20152
+ throw new Error(`Code Run did not complete within ${CODE_RUN_POLL_TIMEOUT_MS / 1e3}s; last polling error: ${lastTransientError}`);
20153
+ }
20154
+ throw new Error(`Code Run did not complete within ${CODE_RUN_POLL_TIMEOUT_MS / 1e3}s`);
20155
+ }
20156
+ normalizeCodeRunStatusPath(statusPath) {
20157
+ if (!statusPath.startsWith("/v1/code/run/")) {
20158
+ throw new OpenMatesConfigError("Code Run returned an invalid status path.");
20159
+ }
20160
+ return statusPath;
20161
+ }
19769
20162
  async pollTaskUntilComplete(taskId) {
19770
20163
  const started = Date.now();
19771
20164
  let lastTransientError = null;
@@ -30031,6 +30424,28 @@ function buildCodeRunStreamUrl(params) {
30031
30424
  const query = new URLSearchParams({ sessionId: params.sessionId, token: params.token });
30032
30425
  return `${base}/v1/code/run/${encodeURIComponent(params.executionId)}/stream?${query.toString()}`;
30033
30426
  }
30427
+ function formatCodeRunFinalStatusOutput(status, options = {}) {
30428
+ let output = "";
30429
+ if (options.includeOutput !== false && typeof status.output === "string" && status.output.length > 0) {
30430
+ output += status.output.endsWith("\n") ? status.output : `${status.output}
30431
+ `;
30432
+ }
30433
+ const artifactLines = formatCodeRunArtifactLines(status.artifacts);
30434
+ if (artifactLines.length > 0) {
30435
+ if (output.length > 0 && !output.endsWith("\n\n")) output += "\n";
30436
+ output += `Artifacts:
30437
+ ${artifactLines.join("\n")}
30438
+ `;
30439
+ }
30440
+ const skippedLines = formatCodeRunSkippedArtifactLines(status.skipped_artifacts);
30441
+ if (skippedLines.length > 0) {
30442
+ if (output.length > 0 && !output.endsWith("\n\n")) output += "\n";
30443
+ output += `Skipped artifacts:
30444
+ ${skippedLines.join("\n")}
30445
+ `;
30446
+ }
30447
+ return output;
30448
+ }
30034
30449
  function normalizeCodeRunPath(rawPath) {
30035
30450
  const path2 = rawPath.trim().replace(/\\/g, "/");
30036
30451
  if (!path2 || path2.includes("\0") || path2.startsWith("/") || path2.startsWith("~/") || /^[A-Za-z]:\//.test(path2)) {
@@ -30086,6 +30501,31 @@ function toList(value) {
30086
30501
  if (typeof value === "string") return value.split("\n").filter(Boolean);
30087
30502
  return [];
30088
30503
  }
30504
+ function formatCodeRunArtifactLines(value) {
30505
+ if (!Array.isArray(value)) return [];
30506
+ return value.filter((item) => item !== null && typeof item === "object" && !Array.isArray(item)).map((artifact) => {
30507
+ const path2 = stringValue(artifact.normalized_path) || stringValue(artifact.path) || "artifact";
30508
+ const mimeType = stringValue(artifact.mime_type) || "application/octet-stream";
30509
+ const sizeBytes = numberValue2(artifact.size_bytes);
30510
+ const size = sizeBytes === null ? "unknown size" : `${sizeBytes} bytes`;
30511
+ const downloadUrl = stringValue(artifact.download_url);
30512
+ return downloadUrl ? `- ${path2} (${mimeType}, ${size}): ${downloadUrl}` : `- ${path2} (${mimeType}, ${size})`;
30513
+ });
30514
+ }
30515
+ function formatCodeRunSkippedArtifactLines(value) {
30516
+ if (!Array.isArray(value)) return [];
30517
+ return value.filter((item) => item !== null && typeof item === "object" && !Array.isArray(item)).map((artifact) => {
30518
+ const path2 = stringValue(artifact.normalized_path) || stringValue(artifact.path) || "artifact";
30519
+ const reason = stringValue(artifact.reason) || "skipped";
30520
+ return `- ${path2} (${reason})`;
30521
+ });
30522
+ }
30523
+ function stringValue(value) {
30524
+ return typeof value === "string" && value.length > 0 ? value : null;
30525
+ }
30526
+ function numberValue2(value) {
30527
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
30528
+ }
30089
30529
  function matchesAny(path2, patterns) {
30090
30530
  return patterns.some((pattern) => matchesPattern(path2, pattern));
30091
30531
  }
@@ -47082,7 +47522,7 @@ function stripQuotes(value) {
47082
47522
  }
47083
47523
  return value;
47084
47524
  }
47085
- function numberValue2(value) {
47525
+ function numberValue3(value) {
47086
47526
  if (typeof value === "number" && Number.isFinite(value)) return value;
47087
47527
  if (typeof value !== "string" || value.trim() === "") return null;
47088
47528
  const parsed = Number(value);
@@ -47243,11 +47683,11 @@ function plural(value, singular, pluralLabel = `${singular}s`) {
47243
47683
  }
47244
47684
  function buildMetadata(nodeType, type, record) {
47245
47685
  const parts = [labelForNodeType(nodeType, type)];
47246
- const lineCount = numberValue2(record.line_count ?? record.lineCount);
47247
- const pageCount = numberValue2(record.page_count ?? record.pageCount);
47248
- const wordCount = numberValue2(record.word_count ?? record.wordCount);
47249
- const duration = numberValue2(record.duration_seconds ?? record.durationSeconds);
47250
- const size = numberValue2(record.byte_length ?? record.size_bytes ?? record.sizeBytes);
47686
+ const lineCount = numberValue3(record.line_count ?? record.lineCount);
47687
+ const pageCount = numberValue3(record.page_count ?? record.pageCount);
47688
+ const wordCount = numberValue3(record.word_count ?? record.wordCount);
47689
+ const duration = numberValue3(record.duration_seconds ?? record.durationSeconds);
47690
+ const size = numberValue3(record.byte_length ?? record.size_bytes ?? record.sizeBytes);
47251
47691
  if (lineCount) parts.push(plural(lineCount, "line"));
47252
47692
  if (pageCount) parts.push(plural(pageCount, "page"));
47253
47693
  if (wordCount) parts.push(plural(wordCount, "word"));
@@ -47344,7 +47784,7 @@ function getEmbedFileReferences(embed) {
47344
47784
  const nodeType = inferNodeType(title, type);
47345
47785
  const url = urlForType(type, decoded);
47346
47786
  const mimeType = stringField2(decoded, ["mime_type", "file_type", "mimeType"]);
47347
- const createdAt = numberValue2(embed.created_at ?? embed.createdAt) ?? 0;
47787
+ const createdAt = numberValue3(embed.created_at ?? embed.createdAt) ?? 0;
47348
47788
  return [{
47349
47789
  embedId: normalizeEmbedId(embedId),
47350
47790
  contentRef: `embed:${normalizeEmbedId(embedId)}`,
@@ -48843,6 +49283,21 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
48843
49283
  hide_output: {
48844
49284
  text: "Hide output"
48845
49285
  },
49286
+ artifacts: {
49287
+ text: "Generated files"
49288
+ },
49289
+ skipped_artifacts: {
49290
+ text: "Skipped files"
49291
+ },
49292
+ download_artifact: {
49293
+ text: "Download"
49294
+ },
49295
+ download_unavailable: {
49296
+ text: "Download expired"
49297
+ },
49298
+ previous_versions: {
49299
+ text: "Previous versions"
49300
+ },
48846
49301
  hide_files: {
48847
49302
  text: "Hide files"
48848
49303
  },
@@ -74724,12 +75179,12 @@ async function handleProjectFiles(client, masterKey, rest, flags, context) {
74724
75179
  printProjectFileResult(action, project.projectId, source.source_id, result, flags);
74725
75180
  }
74726
75181
  var CliContractError = class extends Error {
75182
+ code;
74727
75183
  constructor(code, message) {
74728
75184
  super(message);
74729
75185
  this.code = code;
74730
75186
  this.name = "CliContractError";
74731
75187
  }
74732
- code;
74733
75188
  };
74734
75189
  function hasExplicitProjectContext(flags) {
74735
75190
  return flags.personal === true || typeof flags.team === "string" || typeof flags["team-id"] === "string";
@@ -78291,7 +78746,9 @@ async function handleCodeRun(client, flags, apiKey) {
78291
78746
  }
78292
78747
  const streamAuth = apiKey ? null : await client.getCodeRunStreamAuth();
78293
78748
  let finalStatus;
78749
+ let usedStream = false;
78294
78750
  if (streamAuth && result.stream_path) {
78751
+ usedStream = true;
78295
78752
  const url = buildCodeRunStreamUrl({
78296
78753
  apiUrl: client.apiUrl,
78297
78754
  executionId: result.execution_id,
@@ -78315,6 +78772,9 @@ async function handleCodeRun(client, flags, apiKey) {
78315
78772
  }
78316
78773
  if (flags.json === true) {
78317
78774
  printJson2({ ...result, final: finalStatus });
78775
+ } else {
78776
+ const finalOutput = formatCodeRunFinalStatusOutput(finalStatus, { includeOutput: !usedStream });
78777
+ if (finalOutput) process.stdout.write(finalOutput);
78318
78778
  }
78319
78779
  }
78320
78780
  async function streamCodeRunToTerminal(url, jsonMode) {
package/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  requireExactConfirmation,
9
9
  resolveProjectContext,
10
10
  serializeToYaml
11
- } from "./chunk-TA6A34K7.js";
11
+ } from "./chunk-TNSNIRLS.js";
12
12
  import "./chunk-IWKP55ZB.js";
13
13
  import "./chunk-WBBDQZZI.js";
14
14
  export {
package/dist/index.d.ts CHANGED
@@ -34,6 +34,17 @@ declare const APP_SKILL_METADATA: readonly [{
34
34
  };
35
35
  readonly required: readonly ["prompt"];
36
36
  };
37
+ readonly output_schema: {
38
+ readonly type: "object";
39
+ readonly properties: {
40
+ readonly answer: {
41
+ readonly type: "string";
42
+ };
43
+ readonly conversation: {
44
+ readonly type: "string";
45
+ };
46
+ };
47
+ };
37
48
  }, {
38
49
  readonly app_id: "audio";
39
50
  readonly skill_id: "generate";
@@ -250,6 +261,23 @@ declare const APP_SKILL_METADATA: readonly [{
250
261
  };
251
262
  readonly required: readonly ["companies"];
252
263
  };
264
+ readonly output_schema: {
265
+ readonly type: "object";
266
+ readonly properties: {
267
+ readonly summary: {
268
+ readonly type: "string";
269
+ };
270
+ readonly result_count: {
271
+ readonly type: "integer";
272
+ };
273
+ readonly provider: {
274
+ readonly type: "string";
275
+ };
276
+ readonly results: {
277
+ readonly type: "array";
278
+ };
279
+ };
280
+ };
253
281
  }, {
254
282
  readonly app_id: "code";
255
283
  readonly skill_id: "search_repos";
@@ -309,6 +337,236 @@ declare const APP_SKILL_METADATA: readonly [{
309
337
  };
310
338
  readonly required: readonly ["library", "question"];
311
339
  };
340
+ }, {
341
+ readonly app_id: "code";
342
+ readonly skill_id: "run";
343
+ readonly app_namespace_ts: "code";
344
+ readonly skill_method_ts: "run";
345
+ readonly app_namespace_py: "code";
346
+ readonly skill_method_py: "run";
347
+ readonly description_key: "app_skills.code.run.description";
348
+ readonly description: "Run a code embed in an isolated E2B sandbox. Use automatically only for code the assistant created or edited in the current turn; ask the user before running unmodified user-supplied code or after the initial run plus two unprompted reruns. The sandbox receives code files from the current chat, installs supported dependency manifests, executes the selected file, streams terminal status, and returns safe artifact metadata. Pricing is 5 credits per started minute of sandbox runtime.";
349
+ readonly schema: {
350
+ readonly type: "object";
351
+ readonly properties: {
352
+ readonly requests: {
353
+ readonly type: "array";
354
+ readonly minItems: 1;
355
+ readonly maxItems: 10;
356
+ readonly description: "Array of direct or chat-bound Code Run requests for the custom REST/SDK route.";
357
+ readonly items: {
358
+ readonly type: "object";
359
+ readonly properties: {
360
+ readonly mode: {
361
+ readonly type: "string";
362
+ readonly enum: readonly ["direct", "chat_bound"];
363
+ readonly default: "direct";
364
+ readonly description: "Direct runs use caller-supplied files and stay transient; chat_bound runs use a chat/embed target and persist encrypted output.";
365
+ };
366
+ readonly entry_path: {
367
+ readonly type: "string";
368
+ readonly description: "Entrypoint file path for direct runs.";
369
+ };
370
+ readonly files: {
371
+ readonly type: "array";
372
+ readonly maxItems: 50;
373
+ readonly description: "Direct-run files with base64-encoded content. The backend never fetches local paths or URLs.";
374
+ readonly items: {
375
+ readonly type: "object";
376
+ readonly properties: {
377
+ readonly path: {
378
+ readonly type: "string";
379
+ };
380
+ readonly content_base64: {
381
+ readonly type: "string";
382
+ };
383
+ readonly language: {
384
+ readonly type: "string";
385
+ };
386
+ readonly mime_type: {
387
+ readonly type: "string";
388
+ readonly default: "text/plain";
389
+ };
390
+ readonly is_target: {
391
+ readonly type: "boolean";
392
+ readonly default: false;
393
+ };
394
+ };
395
+ readonly required: readonly ["path", "content_base64"];
396
+ };
397
+ };
398
+ readonly chat_id: {
399
+ readonly type: "string";
400
+ readonly description: "Chat ID for chat-bound runs.";
401
+ };
402
+ readonly target_embed_id: {
403
+ readonly type: "string";
404
+ readonly description: "Target code embed ID for chat-bound runs.";
405
+ };
406
+ readonly selected_embed_ids: {
407
+ readonly type: "array";
408
+ readonly items: {
409
+ readonly type: "string";
410
+ };
411
+ readonly description: "Optional related embed IDs to include in chat-bound runs.";
412
+ };
413
+ readonly dependency_installs: {
414
+ readonly type: "array";
415
+ readonly maxItems: 20;
416
+ readonly description: "Optional explicit dependency installs.";
417
+ readonly items: {
418
+ readonly type: "object";
419
+ readonly properties: {
420
+ readonly ecosystem: {
421
+ readonly type: "string";
422
+ readonly enum: readonly ["python", "npm"];
423
+ };
424
+ readonly packages: {
425
+ readonly type: "array";
426
+ readonly items: {
427
+ readonly type: "string";
428
+ };
429
+ };
430
+ };
431
+ readonly required: readonly ["ecosystem", "packages"];
432
+ };
433
+ };
434
+ readonly enable_internet: {
435
+ readonly type: "boolean";
436
+ readonly default: true;
437
+ readonly description: "Allow outbound internet access from the E2B sandbox.";
438
+ };
439
+ };
440
+ };
441
+ };
442
+ };
443
+ readonly required: readonly ["requests"];
444
+ };
445
+ readonly output_schema: {
446
+ readonly type: "object";
447
+ readonly properties: {
448
+ readonly results: {
449
+ readonly type: "array";
450
+ readonly items: {
451
+ readonly type: "object";
452
+ readonly properties: {
453
+ readonly execution_id: {
454
+ readonly type: "string";
455
+ };
456
+ readonly status: {
457
+ readonly type: "string";
458
+ };
459
+ readonly target_filename: {
460
+ readonly type: "string";
461
+ };
462
+ readonly files: {
463
+ readonly type: "array";
464
+ readonly items: {
465
+ readonly type: "string";
466
+ };
467
+ };
468
+ readonly credits_per_minute: {
469
+ readonly type: "integer";
470
+ };
471
+ readonly persisted_output: {
472
+ readonly type: "boolean";
473
+ };
474
+ readonly stream_path: {
475
+ readonly type: "string";
476
+ };
477
+ readonly status_path: {
478
+ readonly type: "string";
479
+ };
480
+ readonly final: {
481
+ readonly type: "object";
482
+ readonly description: "Final status fetched from status_path by SDK helpers. Direct runs remain transient.";
483
+ readonly properties: {
484
+ readonly status: {
485
+ readonly type: "string";
486
+ };
487
+ readonly exit_code: {
488
+ readonly type: "integer";
489
+ };
490
+ readonly output: {
491
+ readonly type: "string";
492
+ };
493
+ readonly error: {
494
+ readonly type: "string";
495
+ };
496
+ readonly duration_seconds: {
497
+ readonly type: "number";
498
+ };
499
+ readonly charged_credits: {
500
+ readonly type: "integer";
501
+ };
502
+ readonly charged_minutes: {
503
+ readonly type: "integer";
504
+ };
505
+ readonly artifacts: {
506
+ readonly type: "array";
507
+ readonly items: {
508
+ readonly type: "object";
509
+ readonly properties: {
510
+ readonly path: {
511
+ readonly type: "string";
512
+ };
513
+ readonly normalized_path: {
514
+ readonly type: "string";
515
+ };
516
+ readonly mime_type: {
517
+ readonly type: "string";
518
+ };
519
+ readonly kind: {
520
+ readonly type: "string";
521
+ };
522
+ readonly size_bytes: {
523
+ readonly type: "integer";
524
+ };
525
+ readonly status: {
526
+ readonly type: "string";
527
+ };
528
+ readonly asset_id: {
529
+ readonly type: "string";
530
+ };
531
+ readonly file_id: {
532
+ readonly type: "string";
533
+ };
534
+ readonly variant: {
535
+ readonly type: "string";
536
+ };
537
+ readonly version: {
538
+ readonly type: "integer";
539
+ };
540
+ readonly download_url: {
541
+ readonly type: "string";
542
+ };
543
+ };
544
+ };
545
+ };
546
+ readonly skipped_artifacts: {
547
+ readonly type: "array";
548
+ readonly items: {
549
+ readonly type: "object";
550
+ readonly properties: {
551
+ readonly path: {
552
+ readonly type: "string";
553
+ };
554
+ readonly normalized_path: {
555
+ readonly type: "string";
556
+ };
557
+ readonly reason: {
558
+ readonly type: "string";
559
+ };
560
+ };
561
+ };
562
+ };
563
+ };
564
+ };
565
+ };
566
+ };
567
+ };
568
+ };
569
+ };
312
570
  }, {
313
571
  readonly app_id: "code";
314
572
  readonly skill_id: "image_to_html";
@@ -654,6 +912,17 @@ declare const APP_SKILL_METADATA: readonly [{
654
912
  };
655
913
  readonly required: readonly ["requests"];
656
914
  };
915
+ readonly output_schema: {
916
+ readonly type: "object";
917
+ readonly properties: {
918
+ readonly summary: {
919
+ readonly type: "string";
920
+ };
921
+ readonly result_count: {
922
+ readonly type: "integer";
923
+ };
924
+ };
925
+ };
657
926
  }, {
658
927
  readonly app_id: "fitness";
659
928
  readonly skill_id: "search_locations";
@@ -1428,6 +1697,17 @@ declare const APP_SKILL_METADATA: readonly [{
1428
1697
  };
1429
1698
  readonly required: readonly ["requests"];
1430
1699
  };
1700
+ readonly output_schema: {
1701
+ readonly type: "object";
1702
+ readonly properties: {
1703
+ readonly summary: {
1704
+ readonly type: "string";
1705
+ };
1706
+ readonly result_count: {
1707
+ readonly type: "integer";
1708
+ };
1709
+ };
1710
+ };
1431
1711
  }, {
1432
1712
  readonly app_id: "nutrition";
1433
1713
  readonly skill_id: "search_recipes";
@@ -2754,6 +3034,20 @@ declare const APP_SKILL_METADATA: readonly [{
2754
3034
  };
2755
3035
  readonly required: readonly ["location"];
2756
3036
  };
3037
+ readonly output_schema: {
3038
+ readonly type: "object";
3039
+ readonly properties: {
3040
+ readonly summary: {
3041
+ readonly type: "string";
3042
+ };
3043
+ readonly rain_probability: {
3044
+ readonly type: "number";
3045
+ };
3046
+ readonly max_temperature_c: {
3047
+ readonly type: "number";
3048
+ };
3049
+ };
3050
+ };
2757
3051
  }, {
2758
3052
  readonly app_id: "weather";
2759
3053
  readonly skill_id: "rain_radar";
@@ -2850,6 +3144,17 @@ declare const APP_SKILL_METADATA: readonly [{
2850
3144
  };
2851
3145
  readonly required: readonly ["requests"];
2852
3146
  };
3147
+ readonly output_schema: {
3148
+ readonly type: "object";
3149
+ readonly properties: {
3150
+ readonly summary: {
3151
+ readonly type: "string";
3152
+ };
3153
+ readonly result_count: {
3154
+ readonly type: "integer";
3155
+ };
3156
+ };
3157
+ };
2853
3158
  }, {
2854
3159
  readonly app_id: "web";
2855
3160
  readonly skill_id: "read";
@@ -3041,6 +3346,12 @@ declare class CodeAppSkills {
3041
3346
  * Skill: code/remove_secrets
3042
3347
  */
3043
3348
  removeSecrets<T = unknown>(input: SkillInput, options?: AppSkillRunOptions): Promise<T>;
3349
+ /**
3350
+ * Run a code embed in an isolated E2B sandbox. Use automatically only for code the assistant created or edited in the current turn; ask the user before running unmodified user-supplied code or after the initial run plus two unprompted reruns. The sandbox receives code files from the current chat, installs supported dependency manifests, executes the selected file, streams terminal status, and returns safe artifact metadata. Pricing is 5 credits per started minute of sandbox runtime.
3351
+ * Description key: app_skills.code.run.description
3352
+ * Skill: code/run
3353
+ */
3354
+ run<T = unknown>(input: SkillInput, options?: AppSkillRunOptions): Promise<T>;
3044
3355
  /**
3045
3356
  * Search GitHub repositories. Use this instead of web.search whenever the user asks to find GitHub repos, repositories, open-source libraries, starred repos, or repo examples by topic, language, framework, or project need. Returns licensed repository embeds. Costs 10 credits per search.
3046
3357
  * Description key: code.search_repos.description
@@ -4266,6 +4577,9 @@ declare class OpenMates {
4266
4577
  private publicHeaders;
4267
4578
  private parseResponse;
4268
4579
  private resolveAsyncSkillResponse;
4580
+ private resolveCodeRunSkillResponse;
4581
+ private pollCodeRunUntilComplete;
4582
+ private normalizeCodeRunStatusPath;
4269
4583
  private pollTaskUntilComplete;
4270
4584
  private safeJson;
4271
4585
  private wrapResolvedSkillResult;
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  renderPlanList,
40
40
  renderSupportInfo,
41
41
  serializeToYaml
42
- } from "./chunk-TA6A34K7.js";
42
+ } from "./chunk-TNSNIRLS.js";
43
43
  import "./chunk-IWKP55ZB.js";
44
44
  import "./chunk-WBBDQZZI.js";
45
45
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.17.0-alpha.2",
3
+ "version": "0.17.0-alpha.4",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",