@paradigma-inc/flywheel 0.2.4 → 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.
- package/README.md +5 -2
- package/package.json +1 -1
- package/src/cli.mjs +7 -5
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-selection.js +2 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-selection.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/generatedFeedbackContract.js +2 -2
- package/src/runtime/vendor/flywheel-cli-dist/generatedFeedbackContract.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit-normalize.js +265 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit-normalize.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit.js +7 -4
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js +3 -6
- package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/local/store/contract.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/darwin-arm64/node.napi.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/darwin-x64/node.napi.node +0 -0
- package/src/runtime/vendor/manifest.json +3 -1
- package/src/setup/command.mjs +6 -0
- package/src/setup/modes/mcp-command.mjs +1 -1
package/README.md
CHANGED
|
@@ -24,8 +24,9 @@ The script installs `@paradigma-inc/flywheel@latest` into the managed user
|
|
|
24
24
|
prefix `${FLYWHEEL_INSTALL_PREFIX:-$HOME/.local}`, adds a marked PATH block
|
|
25
25
|
when needed, and then runs guided `flywheel setup` through the installed binary.
|
|
26
26
|
In an interactive terminal, setup asks whether you want MCP host setup or
|
|
27
|
-
CLI-only setup.
|
|
28
|
-
|
|
27
|
+
CLI-only setup. Setup then asks where to install: Project (this folder) or
|
|
28
|
+
Global (your machine), with Global preselected. You can read the full source
|
|
29
|
+
at the same URL without piping to `sh`.
|
|
29
30
|
|
|
30
31
|
Prefer the two-step npm recipe? It still works:
|
|
31
32
|
|
|
@@ -186,6 +187,7 @@ Mode behavior:
|
|
|
186
187
|
If mode is omitted:
|
|
187
188
|
|
|
188
189
|
- interactive TTY: prompt for `mcp` or `cli` (default `mcp`)
|
|
190
|
+
- location: Where should Flywheel be installed? (default Global)
|
|
189
191
|
- non-interactive: fails with usage error (`exit 2`)
|
|
190
192
|
|
|
191
193
|
## Public Base URL Rules
|
|
@@ -329,6 +331,7 @@ full details.
|
|
|
329
331
|
|
|
330
332
|
- Default scope (no `--project`) is user-level/global.
|
|
331
333
|
- `--project` is the explicit repo-local override.
|
|
334
|
+
- Interactive setup asks for the install location (Global preselected) when `--project` is omitted.
|
|
332
335
|
|
|
333
336
|
Examples:
|
|
334
337
|
|
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -368,9 +368,9 @@ function validateCliModeFlags(options) {
|
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
async function runCliModeCommand(options, readStdinAuth) {
|
|
371
|
+
async function runCliModeCommand(options, readStdinAuth, contextScope) {
|
|
372
372
|
validateCliModeFlags(options);
|
|
373
|
-
const scope = options.project ? "project" : "global";
|
|
373
|
+
const scope = contextScope ?? (options.project ? "project" : "global");
|
|
374
374
|
const baseUrl = normalizeBaseUrl(
|
|
375
375
|
resolveSetupBaseUrl({ explicitBaseUrl: options.baseUrl }),
|
|
376
376
|
);
|
|
@@ -450,9 +450,10 @@ async function runSetupCommandViaRouter(options) {
|
|
|
450
450
|
isInteractive:
|
|
451
451
|
isatty(0) && process.stdout.isTTY === true,
|
|
452
452
|
promptMode: promptSetupMode,
|
|
453
|
-
runMcpMode: async ({ readStdinAuth }) =>
|
|
453
|
+
runMcpMode: async ({ readStdinAuth, scope }) =>
|
|
454
454
|
await runMcpModeCommand(options, {
|
|
455
455
|
readStdinAuth,
|
|
456
|
+
scope,
|
|
456
457
|
force: options.force === true,
|
|
457
458
|
reconcilePriorMode: async ({
|
|
458
459
|
hostNames,
|
|
@@ -480,7 +481,8 @@ async function runSetupCommandViaRouter(options) {
|
|
|
480
481
|
}
|
|
481
482
|
},
|
|
482
483
|
}),
|
|
483
|
-
runCliMode: async ({ readStdinAuth }) =>
|
|
484
|
+
runCliMode: async ({ readStdinAuth, scope }) =>
|
|
485
|
+
await runCliModeCommand(options, readStdinAuth, scope),
|
|
484
486
|
});
|
|
485
487
|
}
|
|
486
488
|
|
|
@@ -1360,7 +1362,7 @@ Configure the Flywheel CLI, MCP host entries, and bundled skills without changin
|
|
|
1360
1362
|
.optionsGroup("Scope:")
|
|
1361
1363
|
.option(
|
|
1362
1364
|
"-p, --project",
|
|
1363
|
-
"Configure for current project instead of globally",
|
|
1365
|
+
"Configure for current project instead of globally; setup asks interactively when omitted",
|
|
1364
1366
|
)
|
|
1365
1367
|
.option("-y, --yes", "Skip confirmation prompts")
|
|
1366
1368
|
.optionsGroup("Authentication:")
|
|
@@ -32,7 +32,7 @@ async function requireRepository(root) {
|
|
|
32
32
|
if (state === "invalid")
|
|
33
33
|
throw new RepositorySelectionError("repository_marker_invalid", `Invalid Flywheel repository marker: ${path.join(resolved, ".flywheel")}`, path.join(resolved, ".flywheel"));
|
|
34
34
|
if (state === "missing")
|
|
35
|
-
throw new RepositorySelectionError("repository_not_found", `No Flywheel repository at ${resolved}.
|
|
35
|
+
throw new RepositorySelectionError("repository_not_found", `No Flywheel repository at ${resolved}. To create one there, run: flywheel repo:init ${shellQuote(resolved)}. To use a different existing repository, rerun this command with --repo <root>, or use --personal.`, resolved);
|
|
36
36
|
return resolved;
|
|
37
37
|
}
|
|
38
38
|
export async function resolveRepositorySelection({ params, cwd = process.cwd(), loadConfig = () => loadFlywheelConfig(), }) {
|
|
@@ -75,6 +75,6 @@ export async function resolveRepositorySelection({ params, cwd = process.cwd(),
|
|
|
75
75
|
break;
|
|
76
76
|
candidate = parent;
|
|
77
77
|
}
|
|
78
|
-
throw new RepositorySelectionError("repository_not_found", `No Flywheel repository found
|
|
78
|
+
throw new RepositorySelectionError("repository_not_found", `No Flywheel repository found in ${cwd} or any parent directory. To create one in the current directory, run: flywheel repo:init. To use an existing repository, rerun this command with --repo <root>, or use --personal.`);
|
|
79
79
|
}
|
|
80
80
|
//# sourceMappingURL=repository-selection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-selection.js","sourceRoot":"","sources":["../../src/commands/repository-selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAyB,MAAM,oBAAoB,CAAC;AAQ/E,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACxC,IAAI,CAKqB;IACzB,IAAI,CAAU;IACvB,YACE,IAAsC,EACtC,OAAe,EACf,UAAmB;QAEnB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;AACjD,CAAC;AACD,KAAK,UAAU,WAAW,CACxB,IAAY;IAEZ,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAChD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,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CAAC;gBACD,MAAM,IAAI,wBAAwB,CAChC,6BAA6B,EAC7B,oDAAoD,UAAU,MAAM,KAAK,CAAC,OAAO,0CAA0C,UAAU,CAAC,UAAU,CAAC,EAAE,CACpJ,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IACD,IAAI,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAI,KAAK,KAAK,OAAO;YACnB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;QAC1D,IAAI,KAAK,KAAK,SAAS;YACrB,MAAM,IAAI,wBAAwB,CAChC,2BAA2B,EAC3B,uCAAuC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,EAC1E,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAClC,CAAC;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACvC,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM;QAChC,SAAS,GAAG,MAAM,CAAC;IACrB,CAAC;IACD,MAAM,IAAI,wBAAwB,CAChC,sBAAsB,EACtB,mCAAmC,GAAG,qLAAqL,CAC5N,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by project/flywheel-server/scripts/sync_feedback_contract.py.
|
|
2
2
|
// Do not edit by hand.
|
|
3
|
-
export const FEEDBACK_CONTRACT_VERSION = "2026-
|
|
3
|
+
export const FEEDBACK_CONTRACT_VERSION = "2026-09-12.1";
|
|
4
4
|
export const FEEDBACK_SOURCES = [
|
|
5
5
|
"api",
|
|
6
6
|
"api_client",
|
|
@@ -70,5 +70,5 @@ export const FEEDBACK_NODE_WORKFLOW_FAMILIES = [
|
|
|
70
70
|
"tags",
|
|
71
71
|
"timeline_layout",
|
|
72
72
|
];
|
|
73
|
-
export const FEEDBACK_CONTRACT_ARTIFACT = JSON.parse('{"admin_note": {"max_length": 2000, "required": false}, "categories": ["billing", "bug", "confusing", "docs", "missing_capability", "other", "performance", "reliability", "workflow_friction"], "context_fields": ["route_family", "node_workflow_family", "command_family", "tool_family", "node_id", "request_id", "trace_id", "sentry_event_id", "product_event_id", "cli_invocation_id", "mcp_request_id", "mcp_idempotency_key"], "correlation_fields": ["request_id", "trace_id", "sentry_event_id", "product_event_id", "cli_invocation_id", "mcp_request_id", "mcp_idempotency_key", "node_id", "route_family", "node_workflow_family", "command_family", "tool_family"], "defaults": {"category": "other", "severity": "low", "status": "new"}, "message": {"max_length": 4000, "min_length": 1, "required": true}, "node_workflow_families": ["artifacts", "assets", "bulk_graph_actions", "canvas", "commit", "context_menu", "graph_layout", "hooks", "lease", "minimap", "node_focus", "node_hydration", "node_open", "node_selection", "node_view_editing", "partial_graph_preview", "radial_view", "share_policy", "staged_edit", "tags", "timeline_layout"], "privacy_rules": {"disallowed_fields": ["artifact_body", "attachment", "attachments", "authorization", "completion", "console", "cookies", "diagnostics", "dom_snapshot", "extra", "full_url", "headers", "logs", "metadata", "model_input", "model_output", "node_body", "node_content", "prompt", "query_string", "raw_logs", "replay", "request_body", "response_body", "screenshot", "token", "tool_transcript"], "message_storage": "Stored only in feedback_entries.message; never log or attach to Sentry context.", "raw_diagnostics": "Do not store screenshots, replay, raw logs, headers, bodies, prompts, model outputs, node content, or arbitrary metadata."}, "reporter_type_defaults": {"api": "human", "api_client": "human", "cli": "human", "mcp": "agent", "webui": "human"}, "reporter_types": ["agent", "human"], "route_families": ["admin", "analytics", "auth", "blobs", "compute", "credits", "feedback", "mcp", "nodes", "other", "root", "updates"], "severities": ["critical", "high", "low", "medium"], "sources": ["api", "api_client", "cli", "mcp", "webui"], "statuses": ["dismissed", "new", "planned", "resolved", "triaged"], "version": "2026-
|
|
73
|
+
export const FEEDBACK_CONTRACT_ARTIFACT = JSON.parse('{"admin_note": {"max_length": 2000, "required": false}, "categories": ["billing", "bug", "confusing", "docs", "missing_capability", "other", "performance", "reliability", "workflow_friction"], "context_fields": ["route_family", "node_workflow_family", "command_family", "tool_family", "node_id", "request_id", "trace_id", "sentry_event_id", "product_event_id", "cli_invocation_id", "mcp_request_id", "mcp_idempotency_key"], "correlation_fields": ["request_id", "trace_id", "sentry_event_id", "product_event_id", "cli_invocation_id", "mcp_request_id", "mcp_idempotency_key", "node_id", "route_family", "node_workflow_family", "command_family", "tool_family"], "defaults": {"category": "other", "severity": "low", "status": "new"}, "message": {"max_length": 4000, "min_length": 1, "required": true}, "node_workflow_families": ["artifacts", "assets", "bulk_graph_actions", "canvas", "commit", "context_menu", "graph_layout", "hooks", "lease", "minimap", "node_focus", "node_hydration", "node_open", "node_selection", "node_view_editing", "partial_graph_preview", "radial_view", "share_policy", "staged_edit", "tags", "timeline_layout"], "privacy_rules": {"disallowed_fields": ["artifact_body", "attachment", "attachments", "authorization", "completion", "console", "cookies", "diagnostics", "dom_snapshot", "extra", "full_url", "headers", "logs", "metadata", "model_input", "model_output", "node_body", "node_content", "prompt", "query_string", "raw_logs", "replay", "request_body", "response_body", "screenshot", "token", "tool_transcript"], "message_storage": "Stored only in feedback_entries.message; never log or attach to Sentry context.", "raw_diagnostics": "Do not store screenshots, replay, raw logs, headers, bodies, prompts, model outputs, node content, or arbitrary metadata."}, "reporter_type_defaults": {"api": "human", "api_client": "human", "cli": "human", "mcp": "agent", "webui": "human"}, "reporter_types": ["agent", "human"], "route_families": ["admin", "analytics", "auth", "blobs", "compute", "credits", "feedback", "mcp", "nodes", "other", "root", "updates"], "severities": ["critical", "high", "low", "medium"], "sources": ["api", "api_client", "cli", "mcp", "webui"], "statuses": ["dismissed", "new", "planned", "resolved", "triaged"], "version": "2026-09-12.1", "version_metadata_fields": {"accepted_in_create_payloads": false, "fields": ["client_version", "mcp_protocol_version", "api_version", "server_release"], "filled_by": "server", "max_lengths": {"api_version": 16, "client_version": 64, "mcp_protocol_version": 32, "server_release": 128}}}');
|
|
74
74
|
//# sourceMappingURL=generatedFeedbackContract.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatedFeedbackContract.js","sourceRoot":"","sources":["../src/generatedFeedbackContract.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,uBAAuB;AAEvB,MAAM,CAAC,MAAM,yBAAyB,GAAG,cAAuB,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,KAAK;IACL,YAAY;IACZ,KAAK;IACL,KAAK;IACL,OAAO;CACC,CAAC;AAGX,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAU,CAAC;AAGnE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS;IACT,KAAK;IACL,WAAW;IACX,MAAM;IACN,oBAAoB;IACpB,OAAO;IACP,aAAa;IACb,aAAa;IACb,mBAAmB;CACX,CAAC;AAGX,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU;IACV,MAAM;IACN,KAAK;IACL,QAAQ;CACA,CAAC;AAGX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW;IACX,KAAK;IACL,SAAS;IACT,UAAU;IACV,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO;IACP,WAAW;IACX,MAAM;IACN,OAAO;IACP,SAAS;IACT,SAAS;IACT,UAAU;IACV,KAAK;IACL,OAAO;IACP,OAAO;IACP,MAAM;IACN,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,WAAW;IACX,QAAQ;IACR,oBAAoB;IACpB,QAAQ;IACR,QAAQ;IACR,cAAc;IACd,cAAc;IACd,OAAO;IACP,OAAO;IACP,SAAS;IACT,YAAY;IACZ,gBAAgB;IAChB,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,uBAAuB;IACvB,aAAa;IACb,cAAc;IACd,aAAa;IACb,MAAM;IACN,iBAAiB;CACT,CAAC;AA+BX,MAAM,CAAC,MAAM,0BAA0B,GAA4B,IAAI,CAAC,KAAK,CAC3E,
|
|
1
|
+
{"version":3,"file":"generatedFeedbackContract.js","sourceRoot":"","sources":["../src/generatedFeedbackContract.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,uBAAuB;AAEvB,MAAM,CAAC,MAAM,yBAAyB,GAAG,cAAuB,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,KAAK;IACL,YAAY;IACZ,KAAK;IACL,KAAK;IACL,OAAO;CACC,CAAC;AAGX,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAU,CAAC;AAGnE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS;IACT,KAAK;IACL,WAAW;IACX,MAAM;IACN,oBAAoB;IACpB,OAAO;IACP,aAAa;IACb,aAAa;IACb,mBAAmB;CACX,CAAC;AAGX,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU;IACV,MAAM;IACN,KAAK;IACL,QAAQ;CACA,CAAC;AAGX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW;IACX,KAAK;IACL,SAAS;IACT,UAAU;IACV,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO;IACP,WAAW;IACX,MAAM;IACN,OAAO;IACP,SAAS;IACT,SAAS;IACT,UAAU;IACV,KAAK;IACL,OAAO;IACP,OAAO;IACP,MAAM;IACN,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,WAAW;IACX,QAAQ;IACR,oBAAoB;IACpB,QAAQ;IACR,QAAQ;IACR,cAAc;IACd,cAAc;IACd,OAAO;IACP,OAAO;IACP,SAAS;IACT,YAAY;IACZ,gBAAgB;IAChB,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,uBAAuB;IACvB,aAAa;IACb,cAAc;IACd,aAAa;IACb,MAAM;IACN,iBAAiB;CACT,CAAC;AA+BX,MAAM,CAAC,MAAM,0BAA0B,GAA4B,IAAI,CAAC,KAAK,CAC3E,2gFAA2gF,CAC5gF,CAAC"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { RepositoryServiceError } from "../errors.js";
|
|
2
|
+
import { NODE_FIELDS } from "../models/constants.js";
|
|
3
|
+
import { RepositoryOperation } from "../models/operations.js";
|
|
4
|
+
import { associateLatestValueWrites } from "../../store/latest-values.js";
|
|
5
|
+
function fieldEditTarget(operation) {
|
|
6
|
+
const payload = operation.payload;
|
|
7
|
+
switch (operation.type) {
|
|
8
|
+
case "node.field.set.v1":
|
|
9
|
+
return { ownerType: "node", ownerId: payload.node_id, field: payload.field };
|
|
10
|
+
case "edge.field.set.v1":
|
|
11
|
+
return { ownerType: "edge", ownerId: payload.edge_id, field: payload.field };
|
|
12
|
+
case "artifact.metadata.set.v1":
|
|
13
|
+
return { ownerType: "artifact", ownerId: payload.artifact_id, field: payload.field };
|
|
14
|
+
case "artifact.properties.set.v1":
|
|
15
|
+
return { ownerType: "artifact", ownerId: payload.artifact_id, field: "properties" };
|
|
16
|
+
default:
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// Only operation types that unconditionally INSERT a brand-new entity are safe fold targets:
|
|
21
|
+
// `node.create.v1` and `edge.add.v1` both fail outright at apply time when their id already
|
|
22
|
+
// exists (see `applyNodeCreate` and the `edge.add.v1` branch of `applyEdge` in
|
|
23
|
+
// `store/projection/nodes.ts`/`relations.ts`), so folding into them is safe regardless of what
|
|
24
|
+
// the batch alone can prove. `artifact.attach.v1`/`artifact.attach.v2` are NOT included: an
|
|
25
|
+
// attach also legitimately references an artifact that already exists elsewhere in history - a
|
|
26
|
+
// pure precondition check against its current properties digest, not a write (see `attach()` in
|
|
27
|
+
// `store/projection/artifacts.ts`) - and a same-batch attach can still receive a supplied
|
|
28
|
+
// properties value in that case (sharing an existing artifact while also editing its
|
|
29
|
+
// properties), so "did this attach consume a value" cannot reliably distinguish a fresh artifact
|
|
30
|
+
// from an existing one without repository state this pure function does not have. Folding into
|
|
31
|
+
// such an attach would silently rewrite its declared digest and break that precondition at apply
|
|
32
|
+
// time; artifact field chains are therefore always collapsed rather than folded into a creator.
|
|
33
|
+
function creatorTarget(operation) {
|
|
34
|
+
const payload = operation.payload;
|
|
35
|
+
switch (operation.type) {
|
|
36
|
+
case "node.create.v1":
|
|
37
|
+
return { ownerType: "node", ownerId: payload.node_id, fields: new Set(NODE_FIELDS) };
|
|
38
|
+
case "edge.add.v1":
|
|
39
|
+
return { ownerType: "edge", ownerId: payload.edge_id, fields: new Set(["content"]) };
|
|
40
|
+
default:
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Lifecycle, content-replacement, and detach operations invalidate a same-entity field chain's
|
|
45
|
+
// digest continuity; any other operation referencing the entity (tags, lineage, containment,
|
|
46
|
+
// edge endpoints) leaves field state untouched and never breaks folding or collapsing.
|
|
47
|
+
function disruptorTarget(operation) {
|
|
48
|
+
const payload = operation.payload;
|
|
49
|
+
switch (operation.type) {
|
|
50
|
+
case "node.tombstone.v1":
|
|
51
|
+
case "node.restore.v1":
|
|
52
|
+
case "node.purge.v1":
|
|
53
|
+
return { ownerType: "node", ownerId: payload.node_id };
|
|
54
|
+
case "edge.remove.v1":
|
|
55
|
+
return { ownerType: "edge", ownerId: payload.edge_id };
|
|
56
|
+
case "artifact.detach.v1":
|
|
57
|
+
case "artifact.content.set.v1":
|
|
58
|
+
return { ownerType: "artifact", ownerId: payload.artifact_id };
|
|
59
|
+
default:
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function entityKey(ownerType, ownerId) {
|
|
64
|
+
return `${ownerType}\0${ownerId}`;
|
|
65
|
+
}
|
|
66
|
+
function applyCreatorFold(operation, folds) {
|
|
67
|
+
const mapping = operation.toMapping();
|
|
68
|
+
if (operation.type === "node.create.v1") {
|
|
69
|
+
const initialValues = { ...mapping.initial_values };
|
|
70
|
+
const initialFieldDigests = { ...mapping.initial_field_digests };
|
|
71
|
+
for (const [field, write] of folds) {
|
|
72
|
+
initialValues[field] = write.value;
|
|
73
|
+
initialFieldDigests[field] = write.valueDigest;
|
|
74
|
+
}
|
|
75
|
+
return RepositoryOperation.fromMapping({ ...mapping, initial_values: initialValues, initial_field_digests: initialFieldDigests });
|
|
76
|
+
}
|
|
77
|
+
if (operation.type === "edge.add.v1") {
|
|
78
|
+
return RepositoryOperation.fromMapping({ ...mapping, content_digest: folds.get("content").valueDigest });
|
|
79
|
+
}
|
|
80
|
+
throw new Error("unreachable: applyCreatorFold called on a non-creator operation type");
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Folds staged field-edit chains into the smallest net change `repo:commit` records, so a
|
|
84
|
+
* corrected typo or a value edited back to its original never survives into history as
|
|
85
|
+
* separate churn (see FLY-974). Reuses `associateLatestValueWrites` (the same association the
|
|
86
|
+
* commit boundary already runs) instead of a second bookkeeping scheme.
|
|
87
|
+
*
|
|
88
|
+
* Per (owner, field) chain of same-family edits, in staged order:
|
|
89
|
+
* - Fold into a same-batch creator (`node.create.v1` for any node field, or `edge.add.v1` for
|
|
90
|
+
* an edge's content - both unconditionally insert a brand-new entity) when no
|
|
91
|
+
* lifecycle/content-replacement/detach operation on that entity sits between the creator and
|
|
92
|
+
* the chain's last edit. Artifact fields never fold into an attach: an attach can also
|
|
93
|
+
* legitimately reference an artifact that already exists elsewhere in history, which this
|
|
94
|
+
* pure function cannot distinguish from a fresh one (see `creatorTarget`).
|
|
95
|
+
* - Otherwise collapse the chain to its first operation, taking the final digest and change
|
|
96
|
+
* metadata from the last edit, dropping the collapsed operation entirely when the net digest
|
|
97
|
+
* equals the chain's original expected digest.
|
|
98
|
+
* - Leave the whole chain staged, untouched, when such a disruptor sits between two edits of the
|
|
99
|
+
* chain (the interleaving guardrail), or - for artifact fields - when an edit of the sibling
|
|
100
|
+
* metadata/properties family sits between them (they share one underlying properties blob).
|
|
101
|
+
*/
|
|
102
|
+
export function normalizeStagedBatch(operations, latestValues) {
|
|
103
|
+
const associations = associateLatestValueWrites(operations, latestValues);
|
|
104
|
+
const chains = new Map();
|
|
105
|
+
for (let index = 0; index < operations.length; index++) {
|
|
106
|
+
const target = fieldEditTarget(operations[index]);
|
|
107
|
+
if (!target)
|
|
108
|
+
continue;
|
|
109
|
+
const key = `${target.ownerType}\0${target.ownerId}\0${target.field}`;
|
|
110
|
+
const list = chains.get(key);
|
|
111
|
+
if (list)
|
|
112
|
+
list.push(index);
|
|
113
|
+
else
|
|
114
|
+
chains.set(key, [index]);
|
|
115
|
+
}
|
|
116
|
+
const creators = new Map();
|
|
117
|
+
for (let index = 0; index < operations.length; index++) {
|
|
118
|
+
const target = creatorTarget(operations[index]);
|
|
119
|
+
if (!target)
|
|
120
|
+
continue;
|
|
121
|
+
const key = entityKey(target.ownerType, target.ownerId);
|
|
122
|
+
if (!creators.has(key))
|
|
123
|
+
creators.set(key, index);
|
|
124
|
+
}
|
|
125
|
+
const disruptors = new Map();
|
|
126
|
+
for (let index = 0; index < operations.length; index++) {
|
|
127
|
+
const target = disruptorTarget(operations[index]);
|
|
128
|
+
if (!target)
|
|
129
|
+
continue;
|
|
130
|
+
const key = entityKey(target.ownerType, target.ownerId);
|
|
131
|
+
const list = disruptors.get(key);
|
|
132
|
+
if (list)
|
|
133
|
+
list.push(index);
|
|
134
|
+
else
|
|
135
|
+
disruptors.set(key, [index]);
|
|
136
|
+
}
|
|
137
|
+
// `artifact.metadata.set.v1` (legacy per-field digests) and `artifact.properties.set.v1` (one
|
|
138
|
+
// whole-blob digest) both read-modify-write the SAME `repository_artifacts.properties` column
|
|
139
|
+
// (see `setLegacyMetadata`/`setSharedValue` in `store/projection/artifacts.ts`). A metadata
|
|
140
|
+
// edit's own precondition only inspects its one decomposed field, but it still rewrites the
|
|
141
|
+
// whole blob digest a later `properties.set.v1` depends on, and vice versa. An edit of one
|
|
142
|
+
// family sitting between two edits of the OTHER family - or between a fold's creator and its
|
|
143
|
+
// chain - therefore invalidates that chain's skipped intermediate blob state even though the
|
|
144
|
+
// two families never share a field key.
|
|
145
|
+
const artifactBlobOps = new Map();
|
|
146
|
+
for (let index = 0; index < operations.length; index++) {
|
|
147
|
+
const operation = operations[index];
|
|
148
|
+
if (operation.type !== "artifact.metadata.set.v1" && operation.type !== "artifact.properties.set.v1")
|
|
149
|
+
continue;
|
|
150
|
+
const id = operation.payload.artifact_id;
|
|
151
|
+
const list = artifactBlobOps.get(id);
|
|
152
|
+
if (list)
|
|
153
|
+
list.push(index);
|
|
154
|
+
else
|
|
155
|
+
artifactBlobOps.set(id, [index]);
|
|
156
|
+
}
|
|
157
|
+
function ownWrite(operation) {
|
|
158
|
+
return [...associations.get(operation.operationId).values()][0];
|
|
159
|
+
}
|
|
160
|
+
const dropIndices = new Set();
|
|
161
|
+
const foldsByCreator = new Map();
|
|
162
|
+
const collapseUpdate = new Map();
|
|
163
|
+
const syntheticValues = [];
|
|
164
|
+
// Every index whose ORIGINAL latestValues consumption must be discarded: dropped chain
|
|
165
|
+
// members, a folded creator (its one value is replaced by the chain's final value), and a
|
|
166
|
+
// collapsed-but-surviving first operation (its value changes to the chain's final value).
|
|
167
|
+
// Tracked by index rather than by (owner, field) key so an unrelated, unmodified operation
|
|
168
|
+
// sharing that same key (e.g. an attach whose properties chain failed to fold) keeps its own
|
|
169
|
+
// original entry untouched.
|
|
170
|
+
const consumptionRemovalIndices = new Set();
|
|
171
|
+
for (const [key, indices] of chains) {
|
|
172
|
+
const [ownerType, ownerId, field] = key.split("\0");
|
|
173
|
+
const entity = entityKey(ownerType, ownerId);
|
|
174
|
+
const firstIndex = indices[0];
|
|
175
|
+
const lastIndex = indices.at(-1);
|
|
176
|
+
const lastOperation = operations[lastIndex];
|
|
177
|
+
const chainIndices = new Set(indices);
|
|
178
|
+
const foreignBlobOps = ownerType === "artifact" ? artifactBlobOps.get(ownerId) : undefined;
|
|
179
|
+
const hasForeignBlobOpBetween = (lowIndex, highIndex) => foreignBlobOps !== undefined && foreignBlobOps.some((index) => index > lowIndex && index < highIndex && !chainIndices.has(index));
|
|
180
|
+
const creatorIndex = creators.get(entity);
|
|
181
|
+
let foldEligible = false;
|
|
182
|
+
if (creatorIndex !== undefined && creatorIndex < firstIndex) {
|
|
183
|
+
const creator = creatorTarget(operations[creatorIndex]);
|
|
184
|
+
foldEligible = creator.fields.has(field) &&
|
|
185
|
+
!disruptors.get(entity)?.some((index) => index > creatorIndex && index < lastIndex) &&
|
|
186
|
+
!hasForeignBlobOpBetween(creatorIndex, lastIndex);
|
|
187
|
+
}
|
|
188
|
+
if (foldEligible) {
|
|
189
|
+
for (const index of indices) {
|
|
190
|
+
dropIndices.add(index);
|
|
191
|
+
consumptionRemovalIndices.add(index);
|
|
192
|
+
}
|
|
193
|
+
consumptionRemovalIndices.add(creatorIndex);
|
|
194
|
+
let folds = foldsByCreator.get(creatorIndex);
|
|
195
|
+
if (!folds) {
|
|
196
|
+
folds = new Map();
|
|
197
|
+
foldsByCreator.set(creatorIndex, folds);
|
|
198
|
+
}
|
|
199
|
+
const finalWrite = ownWrite(lastOperation);
|
|
200
|
+
folds.set(field, finalWrite);
|
|
201
|
+
if (operations[creatorIndex].type !== "node.create.v1")
|
|
202
|
+
syntheticValues.push(finalWrite);
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
// guardrail: whole chain stays staged
|
|
206
|
+
if (disruptors.get(entity)?.some((index) => index > firstIndex && index < lastIndex) || hasForeignBlobOpBetween(firstIndex, lastIndex)) {
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
const firstOperation = operations[firstIndex];
|
|
210
|
+
const finalDigest = lastOperation.payload.new_digest;
|
|
211
|
+
for (const index of indices) {
|
|
212
|
+
consumptionRemovalIndices.add(index);
|
|
213
|
+
if (index !== firstIndex)
|
|
214
|
+
dropIndices.add(index);
|
|
215
|
+
}
|
|
216
|
+
if (finalDigest === firstOperation.payload.expected_digest) {
|
|
217
|
+
dropIndices.add(firstIndex);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
collapseUpdate.set(firstIndex, { newDigest: finalDigest, changeMetadata: lastOperation.payload.change_metadata });
|
|
221
|
+
syntheticValues.push(ownWrite(lastOperation));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const finalOperations = [];
|
|
225
|
+
for (let index = 0; index < operations.length; index++) {
|
|
226
|
+
if (dropIndices.has(index))
|
|
227
|
+
continue;
|
|
228
|
+
const operation = operations[index];
|
|
229
|
+
const folds = foldsByCreator.get(index);
|
|
230
|
+
if (folds) {
|
|
231
|
+
finalOperations.push(applyCreatorFold(operation, folds));
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
const update = collapseUpdate.get(index);
|
|
235
|
+
finalOperations.push(update
|
|
236
|
+
? RepositoryOperation.fromMapping({ ...operation.toMapping(), new_digest: update.newDigest, change_metadata: update.changeMetadata })
|
|
237
|
+
: operation);
|
|
238
|
+
}
|
|
239
|
+
// Untouched entries keep the exact staged order (attach/legacy-metadata sidebands may
|
|
240
|
+
// legitimately be supplied out of operation order; see `attachmentValues` in
|
|
241
|
+
// `store/latest-values.ts`). Remove exactly the physical entries each discarded or
|
|
242
|
+
// rewritten operation originally consumed (matched by content, one slot per consumption, so
|
|
243
|
+
// duplicate values remove only as many copies as were actually taken), then append the
|
|
244
|
+
// recomputed final values; per-key order is all `iterateOperationLatestValues` requires.
|
|
245
|
+
const removalPool = [];
|
|
246
|
+
for (const index of consumptionRemovalIndices) {
|
|
247
|
+
for (const write of associations.get(operations[index].operationId).values())
|
|
248
|
+
removalPool.push(write);
|
|
249
|
+
}
|
|
250
|
+
const sameValue = (write, entry) => write.ownerType === entry.owner_type && write.ownerId === entry.owner_id && write.field === entry.field &&
|
|
251
|
+
write.value === entry.value && write.valueDigest === entry.value_digest;
|
|
252
|
+
const survivingOriginal = latestValues.filter((entry) => {
|
|
253
|
+
const removalIndex = removalPool.findIndex((write) => sameValue(write, entry));
|
|
254
|
+
if (removalIndex === -1)
|
|
255
|
+
return true;
|
|
256
|
+
removalPool.splice(removalIndex, 1);
|
|
257
|
+
return false;
|
|
258
|
+
});
|
|
259
|
+
const finalValues = [...survivingOriginal, ...syntheticValues.map((write) => write.toMapping())];
|
|
260
|
+
if (finalOperations.length === 0) {
|
|
261
|
+
throw new RepositoryServiceError("repository staging has no net changes");
|
|
262
|
+
}
|
|
263
|
+
return { operations: finalOperations, latestValues: finalValues };
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=commit-normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit-normalize.js","sourceRoot":"","sources":["../../../../src/local/domain/service/commit-normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAwB1E,SAAS,eAAe,CAAC,SAA8B;IACrD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;IAClC,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,mBAAmB;YACtB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAiB,EAAE,KAAK,EAAE,OAAO,CAAC,KAAe,EAAE,CAAC;QACnG,KAAK,mBAAmB;YACtB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAiB,EAAE,KAAK,EAAE,OAAO,CAAC,KAAe,EAAE,CAA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C,SAAS,KAAK,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;QACvG,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,YAAY,CAAC;IAC1E,MAAM,iBAAiB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QACtD,MAAM,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAC/E,IAAI,YAAY,KAAK,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QACrC,WAAW,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,CAAC,GAAG,iBAAiB,EAAE,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAEjG,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,sBAAsB,CAAC,uCAAuC,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { operationFailureMessage } from "../models/operation-identity.js";
|
|
|
4
4
|
import { RepositoryCommit } from "../models/commits.js";
|
|
5
5
|
import { MAX_COMMIT_METADATA_BYTES } from "../models/constants.js";
|
|
6
6
|
import { artifactDigests, latestStateDigests, latestValueWrites } from "./writes.js";
|
|
7
|
+
import { normalizeStagedBatch } from "./commit-normalize.js";
|
|
7
8
|
function commitTimestamp(clock) {
|
|
8
9
|
const value = clock();
|
|
9
10
|
if (!(value instanceof Date) || Number.isNaN(value.valueOf())) {
|
|
@@ -28,18 +29,19 @@ export async function commitStaged(store, repositoryId, clientId, expectedHead,
|
|
|
28
29
|
}
|
|
29
30
|
throw error;
|
|
30
31
|
}
|
|
32
|
+
const normalized = normalizeStagedBatch(workspace.staging.operations, workspace.staging.latestValues);
|
|
31
33
|
const commit = RepositoryCommit.create({
|
|
32
34
|
repositoryId,
|
|
33
|
-
operations:
|
|
35
|
+
operations: normalized.operations,
|
|
34
36
|
parentCommitId: expectedHead,
|
|
35
37
|
authorKind: "client",
|
|
36
38
|
authorId: clientId,
|
|
37
39
|
authoredAt: commitTimestamp(clock),
|
|
38
40
|
message,
|
|
39
|
-
latestStateDigests: latestStateDigests(
|
|
40
|
-
artifactDigests: artifactDigests(
|
|
41
|
+
latestStateDigests: latestStateDigests(normalized.operations),
|
|
42
|
+
artifactDigests: artifactDigests(normalized.operations),
|
|
41
43
|
});
|
|
42
|
-
const writes = latestValueWrites(
|
|
44
|
+
const writes = latestValueWrites(normalized.operations, normalized.latestValues);
|
|
43
45
|
const metadataBytes = commit.canonicalBytes.byteLength + writes.reduce((total, write) => total + write.byteLength, 0);
|
|
44
46
|
if (metadataBytes > MAX_COMMIT_METADATA_BYTES) {
|
|
45
47
|
throw new RepositoryServiceError("repository commit metadata exceeds limit");
|
|
@@ -50,6 +52,7 @@ export async function commitStaged(store, repositoryId, clientId, expectedHead,
|
|
|
50
52
|
canonicalCommits: [commit],
|
|
51
53
|
latestValueWrites: writes,
|
|
52
54
|
clearStaging: true,
|
|
55
|
+
expectedStagingDigest: stagingDigest,
|
|
53
56
|
localWorkspaceHead: commit.commitId,
|
|
54
57
|
syncState: null,
|
|
55
58
|
resultingHead: commit.commitId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit.js","sourceRoot":"","sources":["../../../../src/local/domain/service/commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBA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,QAAQ;QAClB,UAAU,EAAE,eAAe,CAAC,KAAK,CAAC;QAClC,OAAO;QACP,kBAAkB,EAAE,kBAAkB,CAAC,UAAU,CAAC,UAAU,CAAC;QAC7D,eAAe,EAAE,eAAe,CAAC,UAAU,CAAC,UAAU,CAAC;KACxD,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACjF,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACtH,IAAI,aAAa,GAAG,yBAAyB,EAAE,CAAC;QAC9C,MAAM,IAAI,sBAAsB,CAAC,0CAA0C,CAAC,CAAC;IAC/E,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC;QACrC,YAAY;QACZ,YAAY;QACZ,gBAAgB,EAAE,CAAC,MAAM,CAAC;QAC1B,iBAAiB,EAAE,MAAM;QACzB,YAAY,EAAE,IAAI;QAClB,qBAAqB,EAAE,aAAa;QACpC,kBAAkB,EAAE,MAAM,CAAC,QAAQ;QACnC,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,MAAM,CAAC,QAAQ;KAC/B,CAAC,CAAC;IACH,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,MAAM;QACxC,aAAa;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -2,9 +2,8 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { RepositoryContractError } from "../domain/errors.js";
|
|
3
3
|
import { RepositoryCommit } from "../domain/models/commits.js";
|
|
4
4
|
import { MAX_COMMIT_METADATA_BYTES } from "../domain/models/constants.js";
|
|
5
|
-
import { parseRepositoryJson } from "../domain/models/encoding.js";
|
|
6
5
|
import { latestValuesBytes, stagingBytes, stagingDigest } from "../domain/service/staging.js";
|
|
7
|
-
import {
|
|
6
|
+
import { persistCommit, workspaceHeadIn } from "./commits.js";
|
|
8
7
|
import { latestValueWrites } from "./latest-values.js";
|
|
9
8
|
import { applyCommitProjection } from "./projection/apply.js";
|
|
10
9
|
import { withWriteConnectionAsync } from "./sqlite/connection.js";
|
|
@@ -68,10 +67,8 @@ function prepareStaging(database, batch, commit, timestamp) {
|
|
|
68
67
|
throw new RepositoryStoreError("revert requires empty repository staging");
|
|
69
68
|
}
|
|
70
69
|
else {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
!stagingBytes(workspace.staging.operations).equals(stagingBytes(commit.operations)) ||
|
|
74
|
-
!latestValuesBytes(workspace.staging.latestValues).equals(committedLatest)) {
|
|
70
|
+
if (batch.expectedStagingDigest === undefined || batch.expectedStagingDigest === null ||
|
|
71
|
+
workspace.staging.digest !== batch.expectedStagingDigest) {
|
|
75
72
|
throw new RepositoryStoreError("staged commit operations are stale");
|
|
76
73
|
}
|
|
77
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../src/local/store/apply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../src/local/store/apply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,C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ACD,MAAM,KAAK,GAAG,gBAAgB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACnG,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,GAAG;QACL,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;IAED,SAAS;QACP,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK;YACrE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,WAAW;SAClD,CAAC;IACJ,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"sourceDigest": "sha256:
|
|
2
|
+
"sourceDigest": "sha256:425fe6b29f7d715bedb8fd2ed4bb652b4c92add1c1473c23c18324679fd3b07f",
|
|
3
3
|
"files": [
|
|
4
4
|
"auth/active-key-id.js",
|
|
5
5
|
"auth/active-key-id.js.map",
|
|
@@ -443,6 +443,8 @@
|
|
|
443
443
|
"local/domain/revert/plan.js.map",
|
|
444
444
|
"local/domain/revert/tag-inverses.js",
|
|
445
445
|
"local/domain/revert/tag-inverses.js.map",
|
|
446
|
+
"local/domain/service/commit-normalize.js",
|
|
447
|
+
"local/domain/service/commit-normalize.js.map",
|
|
446
448
|
"local/domain/service/commit.js",
|
|
447
449
|
"local/domain/service/commit.js.map",
|
|
448
450
|
"local/domain/service/compose.js",
|
package/src/setup/command.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveSetupMode } from "./mode.mjs";
|
|
2
2
|
import { recordResolvedMode } from "./resolved-selection-record.mjs";
|
|
3
3
|
import { createSetupStdinAuthReader } from "../setup-auth.mjs";
|
|
4
|
+
import { resolveInteractiveSetupScope } from "./install-scope.mjs";
|
|
4
5
|
|
|
5
6
|
export async function runSetupRouter(options = {}, deps = {}) {
|
|
6
7
|
const mode = await resolveSetupMode(options, {
|
|
@@ -11,10 +12,15 @@ export async function runSetupRouter(options = {}, deps = {}) {
|
|
|
11
12
|
? createSetupStdinAuthReader(options, deps.stdin)
|
|
12
13
|
: undefined;
|
|
13
14
|
recordResolvedMode(mode, deps);
|
|
15
|
+
const scope = await resolveInteractiveSetupScope(options, {
|
|
16
|
+
allowPrompt: deps.isInteractive === true && options.yes !== true,
|
|
17
|
+
promptLocation: deps.promptInstallLocation,
|
|
18
|
+
});
|
|
14
19
|
const context = {
|
|
15
20
|
mode,
|
|
16
21
|
options,
|
|
17
22
|
readStdinAuth,
|
|
23
|
+
scope,
|
|
18
24
|
};
|
|
19
25
|
|
|
20
26
|
if (mode === "mcp") {
|
|
@@ -605,7 +605,7 @@ export async function runMcpModeCommand(options, deps = {}) {
|
|
|
605
605
|
);
|
|
606
606
|
}
|
|
607
607
|
|
|
608
|
-
const scope = options.project ? "project" : "global";
|
|
608
|
+
const scope = deps.scope ?? (options.project ? "project" : "global");
|
|
609
609
|
const baseUrl = normalizeBaseUrl(
|
|
610
610
|
resolveSetupBaseUrl({ explicitBaseUrl: options.baseUrl }),
|
|
611
611
|
);
|