minimal-forge-work-pack-sync 0.1.40 → 0.1.41

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
@@ -7607,7 +7607,7 @@ var DEFAULT_DEBUG_TRACE_LIMITS = {
7607
7607
  // packages/shared/src/contracts/settings.ts
7608
7608
  var DOCUMENT_READER_AGENT = "document-reader";
7609
7609
  var OPENROUTER_ALIAS_PROVIDER_NAME = "OpenRouter (via Forge)";
7610
- var WORK_PACK_SYNC_PLUGIN_VERSION = "0.1.40";
7610
+ var WORK_PACK_SYNC_PLUGIN_VERSION = "0.1.41";
7611
7611
  var WORK_PACK_SYNC_PLUGIN_PACKAGE = `minimal-forge-work-pack-sync@${WORK_PACK_SYNC_PLUGIN_VERSION}`;
7612
7612
  var WORK_PACK_SYNC_PLUGIN_FILENAME = `minimal-forge-work-pack-sync-${WORK_PACK_SYNC_PLUGIN_VERSION}.tgz`;
7613
7613
  var FIRECRAWL_KEYLESS_MCP_NAME = "firecrawl";
@@ -20821,8 +20821,8 @@ function resolveOpenCodeDir(home, platform, env, exists2, pathApi) {
20821
20821
 
20822
20822
  // packages/cli/src/report.ts
20823
20823
  import os2 from "node:os";
20824
- var AGENT_VERSION = "0.1.0";
20825
- async function reportFailure(credentials, kind, error45, runtime = UNKNOWN_RUNTIME) {
20824
+ var CLI_AGENT_VERSION = "0.1.0";
20825
+ async function reportFailure(credentials, kind, error45, runtime = UNKNOWN_RUNTIME, agentVersion = CLI_AGENT_VERSION) {
20826
20826
  try {
20827
20827
  const message = error45 instanceof Error ? error45.message : String(error45);
20828
20828
  await fetch(`${credentials.forgeBaseUrl.replace(/\/$/, "")}/sync/report`, {
@@ -20831,7 +20831,7 @@ async function reportFailure(credentials, kind, error45, runtime = UNKNOWN_RUNTI
20831
20831
  authorization: `Bearer ${credentials.forgeApiKey}`,
20832
20832
  "content-type": "application/json",
20833
20833
  "x-forge-hostname": os2.hostname(),
20834
- "x-forge-agent-version": AGENT_VERSION
20834
+ "x-forge-agent-version": agentVersion
20835
20835
  },
20836
20836
  body: JSON.stringify({
20837
20837
  kind,
@@ -20845,7 +20845,7 @@ async function reportFailure(credentials, kind, error45, runtime = UNKNOWN_RUNTI
20845
20845
  console.error("[Forge] Failed to report failure to Forge server:", error46 instanceof Error ? error46.message : String(error46));
20846
20846
  }
20847
20847
  }
20848
- async function reportWorkPackObservations(credentials, kind, workPacks, runtime = UNKNOWN_RUNTIME) {
20848
+ async function reportWorkPackObservations(credentials, kind, workPacks, runtime = UNKNOWN_RUNTIME, agentVersion = CLI_AGENT_VERSION) {
20849
20849
  try {
20850
20850
  await fetch(`${credentials.forgeBaseUrl.replace(/\/$/, "")}/sync/report`, {
20851
20851
  method: "POST",
@@ -20853,7 +20853,7 @@ async function reportWorkPackObservations(credentials, kind, workPacks, runtime
20853
20853
  authorization: `Bearer ${credentials.forgeApiKey}`,
20854
20854
  "content-type": "application/json",
20855
20855
  "x-forge-hostname": os2.hostname(),
20856
- "x-forge-agent-version": AGENT_VERSION
20856
+ "x-forge-agent-version": agentVersion
20857
20857
  },
20858
20858
  body: JSON.stringify({ kind, ok: true, workPacks, ...runtime ? { runtime } : {} }),
20859
20859
  signal: AbortSignal.timeout(3e3)
@@ -24871,14 +24871,14 @@ function buildSyncFailureMessage(operation, details) {
24871
24871
  if (details.body) parts.push(`resposta=${JSON.stringify(details.body)}`);
24872
24872
  return parts.join(" | ");
24873
24873
  }
24874
- async function fetchManifest(credentials) {
24874
+ async function fetchManifest(credentials, agentVersion = "0.1.0") {
24875
24875
  let response;
24876
24876
  try {
24877
24877
  response = await fetch(`${credentials.forgeBaseUrl.replace(/\/$/, "")}/sync/manifest`, {
24878
24878
  headers: {
24879
24879
  authorization: `Bearer ${credentials.forgeApiKey}`,
24880
24880
  "x-forge-hostname": os4.hostname(),
24881
- "x-forge-agent-version": "0.1.0"
24881
+ "x-forge-agent-version": agentVersion
24882
24882
  },
24883
24883
  signal: AbortSignal.timeout(15e3)
24884
24884
  });
@@ -26411,7 +26411,7 @@ async function syncLocalWorker(paths, credentials, manifest) {
26411
26411
  }
26412
26412
 
26413
26413
  // packages/cli/src/workPackSyncPlugin.ts
26414
- var PLUGIN_VERSION = "0.1.40";
26414
+ var PLUGIN_VERSION = "0.1.41";
26415
26415
  var FORGE_DECISION_TIMEOUT_MS = 11e4;
26416
26416
  var STATUS_FILENAME = "work-pack-startup-status.json";
26417
26417
  var activeSync = /* @__PURE__ */ new Map();
@@ -26819,11 +26819,11 @@ async function synchronizeAtStartup(forgeBaseUrl, input, localConfig) {
26819
26819
  try {
26820
26820
  await retireDebugCapture(paths);
26821
26821
  credentials = await readForgeCredentials(paths, forgeBaseUrl);
26822
- const manifest = await fetchManifest(credentials);
26822
+ const manifest = await fetchManifest(credentials, PLUGIN_VERSION);
26823
26823
  decisionBaseUrl = resolveDecisionBaseUrl(manifest.gatewayBaseUrl, forgeBaseUrl);
26824
26824
  forgeConfigVerified = true;
26825
26825
  const result = localConfig ? await syncLocalWorker(paths, credentials, manifest) : await applyWorkPackManifest(paths, credentials, manifest, {});
26826
- await reportWorkPackObservations(credentials, "sync", result.workPackObservations, runtime);
26826
+ await reportWorkPackObservations(credentials, "sync", result.workPackObservations, runtime, PLUGIN_VERSION);
26827
26827
  const failures = result.workPacks.outcomes.filter(
26828
26828
  (outcome) => outcome.status === "failed" || outcome.status === "recovery-uncertain"
26829
26829
  );
@@ -26851,7 +26851,7 @@ async function synchronizeAtStartup(forgeBaseUrl, input, localConfig) {
26851
26851
  attemptedAt: (/* @__PURE__ */ new Date()).toISOString(),
26852
26852
  message
26853
26853
  }).catch(() => void 0);
26854
- if (credentials) await reportFailure(credentials, "sync", new Error(message), runtime);
26854
+ if (credentials) await reportFailure(credentials, "sync", new Error(message), runtime, PLUGIN_VERSION);
26855
26855
  if (localConfig && !forgeConfigVerified && credentials) {
26856
26856
  decisionBaseUrl = await savedGatewayBaseUrl(paths, credentials, forgeBaseUrl) ?? decisionBaseUrl;
26857
26857
  }
package/dist/repair.js CHANGED
@@ -401,7 +401,7 @@ var DEVICE_ENROLLMENT_PROTOCOL_VERSION = 1;
401
401
  // packages/shared/src/contracts/settings.ts
402
402
  var DOCUMENT_READER_AGENT = "document-reader";
403
403
  var OPENROUTER_ALIAS_PROVIDER_NAME = "OpenRouter (via Forge)";
404
- var WORK_PACK_SYNC_PLUGIN_VERSION = "0.1.40";
404
+ var WORK_PACK_SYNC_PLUGIN_VERSION = "0.1.41";
405
405
  var WORK_PACK_SYNC_PLUGIN_PACKAGE = `minimal-forge-work-pack-sync@${WORK_PACK_SYNC_PLUGIN_VERSION}`;
406
406
  var WORK_PACK_SYNC_PLUGIN_FILENAME = `minimal-forge-work-pack-sync-${WORK_PACK_SYNC_PLUGIN_VERSION}.tgz`;
407
407
  var FIRECRAWL_KEYLESS_MCP_NAME = "firecrawl";
@@ -4187,14 +4187,14 @@ function buildSyncFailureMessage(operation, details) {
4187
4187
  if (details.body) parts.push(`resposta=${JSON.stringify(details.body)}`);
4188
4188
  return parts.join(" | ");
4189
4189
  }
4190
- async function fetchManifest(credentials) {
4190
+ async function fetchManifest(credentials, agentVersion = "0.1.0") {
4191
4191
  let response;
4192
4192
  try {
4193
4193
  response = await fetch(`${credentials.forgeBaseUrl.replace(/\/$/, "")}/sync/manifest`, {
4194
4194
  headers: {
4195
4195
  authorization: `Bearer ${credentials.forgeApiKey}`,
4196
4196
  "x-forge-hostname": os2.hostname(),
4197
- "x-forge-agent-version": "0.1.0"
4197
+ "x-forge-agent-version": agentVersion
4198
4198
  },
4199
4199
  signal: AbortSignal.timeout(15e3)
4200
4200
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minimal-forge-work-pack-sync",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "description": "Minimal Forge Work Pack startup synchronization for OpenCode and OpenWork.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {