@vypdev/copilot 3.5.5 → 3.5.6

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.
@@ -38516,13 +38516,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
38516
38516
  exports.buildCodexExecutionPolicy = buildCodexExecutionPolicy;
38517
38517
  const agent_execution_plan_1 = __nccwpck_require__(12253);
38518
38518
  const provider_execution_policy_1 = __nccwpck_require__(50480);
38519
- const strict_output_schema_policy_1 = __nccwpck_require__(56743);
38519
+ const codex_output_schema_policy_1 = __nccwpck_require__(71503);
38520
38520
  function buildCodexExecutionPolicy(input) {
38521
38521
  const { configuration } = input;
38522
38522
  if (configuration.provider !== 'codex')
38523
38523
  throw new Error('Codex policy requires Codex configuration.');
38524
- if (input.outputSchema)
38525
- (0, strict_output_schema_policy_1.assertStrictOutputSchema)(input.outputSchema);
38524
+ const nativeSchema = input.outputSchema ? (0, codex_output_schema_policy_1.projectCodexOutputSchema)(input.outputSchema) : undefined;
38526
38525
  const workspaceMode = (0, agent_execution_plan_1.workspaceModeForCapability)(input.capability);
38527
38526
  const outputSchemaPath = input.outputSchema
38528
38527
  ? (0, provider_execution_policy_1.managedArtifactPath)(input.runtimeDirectory, 'response.schema.json')
@@ -38530,7 +38529,7 @@ function buildCodexExecutionPolicy(input) {
38530
38529
  const moduleCache = (0, provider_execution_policy_1.managedArtifactPath)(input.runtimeDirectory, 'shell/local/powershell-module-analysis.cache');
38531
38530
  const artifacts = outputSchemaPath ? [{
38532
38531
  path: outputSchemaPath,
38533
- contents: JSON.stringify(input.outputSchema),
38532
+ contents: JSON.stringify(nativeSchema),
38534
38533
  purpose: 'output-schema',
38535
38534
  }] : [];
38536
38535
  const argv = [
@@ -38584,6 +38583,38 @@ function tomlString(value) {
38584
38583
  }
38585
38584
 
38586
38585
 
38586
+ /***/ }),
38587
+
38588
+ /***/ 71503:
38589
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
38590
+
38591
+ "use strict";
38592
+
38593
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
38594
+ exports.projectCodexOutputSchema = projectCodexOutputSchema;
38595
+ const strict_output_schema_policy_1 = __nccwpck_require__(56743);
38596
+ /** Keep string-size acceptance local; Codex's native decoder receives the compatible closed shape. */
38597
+ function projectCodexOutputSchema(schema) {
38598
+ (0, strict_output_schema_policy_1.assertStrictOutputSchema)(schema);
38599
+ return projectNode(schema);
38600
+ }
38601
+ function projectNode(schema) {
38602
+ const projected = { ...schema };
38603
+ const types = typeof schema.type === 'string' ? [schema.type] : schema.type;
38604
+ if (types.includes('string')) {
38605
+ delete projected.minLength;
38606
+ delete projected.maxLength;
38607
+ }
38608
+ if (types.includes('object')) {
38609
+ projected.properties = Object.fromEntries(Object.entries(schema.properties)
38610
+ .map(([name, nested]) => [name, projectNode(nested)]));
38611
+ }
38612
+ if (types.includes('array'))
38613
+ projected.items = projectNode(schema.items);
38614
+ return projected;
38615
+ }
38616
+
38617
+
38587
38618
  /***/ }),
38588
38619
 
38589
38620
  /***/ 93955:
@@ -45865,7 +45896,7 @@ Do not add the \`${profile.deployment.launcherLabel}\` label, dispatch a deploym
45865
45896
 
45866
45897
  Never expose credentials, tokens, private keys, or other secrets in issues, commits, pull requests, logs, or diagnostic comments.
45867
45898
 
45868
- For the full contributor flow, read [repository collaboration](../docs/agents/repository-collaboration.mdx). For drift and recovery, read [guidance troubleshooting](../docs/agents/repository-guidance-troubleshooting.mdx).
45899
+ For the full contributor flow, read [repository collaboration](https://github.com/vypdev/copilot/blob/master/docs/agents/repository-collaboration.mdx). For drift and recovery, read [guidance troubleshooting](https://github.com/vypdev/copilot/blob/master/docs/agents/repository-guidance-troubleshooting.mdx).
45869
45900
  `;
