@rigkit/provider-vscode 0.2.7 → 0.2.9

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.
@@ -30130,6 +30130,7 @@ var RuntimeHandleEffectSchema = exports_Schema.Struct({
30130
30130
  projectDir: exports_Schema.String,
30131
30131
  configPath: exports_Schema.String,
30132
30132
  statePath: exports_Schema.optional(exports_Schema.String),
30133
+ globalFragmentRoot: exports_Schema.optional(exports_Schema.String),
30133
30134
  pid: exports_Schema.Int,
30134
30135
  url: exports_Schema.String,
30135
30136
  tokenPath: exports_Schema.String,
@@ -30150,6 +30151,7 @@ var RuntimeHealthEffectSchema = exports_Schema.Struct({
30150
30151
  projectDir: exports_Schema.optional(exports_Schema.String),
30151
30152
  configPath: exports_Schema.optional(exports_Schema.String),
30152
30153
  statePath: exports_Schema.optional(exports_Schema.String),
30154
+ globalFragmentRoot: exports_Schema.optional(exports_Schema.String),
30153
30155
  engineVersion: exports_Schema.optional(exports_Schema.String),
30154
30156
  runtimeVersion: exports_Schema.optional(exports_Schema.String),
30155
30157
  expiresAt: exports_Schema.optional(exports_Schema.String)
@@ -30181,6 +30183,7 @@ var RuntimeControlHealthEffectSchema = exports_Schema.Struct({
30181
30183
  projectDir: exports_Schema.String,
30182
30184
  configPath: exports_Schema.String,
30183
30185
  statePath: OptionalString,
30186
+ globalFragmentRoot: OptionalString,
30184
30187
  engineVersion: exports_Schema.String,
30185
30188
  runtimeVersion: exports_Schema.String,
30186
30189
  expiresAt: exports_Schema.String
@@ -30251,6 +30254,35 @@ var RuntimeControlWorkspacesResponseEffectSchema = exports_Schema.Struct({
30251
30254
  var RuntimeControlSnapshotsResponseEffectSchema = exports_Schema.Struct({
30252
30255
  snapshots: exports_Schema.Array(exports_Schema.Unknown)
30253
30256
  }).annotations({ identifier: "SnapshotsResponse" });
30257
+ var RuntimeControlCacheEntryEffectSchema = exports_Schema.Struct({
30258
+ scope: exports_Schema.Literal("local", "global"),
30259
+ workflow: exports_Schema.String,
30260
+ nodePath: exports_Schema.String,
30261
+ nodeName: exports_Schema.String,
30262
+ nodeKind: exports_Schema.String,
30263
+ runId: exports_Schema.String,
30264
+ invalidated: exports_Schema.Boolean,
30265
+ createdAt: exports_Schema.String,
30266
+ fragmentHash: exports_Schema.optional(exports_Schema.String)
30267
+ }).annotations({ identifier: "CacheEntry" });
30268
+ var RuntimeControlCacheResponseEffectSchema = exports_Schema.Struct({
30269
+ entries: exports_Schema.Array(RuntimeControlCacheEntryEffectSchema)
30270
+ }).annotations({ identifier: "CacheResponse" });
30271
+ var RuntimeControlCacheClearRequestEffectSchema = exports_Schema.Struct({
30272
+ scope: exports_Schema.optional(exports_Schema.Literal("local", "global", "all"))
30273
+ }).annotations({ identifier: "CacheClearRequest" });
30274
+ var RuntimeControlCacheClearResponseEffectSchema = exports_Schema.Struct({
30275
+ ok: exports_Schema.Boolean,
30276
+ deleted: exports_Schema.Number
30277
+ }).annotations({ identifier: "CacheClearResponse" });
30278
+ var RuntimeControlCacheInvalidateRequestEffectSchema = exports_Schema.Struct({
30279
+ workflow: exports_Schema.optional(exports_Schema.String),
30280
+ nodePaths: exports_Schema.optional(exports_Schema.Array(exports_Schema.String))
30281
+ }).annotations({ identifier: "CacheInvalidateRequest" });
30282
+ var RuntimeControlCacheInvalidateResponseEffectSchema = exports_Schema.Struct({
30283
+ ok: exports_Schema.Boolean,
30284
+ invalidated: exports_Schema.Number
30285
+ }).annotations({ identifier: "CacheInvalidateResponse" });
30254
30286
  var RuntimeControlRunEffectSchema = exports_Schema.Struct({
30255
30287
  runId: exports_Schema.String,
30256
30288
  operation: exports_Schema.String,
@@ -30291,7 +30323,7 @@ var RuntimeControlOkResponseEffectSchema = exports_Schema.Struct({
30291
30323
  }).annotations({ identifier: "OkResponse" });
30292
30324
  var runId = exports_HttpApiSchema.param("runId", exports_Schema.String);
30293
30325
  var requestId = exports_HttpApiSchema.param("requestId", exports_Schema.String);
30294
- var runtimeControlApi = exports_HttpApi.make("rigkit-runtime").annotate(exports_OpenApi.Title, "Rigkit runtime").annotate(exports_OpenApi.Version, String(SUPPORTED_RUNTIME_API_VERSION)).add(exports_HttpApiGroup.make("control", { topLevel: true }).add(exports_HttpApiEndpoint.get("health", "/health").addSuccess(RuntimeControlHealthEffectSchema)).add(exports_HttpApiEndpoint.get("openApi", "/openapi.json").addSuccess(exports_Schema.Unknown)).add(exports_HttpApiEndpoint.get("runtime", "/runtime").addSuccess(RuntimeControlMetadataEffectSchema)).add(exports_HttpApiEndpoint.get("project", "/project").addSuccess(RuntimeControlProjectInfoEffectSchema)).add(exports_HttpApiEndpoint.get("operations", "/operations").addSuccess(RuntimeControlOperationsManifestEffectSchema)).add(exports_HttpApiEndpoint.get("workflows", "/workflows").addSuccess(RuntimeControlWorkflowsResponseEffectSchema)).add(exports_HttpApiEndpoint.get("workspaces", "/workspaces").addSuccess(RuntimeControlWorkspacesResponseEffectSchema)).add(exports_HttpApiEndpoint.get("snapshots", "/snapshots").addSuccess(RuntimeControlSnapshotsResponseEffectSchema)).add(exports_HttpApiEndpoint.get("runs", "/runs").addSuccess(RuntimeControlRunsResponseEffectSchema)).add(exports_HttpApiEndpoint.post("startRun", "/runs").setPayload(RuntimeControlRunOperationRequestEffectSchema).addSuccess(RuntimeControlRunStartedEffectSchema, { status: 202 })).add(exports_HttpApiEndpoint.get("run")`/runs/${runId}`.addSuccess(RuntimeControlRunEffectSchema)).add(exports_HttpApiEndpoint.get("runEvents")`/runs/${runId}/events`.addSuccess(exports_Schema.String)).add(exports_HttpApiEndpoint.post("hostResponse")`/host-responses/${requestId}`.setPayload(RuntimeControlHostResponseEffectSchema).addSuccess(RuntimeControlOkResponseEffectSchema)).add(exports_HttpApiEndpoint.post("shutdown", "/shutdown").addSuccess(RuntimeControlOkResponseEffectSchema)));
30326
+ var runtimeControlApi = exports_HttpApi.make("rigkit-runtime").annotate(exports_OpenApi.Title, "Rigkit runtime").annotate(exports_OpenApi.Version, String(SUPPORTED_RUNTIME_API_VERSION)).add(exports_HttpApiGroup.make("control", { topLevel: true }).add(exports_HttpApiEndpoint.get("health", "/health").addSuccess(RuntimeControlHealthEffectSchema)).add(exports_HttpApiEndpoint.get("openApi", "/openapi.json").addSuccess(exports_Schema.Unknown)).add(exports_HttpApiEndpoint.get("runtime", "/runtime").addSuccess(RuntimeControlMetadataEffectSchema)).add(exports_HttpApiEndpoint.get("project", "/project").addSuccess(RuntimeControlProjectInfoEffectSchema)).add(exports_HttpApiEndpoint.get("operations", "/operations").addSuccess(RuntimeControlOperationsManifestEffectSchema)).add(exports_HttpApiEndpoint.get("workflows", "/workflows").addSuccess(RuntimeControlWorkflowsResponseEffectSchema)).add(exports_HttpApiEndpoint.get("workspaces", "/workspaces").addSuccess(RuntimeControlWorkspacesResponseEffectSchema)).add(exports_HttpApiEndpoint.get("snapshots", "/snapshots").addSuccess(RuntimeControlSnapshotsResponseEffectSchema)).add(exports_HttpApiEndpoint.get("cache", "/cache").addSuccess(RuntimeControlCacheResponseEffectSchema)).add(exports_HttpApiEndpoint.post("clearCache", "/cache/clear").setPayload(RuntimeControlCacheClearRequestEffectSchema).addSuccess(RuntimeControlCacheClearResponseEffectSchema)).add(exports_HttpApiEndpoint.post("invalidateCache", "/cache/invalidate").setPayload(RuntimeControlCacheInvalidateRequestEffectSchema).addSuccess(RuntimeControlCacheInvalidateResponseEffectSchema)).add(exports_HttpApiEndpoint.get("runs", "/runs").addSuccess(RuntimeControlRunsResponseEffectSchema)).add(exports_HttpApiEndpoint.post("startRun", "/runs").setPayload(RuntimeControlRunOperationRequestEffectSchema).addSuccess(RuntimeControlRunStartedEffectSchema, { status: 202 })).add(exports_HttpApiEndpoint.get("run")`/runs/${runId}`.addSuccess(RuntimeControlRunEffectSchema)).add(exports_HttpApiEndpoint.get("runEvents")`/runs/${runId}/events`.addSuccess(exports_Schema.String)).add(exports_HttpApiEndpoint.post("hostResponse")`/host-responses/${requestId}`.setPayload(RuntimeControlHostResponseEffectSchema).addSuccess(RuntimeControlOkResponseEffectSchema)).add(exports_HttpApiEndpoint.post("shutdown", "/shutdown").addSuccess(RuntimeControlOkResponseEffectSchema)));
30295
30327
 
30296
30328
  // ../runtime-client/src/client.ts
30297
30329
  function createRuntimeHttpClient(options7) {
@@ -30340,6 +30372,12 @@ function makeRuntimeHttpClient(options7) {
30340
30372
  method: "GET",
30341
30373
  path: "/snapshots"
30342
30374
  }),
30375
+ cache: () => runRuntimeHttpRequest(withRuntimeControlClient(options7, (client) => client.cache({ withResponse: true })), {
30376
+ method: "GET",
30377
+ path: "/cache"
30378
+ }),
30379
+ clearCache: (body) => runRuntimeHttpRequest(withRuntimeControlClient(options7, (client) => client.clearCache({ payload: body, withResponse: true })), { method: "POST", path: "/cache/clear" }),
30380
+ invalidateCache: (body) => runRuntimeHttpRequest(withRuntimeControlClient(options7, (client) => client.invalidateCache({ payload: body, withResponse: true })), { method: "POST", path: "/cache/invalidate" }),
30343
30381
  runs: () => runRuntimeHttpRequest(withRuntimeControlClient(options7, (client) => client.runs({ withResponse: true })), {
30344
30382
  method: "GET",
30345
30383
  path: "/runs"
@@ -30523,6 +30561,7 @@ async function getOrStartRuntimeUnsafe(options7) {
30523
30561
  const projectDir = import_node_path.resolve(options7.projectDir);
30524
30562
  const configPath = import_node_path.resolve(options7.configPath);
30525
30563
  const statePath = options7.statePath ? import_node_path.resolve(options7.statePath) : undefined;
30564
+ const globalFragmentRoot = options7.globalFragmentRoot ? import_node_path.resolve(options7.globalFragmentRoot) : import_node_path.join(options7.rigkitHome ?? defaultRigkitHome(), "fragments");
30526
30565
  const projectId = projectIdFor({
30527
30566
  projectDir,
30528
30567
  configPath,
@@ -30533,6 +30572,7 @@ async function getOrStartRuntimeUnsafe(options7) {
30533
30572
  projectDir,
30534
30573
  configPath,
30535
30574
  statePath,
30575
+ ...options7.globalFragmentRoot ? { globalFragmentRoot } : {},
30536
30576
  source: options7.source
30537
30577
  });
30538
30578
  const paths = runtimePaths(projectId, options7.rigkitHome);
@@ -30548,6 +30588,7 @@ async function getOrStartRuntimeUnsafe(options7) {
30548
30588
  projectDir,
30549
30589
  configPath,
30550
30590
  statePath,
30591
+ globalFragmentRoot,
30551
30592
  projectId,
30552
30593
  runtimeFingerprint,
30553
30594
  paths
@@ -30578,6 +30619,7 @@ function runtimeFingerprintFor(options7) {
30578
30619
  const projectDir = import_node_path.resolve(options7.projectDir);
30579
30620
  const configPath = import_node_path.resolve(options7.configPath);
30580
30621
  const statePath = options7.statePath ? import_node_path.resolve(options7.statePath) : null;
30622
+ const globalFragmentRoot = options7.globalFragmentRoot ? import_node_path.resolve(options7.globalFragmentRoot) : null;
30581
30623
  const hash2 = import_node_crypto.createHash("sha256");
30582
30624
  hash2.update("project\x00");
30583
30625
  hash2.update(projectDir);
@@ -30585,6 +30627,8 @@ function runtimeFingerprintFor(options7) {
30585
30627
  hash2.update(configPath);
30586
30628
  hash2.update("\x00state\x00");
30587
30629
  hash2.update(statePath ?? "");
30630
+ hash2.update("\x00global-fragment-root\x00");
30631
+ hash2.update(globalFragmentRoot ?? "");
30588
30632
  hash2.update("\x00source\x00");
30589
30633
  hash2.update(JSON.stringify(options7.source ?? null));
30590
30634
  updateFileFingerprint(hash2, "config", configPath);
@@ -30602,7 +30646,8 @@ function runtimePaths(projectId, rigkitHome = defaultRigkitHome()) {
30602
30646
  root,
30603
30647
  handlePath: import_node_path.join(root, `${projectId}.json`),
30604
30648
  tokenPath: import_node_path.join(root, `${projectId}.token`),
30605
- lockPath: import_node_path.join(root, `${projectId}.lock`)
30649
+ lockPath: import_node_path.join(root, `${projectId}.lock`),
30650
+ runtimeLogPath: import_node_path.join(root, `${projectId}.log`)
30606
30651
  };
30607
30652
  }
30608
30653
  function defaultRigkitHome() {
@@ -30669,13 +30714,20 @@ async function startRuntime(input) {
30669
30714
  ];
30670
30715
  if (input.statePath)
30671
30716
  args2.push("--state", input.statePath);
30717
+ if (input.globalFragmentRoot)
30718
+ args2.push("--global-fragment-root", input.globalFragmentRoot);
30672
30719
  if (input.source !== undefined)
30673
30720
  args2.push("--source-json", JSON.stringify(input.source));
30721
+ import_node_fs.mkdirSync(input.paths.root, { recursive: true });
30722
+ const stderrFd = import_node_fs.openSync(input.paths.runtimeLogPath, "a");
30674
30723
  const proc = import_node_child_process.spawn(runtimeBin, args2, {
30675
30724
  detached: true,
30676
- stdio: ["ignore", "pipe", "inherit"],
30725
+ stdio: ["ignore", "pipe", stderrFd],
30677
30726
  env: process.env
30678
30727
  });
30728
+ try {
30729
+ import_node_fs.closeSync(stderrFd);
30730
+ } catch {}
30679
30731
  const line = await readReadyLine(proc, input.paths, input.projectDir);
30680
30732
  let ready;
30681
30733
  try {
@@ -30920,13 +30972,28 @@ function updateProjectSurfaceFingerprint(hash2, projectDir) {
30920
30972
  `));
30921
30973
  }
30922
30974
  function updateRigkitPackageFingerprint(hash2, scopeDir) {
30923
- if (!import_node_fs.existsSync(scopeDir))
30924
- return;
30925
- const packageDirs = import_node_fs.readdirSync(scopeDir, { withFileTypes: true }).filter((entry) => entry.isDirectory() || entry.isSymbolicLink()).map((entry) => import_node_path.join(scopeDir, entry.name)).sort();
30926
- for (const packageDir of packageDirs) {
30927
- updateFileFingerprint(hash2, "rigkit-package", import_node_path.join(packageDir, "package.json"));
30928
- for (const file2 of collectFiles(import_node_path.join(packageDir, "src"))) {
30929
- updateFileFingerprint(hash2, "rigkit-source", file2);
30975
+ const visited = new Set;
30976
+ const stack = [scopeDir];
30977
+ while (stack.length > 0) {
30978
+ const dir = stack.pop();
30979
+ if (!import_node_fs.existsSync(dir))
30980
+ continue;
30981
+ let canonical;
30982
+ try {
30983
+ canonical = import_node_fs.realpathSync(dir);
30984
+ } catch {
30985
+ continue;
30986
+ }
30987
+ if (visited.has(canonical))
30988
+ continue;
30989
+ visited.add(canonical);
30990
+ const packageDirs = import_node_fs.readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory() || entry.isSymbolicLink()).map((entry) => import_node_path.join(dir, entry.name)).sort();
30991
+ for (const packageDir of packageDirs) {
30992
+ updateFileFingerprint(hash2, "rigkit-package", import_node_path.join(packageDir, "package.json"));
30993
+ for (const file2 of collectFiles(import_node_path.join(packageDir, "src"))) {
30994
+ updateFileFingerprint(hash2, "rigkit-source", file2);
30995
+ }
30996
+ stack.push(import_node_path.join(packageDir, "node_modules", "@rigkit"));
30930
30997
  }
30931
30998
  }
30932
30999
  }
@@ -31085,7 +31152,7 @@ function findConfigUp(startDir, fileExists = import_node_fs2.existsSync) {
31085
31152
  }
31086
31153
 
31087
31154
  // src/version.ts
31088
- var RIGKIT_PROVIDER_VSCODE_VERSION = "0.2.7";
31155
+ var RIGKIT_PROVIDER_VSCODE_VERSION = "0.2.9";
31089
31156
 
31090
31157
  // src/extension.ts
31091
31158
  var VSCODE_HOST_METHODS = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigkit/provider-vscode",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,7 +57,7 @@
57
57
  "README.md"
58
58
  ],
59
59
  "dependencies": {
60
- "@rigkit/runtime-client": "0.2.7"
60
+ "@rigkit/runtime-client": "0.2.9"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/bun": "latest",
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const RIGKIT_PROVIDER_VSCODE_VERSION = "0.2.7";
1
+ export const RIGKIT_PROVIDER_VSCODE_VERSION = "0.2.9";