@wayai/cli 0.3.224 → 0.3.226

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/index.js CHANGED
@@ -5113,10 +5113,10 @@ var init_chunk_Q7KIQHAZ = __esm({
5113
5113
  }
5114
5114
  });
5115
5115
 
5116
- // ../../packages/core/dist/chunk-QUGQIL47.js
5117
- var connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery;
5118
- var init_chunk_QUGQIL47 = __esm({
5119
- "../../packages/core/dist/chunk-QUGQIL47.js"() {
5116
+ // ../../packages/core/dist/chunk-WBFLPPDI.js
5117
+ var connectionIdParam, connectorIdParam, listConnectionsQuery, deleteConnectionQuery, addConnectionBody, editConnectionBody, PRODUCTION_DIRECT_FIELDS, BESIDE_LINK_FIELDS, setProductionCredentialBody, registerWhatsappQuery, registerWhatsappBody, retryProvisioningQuery, resendDomainStatusQuery;
5118
+ var init_chunk_WBFLPPDI = __esm({
5119
+ "../../packages/core/dist/chunk-WBFLPPDI.js"() {
5120
5120
  "use strict";
5121
5121
  init_chunk_HZ6CADSY();
5122
5122
  init_zod();
@@ -5146,7 +5146,8 @@ var init_chunk_QUGQIL47 = __esm({
5146
5146
  hub_id: uuidSchema,
5147
5147
  sync_credentials_to_production: external_exports.boolean().optional()
5148
5148
  }).passthrough();
5149
- PRODUCTION_DIRECT_FIELDS = ["username", "api_key", "access_token", "password", "refresh_token", "webhook_secret_token", "webhook_signing_secret"];
5149
+ PRODUCTION_DIRECT_FIELDS = ["username", "api_key", "access_token", "password", "refresh_token", "webhook_secret_token", "webhook_signing_secret", "github_app_id", "github_app_private_key"];
5150
+ BESIDE_LINK_FIELDS = /* @__PURE__ */ new Set(["webhook_secret_token", "github_app_id", "github_app_private_key"]);
5150
5151
  setProductionCredentialBody = external_exports.object({
5151
5152
  hub_id: uuidSchema,
5152
5153
  organization_credential_id: external_exports.string().nullable().optional(),
@@ -5157,12 +5158,14 @@ var init_chunk_QUGQIL47 = __esm({
5157
5158
  password: external_exports.string().optional(),
5158
5159
  refresh_token: external_exports.string().optional(),
5159
5160
  webhook_secret_token: external_exports.string().optional(),
5160
- webhook_signing_secret: external_exports.string().optional()
5161
+ webhook_signing_secret: external_exports.string().optional(),
5162
+ github_app_id: external_exports.string().optional(),
5163
+ github_app_private_key: external_exports.string().optional()
5161
5164
  }).strict().superRefine((data, ctx) => {
5162
5165
  const hasOrgLink = !!data.organization_credential_id || !!data.organization_credential_token_id;
5163
5166
  const sets = (f) => data[f] != null && data[f] !== `__USE_EXISTING_${f.toUpperCase()}__`;
5164
5167
  const hasDirect = PRODUCTION_DIRECT_FIELDS.some(sets);
5165
- const hasDirectBesideLink = PRODUCTION_DIRECT_FIELDS.some((f) => f !== "webhook_secret_token" && sets(f));
5168
+ const hasDirectBesideLink = PRODUCTION_DIRECT_FIELDS.some((f) => !BESIDE_LINK_FIELDS.has(f) && sets(f));
5166
5169
  if (hasOrgLink && hasDirectBesideLink) {
5167
5170
  ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "Provide either an organization credential link or direct credential fields, not both" });
5168
5171
  }
@@ -6808,7 +6811,7 @@ var init_chunk_E4DIIOOE = __esm({
6808
6811
  }
6809
6812
  });
6810
6813
 
6811
- // ../../packages/core/dist/chunk-GMWMQ4YA.js
6814
+ // ../../packages/core/dist/chunk-OGXIPFQY.js
6812
6815
  function spokenLineField(label, description2) {
6813
6816
  return { type: "text", label, maxLength: SPOKEN_LINE_MAX_CHARS, default: "", description: description2 };
6814
6817
  }
@@ -6818,8 +6821,8 @@ function byLowercaseName(a, b) {
6818
6821
  return x < y ? -1 : x > y ? 1 : 0;
6819
6822
  }
6820
6823
  var CALLER_LANGUAGE, TTS_VOICE_REPLY_ENABLED_FIELD, COPILOT_TRIGGER_FIELD, SANDBOX_AGENT_FIELDS, AUDIO_LANGUAGE_OPTIONS, whatsapp, instagram, resend, telegram, API_CHANNEL_DELIVERY_EVENTS, apiChannel, OPENAI_REASONING_MODELS, openai, anthropic, googleAiStudio, openRouter, xai, groqStt, openaiStt, elevenLabsStt, openaiTts, groqTts, elevenLabsTts, GEMINI_TTS_VOICES, googleTts, wayai, externalResources, restApiTool, mcpServer, REKOR_TOOLSET_SERVICE_NAME, rekorToolset, CLAUDE_HARNESS_MODELS, CLAUDE_HARNESS_MODEL_OPTIONS, HARNESS_MCP_SERVERS_FIELD, HARNESS_EGRESS_FIELDS, claudeManagedAgents, SPOKEN_LINE_MAX_CHARS, gptLive, CONNECTORS;
6821
- var init_chunk_GMWMQ4YA = __esm({
6822
- "../../packages/core/dist/chunk-GMWMQ4YA.js"() {
6824
+ var init_chunk_OGXIPFQY = __esm({
6825
+ "../../packages/core/dist/chunk-OGXIPFQY.js"() {
6823
6826
  "use strict";
6824
6827
  CALLER_LANGUAGE = "caller";
6825
6828
  TTS_VOICE_REPLY_ENABLED_FIELD = {
@@ -7683,12 +7686,12 @@ var init_chunk_GMWMQ4YA = __esm({
7683
7686
  // The managed session is conversation-lifetime and is NOT reaped at this deadline.
7684
7687
  max_session_minutes: { type: "number", label: "Max Turn (minutes)", min: 1, max: 480, default: 60, description: "Hard cap on a single turn's drain wall-clock, and the bound on the per-turn harness token TTL. The managed session itself lives for the conversation \u2014 it is not reaped at this deadline." },
7685
7688
  ...HARNESS_EGRESS_FIELDS,
7686
- // repo_url only, with no `repo_branch`. The Managed Agents
7687
- // `github_repository` resource exposes no branch/ref/checkout field, so a
7688
- // `repo_branch` setting could not be honoured; per this connector's own rule it is
7689
- // ABSENT rather than silently ignored. Working on a non-default branch is an
7690
- // agent-instruction concern (the agent checks out via git / the GitHub MCP server).
7691
- repo_url: { type: "text", label: "Repository URL", description: "Optional git repository cloned into the managed workspace at session start. The managed API clones the DEFAULT branch and exposes no branch setting \u2014 to work on another branch, instruct the agent to check it out." },
7689
+ // repo_url only, with no `repo_branch`: the session clones the default branch. The
7690
+ // vendor's `github_repository` resource now takes a `checkout` (branch or commit,
7691
+ // platform.claude.com/docs/en/managed-agents/github, 2026-10-19); a branch setting is
7692
+ // left to the "work on a repository" agent template (wayai-pro/wayai#5083 Phase 4).
7693
+ // Until then, working on another branch is an agent-instruction concern.
7694
+ repo_url: { type: "text", label: "Repository URL", description: "Optional GitHub repository (https://github.com/<owner>/<repo>) cloned into the managed workspace at session start. Needs the connection's GitHub App installed on it. The DEFAULT branch is cloned \u2014 to work on another branch, instruct the agent to check it out." },
7692
7695
  ...COPILOT_TRIGGER_FIELD
7693
7696
  },
7694
7697
  channel_settings_schema: null,
@@ -7697,7 +7700,8 @@ var init_chunk_GMWMQ4YA = __esm({
7697
7700
  api_key: {
7698
7701
  connection_display_name: { type: "text", label: "Connection Name", placeholder: "Enter a name for this connection", description: "This name will be used to identify the connection in the system", required: true },
7699
7702
  api_key: { type: "password", label: "API Key", placeholder: "Enter your Anthropic API key", description: "Anthropic API key for the Managed Agents API. Used only from the WayAI Worker \u2014 no sandbox ever sees it.", required: true, maskInEdit: true, useExistingPlaceholder: "__USE_EXISTING_API_KEY__" },
7700
- access_token: { type: "password", label: "GitHub Token (Optional)", placeholder: "Enter a GitHub personal access token", description: "Optional: personal access token for the repo_url checkout. Anthropic's git proxy injects it after requests leave the sandbox \u2014 it never enters the sandbox.", maskInEdit: true, useExistingPlaceholder: "__USE_EXISTING_ACCESS_TOKEN__" },
7703
+ github_app_id: { type: "password", label: "GitHub App ID (Optional)", placeholder: "Your GitHub App's App ID", description: "Optional: the App ID of your organization's GitHub App, for agents with a Repository URL. Each session gets a one-hour token for its one repository, with contents and pull requests access only.", maskInEdit: true, useExistingPlaceholder: "__USE_EXISTING_GITHUB_APP_ID__" },
7704
+ github_app_private_key: { type: "password", label: "GitHub App Private Key (Optional)", placeholder: "-----BEGIN RSA PRIVATE KEY-----", description: "Optional: the private key (.pem) GitHub generated for that App. It stays in WayAI: only each session's one-hour token reaches Anthropic.", maskInEdit: true, useExistingPlaceholder: "__USE_EXISTING_GITHUB_APP_PRIVATE_KEY__" },
7701
7705
  webhook_secret_token: { type: "password", label: "Webhook Signing Secret", placeholder: "whsec_\u2026", description: "Signing secret of this connection's webhook endpoint in the Claude Console. Without it, a finished turn is picked up only by a check every 5 minutes.", maskInEdit: true, useExistingPlaceholder: "__USE_EXISTING_WEBHOOK_SECRET_TOKEN__" }
7702
7706
  }
7703
7707
  },
@@ -7784,13 +7788,13 @@ var init_chunk_GMWMQ4YA = __esm({
7784
7788
  }
7785
7789
  });
7786
7790
 
7787
- // ../../packages/core/dist/chunk-PEXTNF6S.js
7791
+ // ../../packages/core/dist/chunk-QZZ3OHLV.js
7788
7792
  var evalCallInstant, EVAL_CALL_MIN_SECONDS, EVAL_CALL_MAX_SECONDS, EVAL_CALL_SPOKEN_LINE_MAX_CHARS, hubScoped2, createEvalCallBody, createEvalCallResponse, evalCallConversationQuery, evalCallRecordQuery, evalCallSpeaker, evalCallUtterance, evalCallTurn, evalCallRecording, evalCallRecordResponse, evalCallFinishResponse;
7789
- var init_chunk_PEXTNF6S = __esm({
7790
- "../../packages/core/dist/chunk-PEXTNF6S.js"() {
7793
+ var init_chunk_QZZ3OHLV = __esm({
7794
+ "../../packages/core/dist/chunk-QZZ3OHLV.js"() {
7791
7795
  "use strict";
7792
7796
  init_chunk_E4DIIOOE();
7793
- init_chunk_GMWMQ4YA();
7797
+ init_chunk_OGXIPFQY();
7794
7798
  init_chunk_HZ6CADSY();
7795
7799
  init_chunk_MIWZOSPI();
7796
7800
  init_zod();
@@ -14942,7 +14946,7 @@ var init_contracts = __esm({
14942
14946
  init_chunk_VXEAR36B();
14943
14947
  init_chunk_TIZ57ZBA();
14944
14948
  init_chunk_Q7KIQHAZ();
14945
- init_chunk_QUGQIL47();
14949
+ init_chunk_WBFLPPDI();
14946
14950
  init_chunk_IPXBFWUU();
14947
14951
  init_chunk_GK27ENTT();
14948
14952
  init_chunk_GPM7PE44();
@@ -14960,7 +14964,7 @@ var init_contracts = __esm({
14960
14964
  init_chunk_I3O2RACG();
14961
14965
  init_chunk_34LE6P7E();
14962
14966
  init_chunk_FPSDNS2E();
14963
- init_chunk_PEXTNF6S();
14967
+ init_chunk_QZZ3OHLV();
14964
14968
  init_chunk_C4HEZ7ZI();
14965
14969
  init_chunk_IR2NOSI3();
14966
14970
  init_chunk_EA23LSDS();
@@ -14994,7 +14998,7 @@ var init_contracts = __esm({
14994
14998
  init_chunk_4LXDRTO4();
14995
14999
  init_chunk_E4DIIOOE();
14996
15000
  init_chunk_7CYHPF35();
14997
- init_chunk_GMWMQ4YA();
15001
+ init_chunk_OGXIPFQY();
14998
15002
  init_chunk_LQSENJ26();
14999
15003
  init_chunk_UZ7SPBM3();
15000
15004
  init_chunk_NVKU5PPQ();
@@ -32623,7 +32627,7 @@ var init_set_connection_credential = __esm({
32623
32627
  init_workspace();
32624
32628
  init_utils();
32625
32629
  init_push();
32626
- VALID_FIELDS = ["api_key", "access_token", "password", "refresh_token", "webhook_secret_token", "username"];
32630
+ VALID_FIELDS = ["api_key", "access_token", "password", "refresh_token", "webhook_secret_token", "username", "github_app_id", "github_app_private_key"];
32627
32631
  }
32628
32632
  });
32629
32633
 
@@ -34724,7 +34728,7 @@ Files in "${safe(productionId)}":`);
34724
34728
  const reasons = [
34725
34729
  ...desired.stops.map((stop) => describeStop(stop)),
34726
34730
  ...limited,
34727
- ...conflicts.map((c) => `${c.fileType}/${c.path}: production's copy differs from its source (${c.what}). It was edited after it moved, so it is not overwritten. Remove it from production to move it again.`)
34731
+ ...conflicts.map((c) => `${c.fileType}/${c.path}: production's copy differs from its source (${c.what}). It was edited after it moved, or created there by someone else, so it is not overwritten. Move or remove it in production to move its source.`)
34728
34732
  ];
34729
34733
  const result = {
34730
34734
  production: productionId,
@@ -34771,7 +34775,16 @@ Dry run: nothing written (${writes === 0 ? "nothing to write" : `${writes} write
34771
34775
  }
34772
34776
  }
34773
34777
  }
34774
- for (const file of creates) await kb.putFile(productionId, file, await bodyBytes(reader, file));
34778
+ for (const [written, file] of creates.entries()) {
34779
+ try {
34780
+ await kb.putFile(productionId, file, await bodyBytes(reader, file), { createOnly: true });
34781
+ } catch (err) {
34782
+ if (!(err instanceof ApiError && err.status === 412)) throw err;
34783
+ throw expected(
34784
+ `${safe(file.fileType)}/${safe(file.path)}: a file was created at this path in "${safe(productionId)}" while the migration ran, so it was not written (the file there is kept). ${written} of ${creates.length} file(s) were written before it. Run the migration again: it writes only what has not moved, and stops before any write while the file at this path differs from its source.`
34785
+ );
34786
+ }
34787
+ }
34775
34788
  io.log(
34776
34789
  `
34777
34790
  Done: ${toWrite.length} file type(s) written, ${toPromote.length} promoted, ${creates.length} file(s) written. The preview holds none of these files: copy them with \`${refreshPreviewCommand(opts.orgId, opts.base)}\`.`
@@ -34783,6 +34796,7 @@ var init_migrate2 = __esm({
34783
34796
  "src/knowledge/migrate.ts"() {
34784
34797
  "use strict";
34785
34798
  init_resource_files();
34799
+ init_api_client();
34786
34800
  init_expected();
34787
34801
  init_terminal_output();
34788
34802
  init_utils();
@@ -35203,13 +35217,13 @@ function knowledgeBase(client) {
35203
35217
  // `requestRaw`: the page is read whole, `{ data: … }`, as WayAI's copy of its answer declares it
35204
35218
  // (`@wayai/core/contracts` `rekorFileSnapshotAnswerSchema`).
35205
35219
  snapshotPage: (preview, cursor) => pacer.run(() => client.requestRaw("POST", `/v1/${baseSeg(preview)}/files/snapshot`, cursor === void 0 ? {} : { cursor })),
35206
- async putFile(base, file, bytes) {
35220
+ async putFile(base, file, bytes, { createOnly }) {
35207
35221
  await pacer.run(
35208
35222
  () => client.upload(
35209
35223
  `/v1/${baseSeg(base)}/files/${typeSeg(file.fileType)}/${pathSegments(file.path)}`,
35210
35224
  bytes,
35211
35225
  file.contentType,
35212
- fileWriteHeaders({ label: MIGRATION_LABEL, metadata: file.metadata })
35226
+ fileWriteHeaders({ createOnly, label: MIGRATION_LABEL, metadata: file.metadata })
35213
35227
  )
35214
35228
  );
35215
35229
  }
@@ -35353,7 +35367,7 @@ var COUNTER_KEYS, STT_PRICING, CONTAINER_PRICING, connectorById, nativeToolById;
35353
35367
  var init_catalog = __esm({
35354
35368
  "../../packages/core/dist/catalog/index.js"() {
35355
35369
  "use strict";
35356
- init_chunk_GMWMQ4YA();
35370
+ init_chunk_OGXIPFQY();
35357
35371
  init_chunk_LQSENJ26();
35358
35372
  init_chunk_UZ7SPBM3();
35359
35373
  init_chunk_MIWZOSPI();
@@ -35947,7 +35961,10 @@ migrate: move knowledge resources into the organization's knowledge base.
35947
35961
 
35948
35962
  Without --hub, it moves the organization's knowledge resources; with --hub, that hub's own
35949
35963
  (read from its production hub), once the organization's have moved. Each resource becomes a
35950
- file type, its files keep their paths, and each described folder gains an _index.md.
35964
+ file type, its files keep their paths, and each described folder gains an _index.md. Files are
35965
+ written create-only: one created at its path while it runs is kept, and the run stops there,
35966
+ naming it. A re-run writes what is left once that file matches its source or is moved or
35967
+ removed; until then it stops before any write, naming it.
35951
35968
 
35952
35969
  --base The knowledge base: its production base, or the preview its file types are
35953
35970
  written in. File types are written in the preview and promoted; files are