45870
45901
  }
45871
45902
  function renderRepositoryAgentSkill() {
@@ -51269,7 +51300,7 @@ function buildSetupPatPermissionRequirements() {
51269
51300
  requirement({ role: 'setup', scope: 'repository', permission: 'Issues', level: 'write', applicability: 'conditional', condition: 'Issue workflows enabled', reason: 'Provision labels and issue resources.', probe: 'issues' }),
51270
51301
  requirement({ role: 'setup', scope: 'repository', permission: 'Actions', level: 'write', applicability: 'conditional', condition: 'Credential health enabled', reason: 'Inspect and dispatch credential-health workflows.', probe: 'actions' }),
51271
51302
  requirement({ role: 'setup', scope: 'repository', permission: 'Actions', level: 'read', idSuffix: 'read', applicability: 'conditional', condition: 'Pull-request approval enabled', reason: 'Inspect CI workflow runs and jobs for exact producer identities.', probe: 'actions' }),
51272
- requirement({ role: 'setup', scope: 'repository', permission: 'Checks', level: 'read', applicability: 'conditional', condition: 'Pull-request approval enabled', reason: 'Discover exact CI check and producer identities.', probe: 'checks' }),
51303
+ requirement({ role: 'setup', scope: 'repository', permission: 'Checks', level: 'read', applicability: 'conditional', condition: 'Guarded pull-request approval enabled', reason: 'Discover exact CI check and producer identities for guarded approval.', probe: 'checks' }),
51273
51304
  requirement({ role: 'setup', scope: 'repository', permission: 'Administration', level: 'read', applicability: 'conditional', condition: 'Release, hotfix, or guarded approval enabled', reason: 'Inspect branch protection and rulesets.', probe: 'administration' }),
51274
51305
  requirement({ role: 'setup', scope: 'repository', permission: 'Workflows', level: 'write', applicability: 'conditional', condition: 'Temporary health workflow required', reason: 'Bootstrap a missing credential-health workflow.', probe: 'workflows' }),
51275
51306
  requirement({ role: 'setup', scope: 'organization', permission: 'Secrets', level: 'write', applicability: 'conditional', condition: 'Organization Secret storage selected', reason: 'Inspect and provision organization Actions Secrets.', probe: 'secrets' }),
@@ -51387,7 +51418,12 @@ function buildSetupPatRequirements(configuration, organization, remote, projects
51387
51418
  })] : []),
51388
51419
  ...(approvalEnabled ? [
51389
51420
  requirement({ role: 'setup', scope: 'repository', permission: 'Actions', level: 'read', reason: 'Inspect CI workflow runs and jobs for approval evidence.', probe: 'actions' }),
51390
- requirement({ role: 'setup', scope: 'repository', permission: 'Checks', level: 'read', reason: 'Discover exact CI check and producer identities.', probe: 'checks' }),
51421
+ ] : []),
51422
+ // Recommendation installs can use explicitly selected producer tuples
51423
+ // while discovery remains unverified. Fine-grained operator PATs cannot
51424
+ // call the Checks API; guarded setup and the runtime bot still need it.
51425
+ ...(guardedApproval ? [
51426
+ requirement({ role: 'setup', scope: 'repository', permission: 'Checks', level: 'read', reason: 'Discover exact CI check and producer identities for guarded approval.', probe: 'checks' }),
51391
51427
  ] : []),
