@timurproko/a1 0.1.8-dev.290 → 0.1.8-dev.322
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 +21 -0
- package/bin/guardian.js +4 -3
- package/bin/ui.js +4 -2
- package/bin/update-recovery.js +3 -1
- package/dist/composition/owned-ui.js +13 -1
- package/dist/contracts/owned-ui/index.d.ts +1 -0
- package/dist/contracts/owned-ui/index.js +1 -0
- package/dist/contracts/owned-ui/prompt-history.d.ts +37 -0
- package/dist/contracts/owned-ui/prompt-history.js +23 -0
- package/dist/features/launch/profile-paths.d.ts +2 -0
- package/dist/features/launch/profile-paths.js +11 -0
- package/dist/features/prompt-history/index.d.ts +2 -0
- package/dist/features/prompt-history/index.js +2 -0
- package/dist/features/prompt-history/paths.d.ts +4 -0
- package/dist/features/prompt-history/paths.js +16 -0
- package/dist/features/prompt-history/service.d.ts +24 -0
- package/dist/features/prompt-history/service.js +260 -0
- package/dist/features/prompt-history/store.d.ts +15 -0
- package/dist/features/prompt-history/store.js +166 -0
- package/dist/features/prompt-history/worker.d.ts +9 -0
- package/dist/features/prompt-history/worker.js +42 -0
- package/dist/foundation/launch-context/index.d.ts +29 -0
- package/dist/foundation/launch-context/index.js +83 -0
- package/dist/foundation/launch-guardian/main.js +4 -3
- package/dist/foundation/release/bootstrap.d.ts +1 -1
- package/dist/foundation/release/bootstrap.js +18 -12
- package/dist/foundation/release/cohort-state.d.ts +1 -0
- package/dist/foundation/release/cohort-state.js +4 -0
- package/dist/foundation/release/release-gc.js +2 -2
- package/dist/foundation/release/release-store.js +10 -3
- package/dist/foundation/release/release.d.ts +3 -1
- package/dist/foundation/release/release.js +7 -3
- package/dist/foundation/release/restart-certification.d.ts +1 -0
- package/dist/foundation/release/restart-certification.js +5 -0
- package/dist/foundation/release/update-recovery.d.ts +2 -0
- package/dist/foundation/release/update-recovery.js +4 -0
- package/dist/foundation/release/update.js +5 -0
- package/dist/foundation/release/warmup.d.ts +1 -1
- package/dist/foundation/release/warmup.js +5 -4
- package/dist/foundation/startup/startup-runtime.js +13 -11
- package/dist/foundation/supervision/main.js +8 -7
- package/dist/integrations/pi/components/editor-interaction.d.ts +38 -0
- package/dist/integrations/pi/components/editor-interaction.js +1 -0
- package/dist/integrations/pi/components/history-editor-loader.d.ts +5 -0
- package/dist/integrations/pi/components/history-editor-loader.js +5 -0
- package/dist/integrations/pi/components/index.d.ts +1 -0
- package/dist/integrations/pi/components/index.js +1 -0
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +2 -1
- package/dist/integrations/pi/components/owned-editor-ux.js +95 -22
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +12 -1
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +9 -2
- package/dist/integrations/pi/components/shell-presenters-info.js +35 -4
- package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +3 -2
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +8 -5
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +15 -2
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +12 -0
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +25 -2
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +13 -9
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +137 -133
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +280 -0
- package/dist/integrations/pi/components/upstream/history/editor-core.js +2062 -0
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +32 -0
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +48 -0
- package/dist/integrations/pi/components/upstream/history/printable-key.d.ts +1 -0
- package/dist/integrations/pi/components/upstream/history/printable-key.js +40 -0
- package/dist/integrations/pi/components/upstream/history/text-helpers.d.ts +14 -0
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +28 -0
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +22 -0
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +36 -0
- package/dist/integrations/pi/components/upstream/history/word-navigation.d.ts +24 -0
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +100 -0
- package/dist/integrations/pi/engine/adapter.d.ts +13 -1
- package/dist/integrations/pi/engine/adapter.js +86 -25
- package/dist/integrations/pi/engine/changelog.d.ts +2 -0
- package/dist/integrations/pi/engine/changelog.js +63 -0
- package/dist/integrations/pi/engine/resources/changelog.json +12 -0
- package/dist/integrations/pi/engine/workflow-controllers.d.ts +1 -1
- package/dist/integrations/pi/engine/workflows.d.ts +1 -1
- package/dist/integrations/pi/session-ui/prompt-chips.d.ts +4 -1
- package/dist/integrations/pi/session-ui/prompt-chips.js +40 -13
- package/dist/integrations/pi/session-ui/prompt-history-controller.d.ts +30 -0
- package/dist/integrations/pi/session-ui/prompt-history-controller.js +147 -0
- package/dist/integrations/pi/session-ui/session-shell-root.d.ts +33 -0
- package/dist/integrations/pi/session-ui/session-shell-root.js +68 -74
- package/dist/integrations/pi/session-ui/session-shell.d.ts +1 -1
- package/dist/integrations/pi/session-ui/session-shell.js +98 -12
- package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +5 -0
- package/dist/integrations/pi/session-ui/session-viewport-controller.js +21 -15
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +7 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +7 -6
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/product-identity.d.ts +2 -2
- package/dist/product-identity.js +3 -36
- package/dist/product-identity.json +1 -22
- package/dist/ui/components/transcript-viewport.d.ts +8 -0
- package/dist/ui/components/transcript-viewport.js +23 -2
- package/dist/ui/components/visible-hyperlinks.d.ts +7 -0
- package/dist/ui/components/visible-hyperlinks.js +1 -0
- package/dist/ui/settings/declarations.js +19 -0
- package/dist/ui/settings/sections.js +11 -1
- package/dist/ui/settings/session.js +13 -4
- package/docs/architecture/boundaries.md +2 -0
- package/docs/architecture/history-editor-provenance.md +96 -0
- package/docs/architecture/internal-naming.md +89 -0
- package/docs/architecture/project-structure.md +1 -0
- package/docs/architecture/resource-and-data-policy.md +27 -1
- package/docs/architecture/toolchain.md +15 -1
- package/docs/features/prompt-history.md +149 -0
- package/package.json +8 -3
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { posix } from "node:path";
|
|
4
|
+
const REPOSITORY = "https://github.com/earendil-works/pi";
|
|
5
|
+
export async function readPinnedCommandChangelog(sinceVersion) {
|
|
6
|
+
const path = new URL("./resources/changelog.json", import.meta.url);
|
|
7
|
+
if (!existsSync(path))
|
|
8
|
+
return sinceVersion === undefined ? "No changelog entries found." : "";
|
|
9
|
+
try {
|
|
10
|
+
const resource = JSON.parse(await readFile(path, "utf8"));
|
|
11
|
+
if (!resource || typeof resource !== "object" || !("data" in resource) || typeof resource.data !== "string")
|
|
12
|
+
throw new TypeError("Invalid owned changelog resource");
|
|
13
|
+
const markdown = resource.data;
|
|
14
|
+
return formatPinnedCommandChangelog(markdown, sinceVersion);
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
// Compatibility: Pi's data-file parser reports a warning and supplies an empty changelog.
|
|
18
|
+
console.error(`Warning: Could not parse changelog: ${error}`);
|
|
19
|
+
return sinceVersion === undefined ? "No changelog entries found." : "";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function formatPinnedCommandChangelog(content, sinceVersion) {
|
|
23
|
+
// Provenance: behavior follows Pi 0.84.2 utils/changelog.ts at 914cf1472e715297caa30db4b9535d534a9eb718.
|
|
24
|
+
// Runtime reads only the owned data resource; maintenance tooling verifies its pinned provenance.
|
|
25
|
+
let releases = content.split(/(?=^## )/m).flatMap((section) => {
|
|
26
|
+
const version = /^##\s+\[?(\d+)\.(\d+)\.(\d+)\]?/.exec(section);
|
|
27
|
+
return version ? [{ version: version.slice(1).map(Number), markdown: section.trim() }] : [];
|
|
28
|
+
});
|
|
29
|
+
if (sinceVersion !== undefined) {
|
|
30
|
+
const previous = sinceVersion.split(".").map(value => Number(value) || 0);
|
|
31
|
+
releases = releases.filter(release => {
|
|
32
|
+
for (let index = 0; index < 3; index++) {
|
|
33
|
+
const difference = release.version[index] - (previous[index] ?? 0);
|
|
34
|
+
if (difference !== 0)
|
|
35
|
+
return difference > 0;
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
else
|
|
41
|
+
releases.reverse();
|
|
42
|
+
if (releases.length === 0)
|
|
43
|
+
return sinceVersion === undefined ? "No changelog entries found." : "";
|
|
44
|
+
return releases.map(release => release.markdown.replace(/(!?\[[^\]\n]+\]\()([^\s)]+)((?:\s+[^)]*)?\))/g, (_match, prefix, target, suffix) => `${prefix}${releaseLink(target, `v${release.version.join(".")}`)}${suffix}`)).join("\n\n");
|
|
45
|
+
}
|
|
46
|
+
function releaseLink(target, tag) {
|
|
47
|
+
const canonical = target
|
|
48
|
+
.replace(/^https:\/\/github\.com\/(?:badlogic|earendil-works)\/pi-mono(?=\/|$)/, REPOSITORY)
|
|
49
|
+
.replace(/^(https:\/\/github\.com\/earendil-works\/pi\/(?:blob|tree)\/)(?:main|master)\//, `$1${tag}/`);
|
|
50
|
+
if (/^(?:#|\/\/|[a-z][a-z0-9+.-]*:)/i.test(canonical))
|
|
51
|
+
return canonical;
|
|
52
|
+
const boundary = canonical.search(/[?#]/);
|
|
53
|
+
const path = boundary === -1 ? canonical : canonical.slice(0, boundary);
|
|
54
|
+
const suffix = boundary === -1 ? "" : canonical.slice(boundary);
|
|
55
|
+
if (!path)
|
|
56
|
+
return canonical;
|
|
57
|
+
const normalized = path.replaceAll("\\", "/");
|
|
58
|
+
const repositoryPath = posix.normalize(normalized.startsWith("/") ? normalized.replace(/^\/+/, "") : posix.join("packages/coding-agent", normalized));
|
|
59
|
+
if (repositoryPath === "." || repositoryPath === ".." || repositoryPath.startsWith("../"))
|
|
60
|
+
return canonical;
|
|
61
|
+
const route = path.endsWith("/") || !posix.basename(repositoryPath).includes(".") ? "tree" : "blob";
|
|
62
|
+
return `${REPOSITORY}/${route}/${tag}/${encodeURI(repositoryPath)}${suffix}`;
|
|
63
|
+
}
|