@starterculture/devkeep-actions 0.3.0 → 0.4.0

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.
@@ -72,10 +72,14 @@ function createClaudeClient(apiKey) {
72
72
  // ../../modules/core/dist/claude/complete.js
73
73
  var DEFAULT_MAX_CONTINUATIONS = 5;
74
74
  var CONTINUATION_USER_MESSAGE = "Continue exactly where you left off. Do not repeat any text already written, and do not add any preamble or commentary \u2014 resume the previous response verbatim from the exact cutoff point.";
75
+ var DEFAULT_REQUEST_TIMEOUT_MS = 24e4;
75
76
  async function createCompleteMessage(claude, params, { maxContinuations = DEFAULT_MAX_CONTINUATIONS, timeoutMs, signal } = {}) {
76
77
  let fullText = "";
77
78
  let usage = ZERO_USAGE;
78
- const requestOptions = timeoutMs !== void 0 || signal !== void 0 ? { timeout: timeoutMs, signal } : void 0;
79
+ const requestOptions = {
80
+ timeout: timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS,
81
+ ...signal !== void 0 ? { signal } : {}
82
+ };
79
83
  for (let attempt = 0; attempt <= maxContinuations; attempt++) {
80
84
  const messages = fullText ? [
81
85
  ...params.messages,
@@ -133,6 +137,7 @@ var EMPTY_PROJECT_USAGE = {
133
137
  analyzeCodebase: ZERO_USAGE,
134
138
  syncOnboarding: ZERO_USAGE,
135
139
  releaseNotes: ZERO_USAGE,
140
+ captureBaseline: ZERO_USAGE,
136
141
  rollover: ZERO_ROLLOVER_USAGE
137
142
  };
138
143
  function usagePath(projectName) {
@@ -379,12 +384,18 @@ async function consolidateRelease({ projectOctokit, vaultOctokit, claude, projec
379
384
  repo: vaultRepoName,
380
385
  ref: `heads/${VAULT_BASE_BRANCH}`
381
386
  });
382
- await vaultOctokit.rest.git.createRef({
383
- owner: vaultOwner,
384
- repo: vaultRepoName,
385
- ref: `refs/heads/${branch}`,
386
- sha: baseRef.data.object.sha
387
- });
387
+ try {
388
+ await vaultOctokit.rest.git.createRef({
389
+ owner: vaultOwner,
390
+ repo: vaultRepoName,
391
+ ref: `refs/heads/${branch}`,
392
+ sha: baseRef.data.object.sha
393
+ });
394
+ } catch (error) {
395
+ if (error.status !== 422) {
396
+ throw error;
397
+ }
398
+ }
388
399
  await vaultOctokit.rest.repos.createOrUpdateFileContents({
389
400
  owner: vaultOwner,
390
401
  repo: vaultRepoName,
@@ -395,6 +406,10 @@ async function consolidateRelease({ projectOctokit, vaultOctokit, claude, projec
395
406
  sha: masterDocsSha
396
407
  });
397
408
  await recordUsage(vaultOctokit, { owner: vaultOwner, repo: vaultRepoName, projectName, branch }, "consolidateRelease", usage);
409
+ const openPrs = await vaultOctokit.rest.pulls.list({ owner: vaultOwner, repo: vaultRepoName, state: "open", head: `${vaultOwner}:${branch}` }).catch(() => ({ data: [] }));
410
+ if (openPrs.data.length > 0) {
411
+ return { branch, prNumber: openPrs.data[0].number, prUrl: openPrs.data[0].html_url, usage };
412
+ }
398
413
  const pr = await vaultOctokit.rest.pulls.create({
399
414
  owner: vaultOwner,
400
415
  repo: vaultRepoName,
@@ -72,10 +72,14 @@ function createClaudeClient(apiKey) {
72
72
  // ../../modules/core/dist/claude/complete.js
73
73
  var DEFAULT_MAX_CONTINUATIONS = 5;
74
74
  var CONTINUATION_USER_MESSAGE = "Continue exactly where you left off. Do not repeat any text already written, and do not add any preamble or commentary \u2014 resume the previous response verbatim from the exact cutoff point.";
75
+ var DEFAULT_REQUEST_TIMEOUT_MS = 24e4;
75
76
  async function createCompleteMessage(claude, params, { maxContinuations = DEFAULT_MAX_CONTINUATIONS, timeoutMs, signal } = {}) {
76
77
  let fullText = "";
77
78
  let usage = ZERO_USAGE;
78
- const requestOptions = timeoutMs !== void 0 || signal !== void 0 ? { timeout: timeoutMs, signal } : void 0;
79
+ const requestOptions = {
80
+ timeout: timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS,
81
+ ...signal !== void 0 ? { signal } : {}
82
+ };
79
83
  for (let attempt = 0; attempt <= maxContinuations; attempt++) {
80
84
  const messages = fullText ? [
81
85
  ...params.messages,
@@ -133,6 +137,7 @@ var EMPTY_PROJECT_USAGE = {
133
137
  analyzeCodebase: ZERO_USAGE,
134
138
  syncOnboarding: ZERO_USAGE,
135
139
  releaseNotes: ZERO_USAGE,
140
+ captureBaseline: ZERO_USAGE,
136
141
  rollover: ZERO_ROLLOVER_USAGE
137
142
  };
138
143
  function usagePath(projectName) {
@@ -72,10 +72,14 @@ function createClaudeClient(apiKey) {
72
72
  // ../../modules/core/dist/claude/complete.js
73
73
  var DEFAULT_MAX_CONTINUATIONS = 5;
74
74
  var CONTINUATION_USER_MESSAGE = "Continue exactly where you left off. Do not repeat any text already written, and do not add any preamble or commentary \u2014 resume the previous response verbatim from the exact cutoff point.";
75
+ var DEFAULT_REQUEST_TIMEOUT_MS = 24e4;
75
76
  async function createCompleteMessage(claude, params, { maxContinuations = DEFAULT_MAX_CONTINUATIONS, timeoutMs, signal } = {}) {
76
77
  let fullText = "";
77
78
  let usage = ZERO_USAGE;
78
- const requestOptions = timeoutMs !== void 0 || signal !== void 0 ? { timeout: timeoutMs, signal } : void 0;
79
+ const requestOptions = {
80
+ timeout: timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS,
81
+ ...signal !== void 0 ? { signal } : {}
82
+ };
79
83
  for (let attempt = 0; attempt <= maxContinuations; attempt++) {
80
84
  const messages = fullText ? [
81
85
  ...params.messages,
@@ -179,6 +183,7 @@ var EMPTY_PROJECT_USAGE = {
179
183
  analyzeCodebase: ZERO_USAGE,
180
184
  syncOnboarding: ZERO_USAGE,
181
185
  releaseNotes: ZERO_USAGE,
186
+ captureBaseline: ZERO_USAGE,
182
187
  rollover: ZERO_ROLLOVER_USAGE
183
188
  };
184
189
  function usagePath(projectName) {
@@ -72,10 +72,14 @@ function createClaudeClient(apiKey) {
72
72
  // ../../modules/core/dist/claude/complete.js
73
73
  var DEFAULT_MAX_CONTINUATIONS = 5;
74
74
  var CONTINUATION_USER_MESSAGE = "Continue exactly where you left off. Do not repeat any text already written, and do not add any preamble or commentary \u2014 resume the previous response verbatim from the exact cutoff point.";
75
+ var DEFAULT_REQUEST_TIMEOUT_MS = 24e4;
75
76
  async function createCompleteMessage(claude, params, { maxContinuations = DEFAULT_MAX_CONTINUATIONS, timeoutMs, signal } = {}) {
76
77
  let fullText = "";
77
78
  let usage = ZERO_USAGE;
78
- const requestOptions = timeoutMs !== void 0 || signal !== void 0 ? { timeout: timeoutMs, signal } : void 0;
79
+ const requestOptions = {
80
+ timeout: timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS,
81
+ ...signal !== void 0 ? { signal } : {}
82
+ };
79
83
  for (let attempt = 0; attempt <= maxContinuations; attempt++) {
80
84
  const messages = fullText ? [
81
85
  ...params.messages,
@@ -215,6 +219,7 @@ var EMPTY_PROJECT_USAGE = {
215
219
  analyzeCodebase: ZERO_USAGE,
216
220
  syncOnboarding: ZERO_USAGE,
217
221
  releaseNotes: ZERO_USAGE,
222
+ captureBaseline: ZERO_USAGE,
218
223
  rollover: ZERO_ROLLOVER_USAGE
219
224
  };
220
225
  function usagePath(projectName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starterculture/devkeep-actions",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Devkeep's GitHub Actions entrypoints, bundled for CI runners.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",