51392
51428
  ...(needsCredentialHealthBootstrap || needsBotActionsFixture ? [
51393
51429
  requirement({ role: 'setup', scope: 'repository', permission: 'Workflows', level: 'write',
@@ -58770,6 +58806,7 @@ const agent_response_length_failure_1 = __nccwpck_require__(28528);
58770
58806
  /** Size and typed format failures share one regeneration; the writer still validates every candidate. */
58771
58807
  async function draftSddMarkdown(agent, configuration, plan, prompt, validate) {
58772
58808
  const maximum = plan.action === 'update' ? pre_branch_sdd_1.SDD_MAX_UPDATE_CHARACTERS : pre_branch_sdd_1.SDD_MAX_DRAFT_CHARACTERS;
58809
+ const target = Math.min(10000, Math.floor(maximum / 3));
58773
58810
  const schema = {
58774
58811
  type: 'object',
58775
58812
  properties: { markdown: { type: 'string', minLength: pre_branch_sdd_1.SDD_MIN_DRAFT_CHARACTERS, maxLength: maximum } },
@@ -58777,7 +58814,7 @@ async function draftSddMarkdown(agent, configuration, plan, prompt, validate) {
58777
58814
  };
58778
58815
  let problem = 'size';
58779
58816
  let formatReason = 'required-heading';
58780
- const contractPrompt = `${prompt}\n\nDraft contract: keep the complete draft within ${maximum} characters; aim for ${Math.floor(maximum * 2 / 3)} characters. Preserve the same owner, decisions and requirements. Include these literal canonical heading prefixes as Markdown headings, with the shown capitalization:\n${pre_branch_sdd_1.SDD_REQUIRED_HEADINGS.join('\n')}\nUse the canonical numeric test-budget table in section 14: Area | Minimum distinct cases | Behaviors/risks covered. Every allocation and the Total must be a positive integer, and the Total must equal the sum of the allocations. A justified positive integer sentence of distinct tests or cases is also accepted. Return only the required JSON.`;
58817
+ const contractPrompt = `${prompt}\n\nDraft contract: keep the complete draft within ${maximum} characters; aim for ${target} characters. Preserve the same owner, decisions and requirements. Include these literal canonical heading prefixes as Markdown headings, with the shown capitalization:\n${pre_branch_sdd_1.SDD_REQUIRED_HEADINGS.join('\n')}\nUse the canonical numeric test-budget table in section 14: Area | Minimum distinct cases | Behaviors/risks covered. Every allocation and the Total must be a positive integer, and the Total must equal the sum of the allocations. A justified positive integer sentence of distinct tests or cases is also accepted. Return only the required JSON.`;
58781
58818
  for (let attempt = 0; attempt < 2; attempt++) {
58782
58819
  let value;
58783
58820
  try {
@@ -77497,6 +77534,7 @@ function createAgentProcessLifecycle(child, plan, signal, resolve, reject, onToo
77497
77534
  const stdoutChunks = [];
77498
77535
  let stderrBytes = 0;
77499
77536
  const stderrChunks = [];
77537
+ let stderrTail = Buffer.alloc(0);
77500
77538
  let outputBytes = 0;
77501
77539
  let settled = false;
77502
77540
  let terminationError;
@@ -77562,6 +77600,9 @@ function createAgentProcessLifecycle(child, plan, signal, resolve, reject, onToo
77562
77600
  stderrChunks.push(retained);
77563
77601
  stderrBytes += retained.byteLength;
77564
77602
  }
77603
+ const retainedTail = chunk.subarray(-MAX_STDERR_BYTES);
77604
+ const previousTail = stderrTail.subarray(Math.max(0, stderrTail.length + retainedTail.length - MAX_STDERR_BYTES));
77605
+ stderrTail = Buffer.concat([previousTail, retainedTail]);
77565
77606
  };
77566
77607
  const onStdinError = () => beginTermination(new agent_cli_contracts_1.AgentCliError('Unable to send the prompt to the agent CLI.', 'process'));
77567
77608
  const onError = () => finishReject(new agent_cli_contracts_1.AgentCliError('Unable to start agent CLI.', 'process'));
@@ -77572,8 +77613,11 @@ function createAgentProcessLifecycle(child, plan, signal, resolve, reject, onToo
77572
77613
  }
77573
77614
  if (code !== 0) {
77574
77615
  const diagnostic = stderrBytes > 0 ? ' Diagnostic output was suppressed for safety.' : '';
77616
+ const terminalDiagnostic = (0, agent_cli_exit_diagnostic_1.classifyAgentCliExitDiagnostic)(stderrTail.toString('utf8'));
77575
77617
  const exitDiagnostic = stderrBytes > 0
77576
- ? (0, agent_cli_exit_diagnostic_1.classifyAgentCliExitDiagnostic)(Buffer.concat(stderrChunks).toString('utf8'))
77618
+ ? terminalDiagnostic === 'unclassified'
77619
+ ? (0, agent_cli_exit_diagnostic_1.classifyAgentCliExitDiagnostic)(Buffer.concat(stderrChunks).toString('utf8'))
77620
+ : terminalDiagnostic
77577
77621
  : undefined;
77578
77622
  finishReject(new agent_cli_contracts_1.AgentCliError(`Agent CLI exited with code ${code}.${diagnostic}`, 'process', code === 75, code ?? undefined, exitDiagnostic));
77579
77623
  return;
@@ -77763,6 +77807,9 @@ function classifyAgentCliToolDiagnostic(stderr) {
77763
77807
  }
77764
77808
  /** Provider stderr is untrusted and may contain credentials. Return a fixed code only. */
77765
77809
  function classifyAgentCliExitDiagnostic(stderr) {
77810
+ if (/^ERROR: Incomplete response returned, reason: max_output_tokens\r?$/mu.test(stderr)) {
77811
+ return 'reported-output-token-limit';
77812
+ }
77766
77813
  const toolDiagnostic = classifyAgentCliToolDiagnostic(stderr);
77767
77814
  if (toolDiagnostic)
77768
77815
  return toolDiagnostic;
@@ -39628,13 +39628,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
39628
39628
  exports.buildCodexExecutionPolicy = buildCodexExecutionPolicy;
39629
39629
  const agent_execution_plan_1 = __nccwpck_require__(12253);
39630
39630
  const provider_execution_policy_1 = __nccwpck_require__(50480);
39631
- const strict_output_schema_policy_1 = __nccwpck_require__(56743);
39631
+ const codex_output_schema_policy_1 = __nccwpck_require__(71503);
39632
39632
  function buildCodexExecutionPolicy(input) {
39633
39633
  const { configuration } = input;
39634
39634
  if (configuration.provider !== 'codex')
39635
39635
  throw new Error('Codex policy requires Codex configuration.');
39636
- if (input.outputSchema)
39637
- (0, strict_output_schema_policy_1.assertStrictOutputSchema)(input.outputSchema);
39636
+ const nativeSchema = input.outputSchema ? (0, codex_output_schema_policy_1.projectCodexOutputSchema)(input.outputSchema) : undefined;
39638
39637
  const workspaceMode = (0, agent_execution_plan_1.workspaceModeForCapability)(input.capability);
39639
39638
  const outputSchemaPath = input.outputSchema
39640
39639
  ? (0, provider_execution_policy_1.managedArtifactPath)(input.runtimeDirectory, 'response.schema.json')
@@ -39642,7 +39641,7 @@ function buildCodexExecutionPolicy(input) {
39642
39641
  const moduleCache = (0, provider_execution_policy_1.managedArtifactPath)(input.runtimeDirectory, 'shell/local/powershell-module-analysis.cache');
39643
39642
  const artifacts = outputSchemaPath ? [{
39644
39643
  path: outputSchemaPath,
39645
- contents: JSON.stringify(input.outputSchema),
39644
+ contents: JSON.stringify(nativeSchema),
39646
39645
  purpose: 'output-schema',
39647
39646
  }] : [];
39648
39647
  const argv = [
@@ -39696,6 +39695,38 @@ function tomlString(value) {
39696
39695
  }
39697
39696
 
39698
39697
 
39698
+ /***/ }),
39699
+
39700
+ /***/ 71503:
39701
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
39702
+
39703
+ "use strict";
39704
+
39705
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
39706
+ exports.projectCodexOutputSchema = projectCodexOutputSchema;
39707
+ const strict_output_schema_policy_1 = __nccwpck_require__(56743);
39708
+ /** Keep string-size acceptance local; Codex's native decoder receives the compatible closed shape. */
39709
+ function projectCodexOutputSchema(schema) {
39710
+ (0, strict_output_schema_policy_1.assertStrictOutputSchema)(schema);
39711
+ return projectNode(schema);
39712
+ }
39713
+ function projectNode(schema) {
39714
+ const projected = { ...schema };
39715
+ const types = typeof schema.type === 'string' ? [schema.type] : schema.type;
39716
+ if (types.includes('string')) {
39717
+ delete projected.minLength;
39718
+ delete projected.maxLength;
39719
+ }
39720
+ if (types.includes('object')) {
39721
+ projected.properties = Object.fromEntries(Object.entries(schema.properties)
39722
+ .map(([name, nested]) => [name, projectNode(nested)]));
39723
+ }
39724
+ if (types.includes('array'))
39725
+ projected.items = projectNode(schema.items);
39726
+ return projected;
39727
+ }
39728
+
39729
+
39699
39730
  /***/ }),
39700
39731
 
39701
39732
  /***/ 93955:
@@ -47360,7 +47391,7 @@ Do not add the \`${profile.deployment.launcherLabel}\` label, dispatch a deploym
47360
47391
 
47361
47392
  Never expose credentials, tokens, private keys, or other secrets in issues, commits, pull requests, logs, or diagnostic comments.
47362
47393
 
47363
- For the full contributor flow, read [repository collaboration](../docs/agents/repository-collaboration.mdx). For drift and recovery, read [guidance troubleshooting](../docs/agents/repository-guidance-troubleshooting.mdx).
47394
+ For the full contributor flow, read [repository collaboration](https://github.com/vypdev/copilot/blob/master/docs/agents/repository-collaboration.mdx). For drift and recovery, read [guidance troubleshooting](https://github.com/vypdev/copilot/blob/master/docs/agents/repository-guidance-troubleshooting.mdx).
47364
47395
  `;
47365
47396
  }
47366
47397
  function renderRepositoryAgentSkill() {
@@ -57354,6 +57385,7 @@ const agent_response_length_failure_1 = __nccwpck_require__(28528);
57354
57385
  /** Size and typed format failures share one regeneration; the writer still validates every candidate. */
57355
57386
  async function draftSddMarkdown(agent, configuration, plan, prompt, validate) {
57356
57387
  const maximum = plan.action === 'update' ? pre_branch_sdd_1.SDD_MAX_UPDATE_CHARACTERS : pre_branch_sdd_1.SDD_MAX_DRAFT_CHARACTERS;
57388
+ const target = Math.min(10000, Math.floor(maximum / 3));
57357
57389
  const schema = {
57358
57390
  type: 'object',
57359
57391
  properties: { markdown: { type: 'string', minLength: pre_branch_sdd_1.SDD_MIN_DRAFT_CHARACTERS, maxLength: maximum } },
@@ -57361,7 +57393,7 @@ async function draftSddMarkdown(agent, configuration, plan, prompt, validate) {
57361
57393
  };
57362
57394
  let problem = 'size';
57363
57395
  let formatReason = 'required-heading';
57364
- const contractPrompt = `${prompt}\n\nDraft contract: keep the complete draft within ${maximum} characters; aim for ${Math.floor(maximum * 2 / 3)} characters. Preserve the same owner, decisions and requirements. Include these literal canonical heading prefixes as Markdown headings, with the shown capitalization:\n${pre_branch_sdd_1.SDD_REQUIRED_HEADINGS.join('\n')}\nUse the canonical numeric test-budget table in section 14: Area | Minimum distinct cases | Behaviors/risks covered. Every allocation and the Total must be a positive integer, and the Total must equal the sum of the allocations. A justified positive integer sentence of distinct tests or cases is also accepted. Return only the required JSON.`;
57396
+ const contractPrompt = `${prompt}\n\nDraft contract: keep the complete draft within ${maximum} characters; aim for ${target} characters. Preserve the same owner, decisions and requirements. Include these literal canonical heading prefixes as Markdown headings, with the shown capitalization:\n${pre_branch_sdd_1.SDD_REQUIRED_HEADINGS.join('\n')}\nUse the canonical numeric test-budget table in section 14: Area | Minimum distinct cases | Behaviors/risks covered. Every allocation and the Total must be a positive integer, and the Total must equal the sum of the allocations. A justified positive integer sentence of distinct tests or cases is also accepted. Return only the required JSON.`;
57365
57397
  for (let attempt = 0; attempt < 2; attempt++) {
57366
57398
  let value;
57367
57399
  try {
@@ -69610,6 +69642,7 @@ function createAgentProcessLifecycle(child, plan, signal, resolve, reject, onToo
69610
69642
  const stdoutChunks = [];
69611
69643
  let stderrBytes = 0;
69612
69644
  const stderrChunks = [];
69645
+ let stderrTail = Buffer.alloc(0);
69613
69646
  let outputBytes = 0;
69614
69647
  let settled = false;
69615
69648
  let terminationError;
@@ -69675,6 +69708,9 @@ function createAgentProcessLifecycle(child, plan, signal, resolve, reject, onToo
69675
69708
  stderrChunks.push(retained);
69676
69709
  stderrBytes += retained.byteLength;
69677
69710
  }
69711
+ const retainedTail = chunk.subarray(-MAX_STDERR_BYTES);
69712
+ const previousTail = stderrTail.subarray(Math.max(0, stderrTail.length + retainedTail.length - MAX_STDERR_BYTES));
69713
+ stderrTail = Buffer.concat([previousTail, retainedTail]);
69678
69714
  };
69679
69715
  const onStdinError = () => beginTermination(new agent_cli_contracts_1.AgentCliError('Unable to send the prompt to the agent CLI.', 'process'));
69680
69716
  const onError = () => finishReject(new agent_cli_contracts_1.AgentCliError('Unable to start agent CLI.', 'process'));
@@ -69685,8 +69721,11 @@ function createAgentProcessLifecycle(child, plan, signal, resolve, reject, onToo
69685
69721
  }
69686
69722
  if (code !== 0) {
69687
69723
  const diagnostic = stderrBytes > 0 ? ' Diagnostic output was suppressed for safety.' : '';
69724
+ const terminalDiagnostic = (0, agent_cli_exit_diagnostic_1.classifyAgentCliExitDiagnostic)(stderrTail.toString('utf8'));
69688
69725
  const exitDiagnostic = stderrBytes > 0
69689
- ? (0, agent_cli_exit_diagnostic_1.classifyAgentCliExitDiagnostic)(Buffer.concat(stderrChunks).toString('utf8'))
69726
+ ? terminalDiagnostic === 'unclassified'
69727
+ ? (0, agent_cli_exit_diagnostic_1.classifyAgentCliExitDiagnostic)(Buffer.concat(stderrChunks).toString('utf8'))
69728
+ : terminalDiagnostic
69690
69729
  : undefined;
69691
69730
  finishReject(new agent_cli_contracts_1.AgentCliError(`Agent CLI exited with code ${code}.${diagnostic}`, 'process', code === 75, code ?? undefined, exitDiagnostic));
69692
69731
  return;
@@ -69876,6 +69915,9 @@ function classifyAgentCliToolDiagnostic(stderr) {
69876
69915
  }
69877
69916
  /** Provider stderr is untrusted and may contain credentials. Return a fixed code only. */
69878
69917
  function classifyAgentCliExitDiagnostic(stderr) {
69918
+ if (/^ERROR: Incomplete response returned, reason: max_output_tokens\r?$/mu.test(stderr)) {
69919
+ return 'reported-output-token-limit';
69920
+ }
69879
69921
  const toolDiagnostic = classifyAgentCliToolDiagnostic(stderr);
69880
69922
  if (toolDiagnostic)
69881
69923
  return toolDiagnostic;