@jigging/jig 0.1.0-alpha.27 → 0.1.0-alpha.29
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.
|
@@ -504,7 +504,6 @@ function reachableAuthorModules(modules, entryProjectPath) {
|
|
|
504
504
|
// src/internal/project-evaluator-worker.ts
|
|
505
505
|
var PROTOCOL = PRIVATE_AUTHOR_EVALUATOR_PROTOCOL;
|
|
506
506
|
var MAX_REQUEST_BYTES = 2 * 1024 * 1024;
|
|
507
|
-
var VM_TIMEOUT_MS = 1000;
|
|
508
507
|
var SDK_ENTRY = process.env.JIG_EVALUATOR_SDK ?? `${PRIVATE_AUTHOR_EVALUATOR_DIRECTORY}/project-evaluator-sdk.bundle.js`;
|
|
509
508
|
delete process.env.JIG_EVALUATOR_SDK;
|
|
510
509
|
var EVALUATION_CODES = new Set([
|
|
@@ -732,17 +731,11 @@ function evaluate(code) {
|
|
|
732
731
|
codeGeneration: { strings: false, wasm: false },
|
|
733
732
|
name: "jig-author-declaration"
|
|
734
733
|
});
|
|
735
|
-
new vm.Script(guestBootstrap(), { filename: "/jig-bootstrap.js" }).runInContext(context
|
|
736
|
-
timeout: VM_TIMEOUT_MS
|
|
737
|
-
});
|
|
734
|
+
new vm.Script(guestBootstrap(), { filename: "/jig-bootstrap.js" }).runInContext(context);
|
|
738
735
|
const invocation = `${code}
|
|
739
736
|
(__jigModule.exports, __jigRequire, __jigModule, "/author.ts", "/");`;
|
|
740
|
-
new vm.Script(invocation, { filename: "/author.ts" }).runInContext(context
|
|
741
|
-
|
|
742
|
-
});
|
|
743
|
-
const exports = new vm.Script("__jigModule.exports").runInContext(context, {
|
|
744
|
-
timeout: VM_TIMEOUT_MS
|
|
745
|
-
});
|
|
737
|
+
new vm.Script(invocation, { filename: "/author.ts" }).runInContext(context);
|
|
738
|
+
const exports = new vm.Script("__jigModule.exports").runInContext(context);
|
|
746
739
|
if (!isRecord(exports) || Object.keys(exports).length !== 1 || !("default" in exports)) {
|
|
747
740
|
throw tagged("PROJECT_DEFAULT_EXPORT", "compiled author module did not expose one default value");
|
|
748
741
|
}
|
|
@@ -816,9 +809,6 @@ function tagged(code, message) {
|
|
|
816
809
|
function errorCode(error) {
|
|
817
810
|
if (error instanceof PrivateAuthorEvaluatorChildError)
|
|
818
811
|
return error.code;
|
|
819
|
-
if (typeof error === "object" && error !== null && "code" in error && error.code === "ERR_SCRIPT_EXECUTION_TIMEOUT") {
|
|
820
|
-
return "PROJECT_EVALUATION_LIMIT";
|
|
821
|
-
}
|
|
822
812
|
if (typeof error === "object" && error !== null && "code" in error && typeof error.code === "string" && EVALUATION_CODES.has(error.code)) {
|
|
823
813
|
return error.code;
|
|
824
814
|
}
|
package/libexec/installed-cli.js
CHANGED
|
@@ -9081,13 +9081,13 @@ import { fileURLToPath as fileURLToPath5 } from "url";
|
|
|
9081
9081
|
// src/cli.ts
|
|
9082
9082
|
import { randomBytes as randomBytes7 } from "crypto";
|
|
9083
9083
|
import { lstat as lstat19 } from "fs/promises";
|
|
9084
|
-
import { basename as
|
|
9084
|
+
import { basename as basename5, resolve as resolve11 } from "path";
|
|
9085
9085
|
import { createInterface } from "readline";
|
|
9086
9086
|
import { setTimeout as delay } from "timers/promises";
|
|
9087
9087
|
// package.json
|
|
9088
9088
|
var package_default = {
|
|
9089
9089
|
name: "@jigging/jig",
|
|
9090
|
-
version: "0.1.0-alpha.
|
|
9090
|
+
version: "0.1.0-alpha.29",
|
|
9091
9091
|
description: "A local, secure host for admitted FLOW packages",
|
|
9092
9092
|
license: "SEE LICENSE IN LICENSE.md",
|
|
9093
9093
|
repository: {
|
|
@@ -26119,10 +26119,20 @@ function privateMacosExecutionPlan(intent, allocation) {
|
|
|
26119
26119
|
return value;
|
|
26120
26120
|
};
|
|
26121
26121
|
const embedded = (value) => {
|
|
26122
|
-
|
|
26123
|
-
|
|
26124
|
-
|
|
26125
|
-
|
|
26122
|
+
try {
|
|
26123
|
+
let changed = false;
|
|
26124
|
+
const parsed = JSON.parse(value, (_name, entry) => {
|
|
26125
|
+
if (typeof entry !== "string")
|
|
26126
|
+
return entry;
|
|
26127
|
+
const relocated = path(entry);
|
|
26128
|
+
if (relocated !== entry)
|
|
26129
|
+
changed = true;
|
|
26130
|
+
return relocated;
|
|
26131
|
+
});
|
|
26132
|
+
return changed ? JSON.stringify(parsed) : value;
|
|
26133
|
+
} catch {
|
|
26134
|
+
return path(value);
|
|
26135
|
+
}
|
|
26126
26136
|
};
|
|
26127
26137
|
const environment = Object.fromEntries(Object.entries(intent.environment ?? {}).map(([name, value]) => [
|
|
26128
26138
|
name,
|
|
@@ -34718,8 +34728,7 @@ import { join as join18 } from "path";
|
|
|
34718
34728
|
// src/internal/native-agent-executable.ts
|
|
34719
34729
|
import { constants as constants22 } from "fs";
|
|
34720
34730
|
import { access as access4, lstat as lstat11, readlink as readlink2, realpath as realpath11 } from "fs/promises";
|
|
34721
|
-
import { delimiter, dirname as dirname9, isAbsolute as isAbsolute3, join as join16, relative as relative2, resolve as resolve7, sep } from "path";
|
|
34722
|
-
|
|
34731
|
+
import { basename, delimiter, dirname as dirname9, isAbsolute as isAbsolute3, join as join16, relative as relative2, resolve as resolve7, sep } from "path";
|
|
34723
34732
|
class PrivateNativeAgentExecutableUnavailableError extends Error {
|
|
34724
34733
|
client;
|
|
34725
34734
|
constructor(client) {
|
|
@@ -34754,7 +34763,9 @@ async function resolvePrivateNativeAgentExecutable(client, environment, projectD
|
|
|
34754
34763
|
throw error;
|
|
34755
34764
|
}
|
|
34756
34765
|
}
|
|
34757
|
-
} catch {
|
|
34766
|
+
} catch (error) {
|
|
34767
|
+
if (error instanceof PrivateAcpSetupError)
|
|
34768
|
+
throw error;
|
|
34758
34769
|
throw new PrivateNativeAgentExecutableUnavailableError(client);
|
|
34759
34770
|
}
|
|
34760
34771
|
throw new PrivateNativeAgentExecutableUnavailableError(client);
|
|
@@ -34810,6 +34821,8 @@ async function outsideProject(candidate, forbidden) {
|
|
|
34810
34821
|
}
|
|
34811
34822
|
async function executable(candidate) {
|
|
34812
34823
|
const path2 = await realpath11(candidate);
|
|
34824
|
+
if (basename(path2) === "volta-shim")
|
|
34825
|
+
throw new PrivateAcpSetupError("wrapper");
|
|
34813
34826
|
const information = await lstat11(path2);
|
|
34814
34827
|
if (!information.isFile() || (information.mode & 73) === 0) {
|
|
34815
34828
|
throw Object.assign(new Error("not an executable file"), { code: "EACCES" });
|
|
@@ -35502,7 +35515,7 @@ async function ordinaryFile(path2, label) {
|
|
|
35502
35515
|
// src/internal/codex-agent-provider.ts
|
|
35503
35516
|
import { lstat as lstat15, readFile as readFile4, realpath as realpath15 } from "fs/promises";
|
|
35504
35517
|
import { homedir as homedir2 } from "os";
|
|
35505
|
-
import { basename, dirname as dirname12, join as join19 } from "path";
|
|
35518
|
+
import { basename as basename2, dirname as dirname12, join as join19 } from "path";
|
|
35506
35519
|
var CODEX_CLIENT = "openai-codex";
|
|
35507
35520
|
var SANDBOX_LAUNCHER_PATH2 = "/agent/codex-agent-launcher.js";
|
|
35508
35521
|
var SANDBOX_ADAPTER_PATH2 = "/agent/codex-acp.js";
|
|
@@ -35549,7 +35562,9 @@ async function openPrivateCodexAgentProvider(releaseRoot, environment = process.
|
|
|
35549
35562
|
let executablePath;
|
|
35550
35563
|
try {
|
|
35551
35564
|
executablePath = await resolvePrivateNativeAgentExecutable("codex", environment, projectDirectory);
|
|
35552
|
-
} catch {
|
|
35565
|
+
} catch (error) {
|
|
35566
|
+
if (error instanceof PrivateAcpSetupError)
|
|
35567
|
+
throw error;
|
|
35553
35568
|
throw new PrivateCodexExecutableUnavailableError("the native Codex executable is unavailable");
|
|
35554
35569
|
}
|
|
35555
35570
|
let runtime;
|
|
@@ -35815,7 +35830,7 @@ async function nativeBubblewrapFor(executablePath, environment, projectDirectory
|
|
|
35815
35830
|
const executableDirectory = dirname12(executablePath);
|
|
35816
35831
|
const adjacent = join19(executableDirectory, "codex-resources", "bwrap");
|
|
35817
35832
|
const packageResource = join19(executableDirectory, "..", "codex-resources", "bwrap");
|
|
35818
|
-
const candidates =
|
|
35833
|
+
const candidates = basename2(executableDirectory) === "bin" ? [packageResource, adjacent] : [adjacent, packageResource];
|
|
35819
35834
|
try {
|
|
35820
35835
|
for (const candidate of candidates) {
|
|
35821
35836
|
let path2;
|
|
@@ -41273,7 +41288,7 @@ function hasCode3(error, code2) {
|
|
|
41273
41288
|
import { randomBytes as randomBytes6 } from "crypto";
|
|
41274
41289
|
import { constants as constants24 } from "fs";
|
|
41275
41290
|
import { lstat as lstat17, open as open14, realpath as realpath18 } from "fs/promises";
|
|
41276
|
-
import { basename as
|
|
41291
|
+
import { basename as basename3, dirname as dirname14, resolve as resolve9 } from "path";
|
|
41277
41292
|
init_file_input();
|
|
41278
41293
|
async function installedDescriptor(selector, destination) {
|
|
41279
41294
|
let name;
|
|
@@ -41308,7 +41323,7 @@ async function importContract(source, destination, signal) {
|
|
|
41308
41323
|
try {
|
|
41309
41324
|
signal?.throwIfAborted();
|
|
41310
41325
|
const selected = source.startsWith("npm:") ? await installedDescriptor(source, destination) : source;
|
|
41311
|
-
const name =
|
|
41326
|
+
const name = basename3(selected);
|
|
41312
41327
|
root = await open14(await realpath18(dirname14(resolve9(selected))), constants24.O_RDONLY | constants24.O_DIRECTORY | constants24.O_NOFOLLOW);
|
|
41313
41328
|
const capture = (paths3) => captureOpenedPackageDirectory(selected, root, {
|
|
41314
41329
|
includes: (path2) => paths3.some((p) => p === path2 || p.startsWith(`${path2}/`)),
|
|
@@ -41332,7 +41347,7 @@ async function importContract(source, destination, signal) {
|
|
|
41332
41347
|
signal?.throwIfAborted();
|
|
41333
41348
|
phase = "destination";
|
|
41334
41349
|
const target = resolve9(destination);
|
|
41335
|
-
const leaf = privateFilePath(
|
|
41350
|
+
const leaf = privateFilePath(basename3(target));
|
|
41336
41351
|
parent = await open14(await realpath18(dirname14(target)), constants24.O_RDONLY | constants24.O_DIRECTORY | constants24.O_NOFOLLOW);
|
|
41337
41352
|
const allocation = privateChildLocation(parent, `.jig-contract-${randomBytes6(16).toString("hex")}`);
|
|
41338
41353
|
await mkdirPrivateFile(allocation);
|
|
@@ -41492,7 +41507,7 @@ import {
|
|
|
41492
41507
|
unlink as unlink3,
|
|
41493
41508
|
writeFile as writeFile2
|
|
41494
41509
|
} from "fs/promises";
|
|
41495
|
-
import { basename as
|
|
41510
|
+
import { basename as basename4, join as join22, resolve as resolve10 } from "path";
|
|
41496
41511
|
init_file_input();
|
|
41497
41512
|
var DEFAULT_FILE_SYSTEM = {
|
|
41498
41513
|
mkdir: mkdir6,
|
|
@@ -41501,7 +41516,7 @@ var DEFAULT_FILE_SYSTEM = {
|
|
|
41501
41516
|
writeFile: writeFile2
|
|
41502
41517
|
};
|
|
41503
41518
|
var GREETING_SDK_VERSION = "0.1.0-alpha.13";
|
|
41504
|
-
var AGENT_ACP_VERSION = "0.1.0-alpha.
|
|
41519
|
+
var AGENT_ACP_VERSION = "0.1.0-alpha.7";
|
|
41505
41520
|
|
|
41506
41521
|
class ProjectInitError extends Error {
|
|
41507
41522
|
code;
|
|
@@ -41577,14 +41592,14 @@ async function createFlow(project, name, uses = [], signal) {
|
|
|
41577
41592
|
throw new ProjectInitError("invalid", "JIG_NEW_EXISTS", "That Flow directory already exists. Choose a different name; existing files were not changed.");
|
|
41578
41593
|
throw error;
|
|
41579
41594
|
}
|
|
41580
|
-
const projectName =
|
|
41595
|
+
const projectName = basename4(resolve10(project)).toLowerCase().replace(/[^a-z0-9-]/g, "-").slice(0, 64);
|
|
41581
41596
|
const authoredAt = staged ?? destination;
|
|
41582
41597
|
const declarations = Object.create(null);
|
|
41583
41598
|
if (uses.length > 0)
|
|
41584
41599
|
await mkdir6(join22(authoredAt, "contracts"));
|
|
41585
41600
|
for (const { slot, source } of uses) {
|
|
41586
41601
|
const imported = await importContract(source.startsWith("npm:") ? source : resolve10(project, source), join22(authoredAt, "contracts", slot), signal);
|
|
41587
|
-
declarations[slot] = { contract: `./contracts/${slot}/${
|
|
41602
|
+
declarations[slot] = { contract: `./contracts/${slot}/${basename4(imported.descriptor)}` };
|
|
41588
41603
|
}
|
|
41589
41604
|
const files = {
|
|
41590
41605
|
"FLOW.meta.json": `${JSON.stringify({ name, description: "Describe what this method does.", ...uses.length === 0 ? {} : { uses: declarations } }, null, 2)}
|
|
@@ -41611,7 +41626,7 @@ await handle(async (run) => {
|
|
|
41611
41626
|
const flowsDirectory = await openPrivateChild(projectDirectory, "flows", constants25.O_RDONLY | constants25.O_DIRECTORY | constants25.O_NOFOLLOW);
|
|
41612
41627
|
try {
|
|
41613
41628
|
signal?.throwIfAborted();
|
|
41614
|
-
privatePublishDirectory(flowsDirectory.fd,
|
|
41629
|
+
privatePublishDirectory(flowsDirectory.fd, basename4(staged), name, projectDirectory.fd);
|
|
41615
41630
|
staged = undefined;
|
|
41616
41631
|
} finally {
|
|
41617
41632
|
await flowsDirectory.close();
|
|
@@ -42194,7 +42209,7 @@ async function executeImportContract(arguments_, runtime) {
|
|
|
42194
42209
|
try {
|
|
42195
42210
|
const result2 = await importContract(arguments_[1].startsWith("npm:") ? arguments_[1] : resolve11(runtime.currentDirectory, arguments_[1]), resolve11(runtime.currentDirectory, arguments_[2]), runtime.signal);
|
|
42196
42211
|
runtime.writeOutput(`Imported ${result2.files} contract files into ${asciiJsonString(arguments_[2])}.
|
|
42197
|
-
Use ${asciiJsonString(
|
|
42212
|
+
Use ${asciiJsonString(basename5(result2.descriptor))} in the caller's slot declaration, then review the project.
|
|
42198
42213
|
`);
|
|
42199
42214
|
return 0;
|
|
42200
42215
|
} catch (error) {
|
|
@@ -42350,7 +42365,7 @@ function shellWord(value) {
|
|
|
42350
42365
|
async function executeReview(arguments_, runtime) {
|
|
42351
42366
|
let resolutionNoticeShown = false;
|
|
42352
42367
|
const parsed = parseReview(arguments_, runtime.currentDirectory);
|
|
42353
|
-
runtime.progress.note(`Reviewing ${asciiJsonString(
|
|
42368
|
+
runtime.progress.note(`Reviewing ${asciiJsonString(basename5(resolve11(runtime.currentDirectory, parsed.project)))}`);
|
|
42354
42369
|
const result2 = await withProjectSession(parsed.project, runtime, async (session) => {
|
|
42355
42370
|
const plan = await privateProfileSpan("project-planning", () => session.plan({ lockMode: "update" }));
|
|
42356
42371
|
runtime.progress.complete(true);
|
|
@@ -42907,6 +42922,7 @@ function renderFailure(error, runtime) {
|
|
|
42907
42922
|
PROJECT_BINDING_ATTACHMENTS_INVALID: "check the Binding attachment directories: use stable project-relative regular-file trees without links, protected state or nested mounts, within the file limits",
|
|
42908
42923
|
PROJECT_BINDING_ATTACHMENT_UNDECLARED: "select only attachment names declared read-only in the Flow contract",
|
|
42909
42924
|
PROJECT_BINDING_ATTACHMENTS_NOT_CAPTURED: "the selected Binding files could not be retained consistently; review stable source directories again",
|
|
42925
|
+
PROJECT_CHECKPOINT_ATTACHMENT: "declare a read-write attachment in FLOW.contract.json for the root Flow that uses Run Checkpoint",
|
|
42910
42926
|
PROJECT_BINDING_PACKAGE_MISSING: "the Binding references a Flow not selected by jig.ts; correct the path or project membership",
|
|
42911
42927
|
PROJECT_ENTRYPOINT_INVALID: "Fix entrypoint in jig.ts: use an invokable Flow or Binding followed by valid jig run invocation arguments, project-relative paths, and declared unbound attachments or outgoing channels. Operator flags such as --verification are not project defaults.",
|
|
42912
42928
|
PROJECT_DEFAULT_MISSING: "defaultProviders in jig.ts names a missing Flow or Binding; create the selected local Binding and include its Flow in discovery, or correct the selector. Provider selection does not create Bindings",
|
|
@@ -43174,7 +43190,7 @@ import { dirname as dirname16, join as join24 } from "path";
|
|
|
43174
43190
|
import { randomBytes as randomBytes8 } from "crypto";
|
|
43175
43191
|
import { closeSync as closeSync13, constants as constants27, fstatSync as fstatSync11 } from "fs";
|
|
43176
43192
|
import { statfs as statfs3 } from "fs/promises";
|
|
43177
|
-
import { basename as
|
|
43193
|
+
import { basename as basename6, dirname as dirname15, resolve as resolve12 } from "path";
|
|
43178
43194
|
|
|
43179
43195
|
// src/internal/file-delivery-storage.ts
|
|
43180
43196
|
import { constants as constants26 } from "fs";
|
|
@@ -43273,7 +43289,7 @@ class PrivateFileDeliveryOwner {
|
|
|
43273
43289
|
let parent;
|
|
43274
43290
|
try {
|
|
43275
43291
|
this.signal.throwIfAborted();
|
|
43276
|
-
const destination = resolve12(directory), parentPath = dirname15(destination), leaf = privateFilePath(
|
|
43292
|
+
const destination = resolve12(directory), parentPath = dirname15(destination), leaf = privateFilePath(basename6(destination));
|
|
43277
43293
|
if (destination === parentPath || leaf.includes("/"))
|
|
43278
43294
|
throw new TypeError("output requires a new directory");
|
|
43279
43295
|
const selected = privateOpenFileRoot(parentPath);
|
|
@@ -54596,7 +54612,8 @@ function isCandidateDiagnosticCode(code2) {
|
|
|
54596
54612
|
"PACKAGE_SPECIAL_FILE",
|
|
54597
54613
|
"PACKAGE_SYMLINK",
|
|
54598
54614
|
"PROJECT_FLOW_COLLISION",
|
|
54599
|
-
"PROJECT_FLOW_MODE_UNSUPPORTED"
|
|
54615
|
+
"PROJECT_FLOW_MODE_UNSUPPORTED",
|
|
54616
|
+
"PROJECT_CHECKPOINT_ATTACHMENT"
|
|
54600
54617
|
].includes(code2);
|
|
54601
54618
|
}
|
|
54602
54619
|
function isRootIdentityLoss(error, owner) {
|