@code-yeongyu/senpi 2026.7.24 → 2026.7.25-2
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/CHANGELOG.md +32 -1
- package/dist/beta/omo-local-update.d.ts +207 -0
- package/dist/beta/omo-local-update.d.ts.map +1 -0
- package/dist/beta/omo-local-update.js +708 -0
- package/dist/beta/omo-local-update.js.map +1 -0
- package/dist/core/agent-session.d.ts +13 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +23 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/index.js +20 -17
- package/dist/core/extensions/builtin/config-reload/index.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/log.d.ts +4 -1
- package/dist/core/extensions/builtin/config-reload/log.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/log.js +3 -0
- package/dist/core/extensions/builtin/config-reload/log.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts +15 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts.map +1 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.js +102 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +48 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +88 -64
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/index.js +2 -4
- package/dist/core/extensions/builtin/websearch/index.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.js +4 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.js +2 -4
- package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/renderers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/renderers.js +20 -8
- package/dist/core/extensions/builtin/websearch/websearch/renderers.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.d.ts +6 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.js +15 -11
- package/dist/core/extensions/builtin/websearch/websearch/search.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/tool.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/tool.js +5 -10
- package/dist/core/extensions/builtin/websearch/websearch/tool.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/types.d.ts +1 -0
- package/dist/core/extensions/builtin/websearch/websearch/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/types.js.map +1 -1
- package/dist/core/extensions/types.d.ts +2 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +13 -3
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +19 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +3 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/retry-fallback/controller.d.ts +7 -0
- package/dist/core/retry-fallback/controller.d.ts.map +1 -1
- package/dist/core/retry-fallback/controller.js +13 -0
- package/dist/core/retry-fallback/controller.js.map +1 -1
- package/dist/core/settings-manager.d.ts +7 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +10 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/thinking-levels.d.ts.map +1 -1
- package/dist/core/thinking-levels.js +9 -2
- package/dist/core/thinking-levels.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +6 -0
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +3 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +9 -2
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +9 -2
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +11 -0
- package/dist/package-manager-cli.js.map +1 -1
- package/docs/extensions.md +2 -2
- package/docs/settings.md +11 -0
- package/examples/extensions/message-renderer.ts +2 -2
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +13 -1
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +87 -22
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +15 -7
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +38 -16
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +9 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +12 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +19 -11
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +121 -23
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +12 -7
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js +37 -35
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models-store.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +8 -3
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.js +70 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +6 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [2026.7.25-2] - 2026-07-25
|
|
4
|
+
|
|
5
|
+
### New Features
|
|
6
|
+
|
|
7
|
+
- **Claude Opus 5** — Available on Anthropic and Amazon Bedrock with adaptive thinking (including `xhigh`), inference profiles, and prompt caching. See [Providers](docs/providers.md#api-keys).
|
|
8
|
+
- **Anthropic gateway bearer auth** — `ANTHROPIC_AUTH_TOKEN` authenticates against Anthropic-compatible gateways that require `Authorization: Bearer`, including compaction and branch summaries. See [Environment Variables or Auth File](docs/providers.md#environment-variables-or-auth-file).
|
|
9
|
+
- **Faster, more resilient model catalogs** — pi.dev catalogs revalidate with `If-None-Match` so unchanged providers answer with an empty `304`, and llama.cpp models stay listed across restarts. See [llama.cpp](docs/llama-cpp.md).
|
|
10
|
+
|
|
11
|
+
### Breaking Changes
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Exposed the `outputPad` setting to custom message renderers. See [Extensions](docs/extensions.md) ([#7045](https://github.com/earendil-works/pi/pull/7045) by [@xl0](https://github.com/xl0)).
|
|
16
|
+
- Added inherited `ANTHROPIC_AUTH_TOKEN` bearer authentication for Anthropic-compatible gateways. See [Providers](docs/providers.md#environment-variables-or-auth-file) ([#5871](https://github.com/earendil-works/pi/issues/5871)).
|
|
17
|
+
- Added inherited Claude Opus 5 support for Anthropic and Amazon Bedrock with adaptive thinking, inference profiles, prompt caching, and preserved AWS validation messages ([#7081](https://github.com/earendil-works/pi/pull/7081) by [@unexge](https://github.com/unexge), [#7083](https://github.com/earendil-works/pi/pull/7083) by [@davidbrai](https://github.com/davidbrai)).
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Changed pi.dev model catalog refreshes to revalidate with `If-None-Match`, so unchanged provider catalogs answer with an empty `304` instead of a full download.
|
|
22
|
+
- Changed inherited Radius OAuth device authorization, token exchange, and refresh requests to use the configured gateway directly.
|
|
23
|
+
- Changed inherited model loading errors to append the underlying cause, so auth failures such as `OAuth refresh failed for openai-codex` report the provider response instead of a bare wrapper message.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- Fixed startup context file discovery to skip directories that match context file names such as `AGENTS.md`, which produced `EISDIR` warnings ([#7106](https://github.com/earendil-works/pi/pull/7106) by [@mrexodia](https://github.com/mrexodia)).
|
|
28
|
+
- Fixed the llama.cpp extension to persist its model catalog, so llama.cpp models stay listed before the first successful refresh. See [llama.cpp](docs/llama-cpp.md) ([#7072](https://github.com/earendil-works/pi/pull/7072) by [@davidbrai](https://github.com/davidbrai)).
|
|
29
|
+
|
|
30
|
+
### Removed
|
|
31
|
+
|
|
32
|
+
## [2026.7.25] - 2026-07-25
|
|
4
33
|
|
|
5
34
|
### Breaking Changes
|
|
6
35
|
|
|
@@ -10,6 +39,8 @@
|
|
|
10
39
|
|
|
11
40
|
### Fixed
|
|
12
41
|
|
|
42
|
+
- Fixed npm installs on non-Linux x64 platforms by keeping platform-constrained native packages out of bundled dependencies ([#343](https://github.com/code-yeongyu/senpi/pull/343) by [@realsigridjin](https://github.com/realsigridjin)).
|
|
43
|
+
|
|
13
44
|
### Removed
|
|
14
45
|
|
|
15
46
|
## [2026.7.24] - 2026-07-24
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { PackageSource } from "../core/settings-manager.ts";
|
|
2
|
+
/** Result of one spawned command, with output captured and timeout enforced. */
|
|
3
|
+
export interface OmoLocalRunResult {
|
|
4
|
+
code: number | null;
|
|
5
|
+
stdout: string;
|
|
6
|
+
stderr: string;
|
|
7
|
+
timedOut: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface OmoLocalRunOptions {
|
|
10
|
+
cwd?: string;
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
/** Merged over process.env (callers inject the isolated git env from the fixture contract). */
|
|
13
|
+
env?: Record<string, string | undefined>;
|
|
14
|
+
}
|
|
15
|
+
/** exported for tests only */
|
|
16
|
+
export type OmoLocalRun = (command: string, args: string[], options: OmoLocalRunOptions) => Promise<OmoLocalRunResult>;
|
|
17
|
+
/**
|
|
18
|
+
* exported for tests only
|
|
19
|
+
*
|
|
20
|
+
* Shared process seam for the whole module. spawnProcess/waitForChildProcess neither capture
|
|
21
|
+
* output nor enforce timeouts; this adds both. The child is spawned detached on POSIX so it
|
|
22
|
+
* owns a process group, and the timeout kill goes through killProcessTree (SIGKILL to the
|
|
23
|
+
* whole group) - without that, bun/git descendants would keep mutating the build worktree
|
|
24
|
+
* after the direct child died.
|
|
25
|
+
*/
|
|
26
|
+
export declare function defaultRun(command: string, args: string[], options: OmoLocalRunOptions): Promise<OmoLocalRunResult>;
|
|
27
|
+
/** exported for tests only */
|
|
28
|
+
export declare function isKillSwitched(env: Record<string, string | undefined>): boolean;
|
|
29
|
+
/** A detected locally-installed OMO plugin and its enclosing omo monorepo checkout. */
|
|
30
|
+
export interface OmoLocalInstall {
|
|
31
|
+
pluginPath: string;
|
|
32
|
+
repoRoot: string;
|
|
33
|
+
}
|
|
34
|
+
/** exported for tests only */
|
|
35
|
+
export interface DetectOmoLocalInstallOptions {
|
|
36
|
+
packages: PackageSource[] | undefined;
|
|
37
|
+
agentDir: string;
|
|
38
|
+
run: OmoLocalRun;
|
|
39
|
+
readJson?: (path: string) => unknown;
|
|
40
|
+
exists?: (path: string) => boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* exported for tests only
|
|
44
|
+
*
|
|
45
|
+
* Three-part detection gate (ALL must hold, else silent no-op):
|
|
46
|
+
* 1. A global settings `packages` entry (string or object form) is a local path whose resolved
|
|
47
|
+
* dir's package.json name is `@code-yeongyu/omo-senpi`.
|
|
48
|
+
* 2. The derived repo root (pluginPath/../../..) contains both workspace packages
|
|
49
|
+
* `@oh-my-opencode/omo-senpi` and `@oh-my-opencode/senpi-task`.
|
|
50
|
+
* 3. `git -C <repoRoot> rev-parse --show-toplevel` succeeds AND its canonicalized output equals
|
|
51
|
+
* the canonicalized repo root - a mismatched toplevel would mean the derived root is not
|
|
52
|
+
* the checkout it claims to be.
|
|
53
|
+
*/
|
|
54
|
+
export declare function detectOmoLocalInstall(options: DetectOmoLocalInstallOptions): Promise<OmoLocalInstall | undefined>;
|
|
55
|
+
/** State stamp written after a successful install: `<agentDir>/omo-local-update-state.json`. */
|
|
56
|
+
export interface OmoLocalUpdateStamp {
|
|
57
|
+
repoRoot: string;
|
|
58
|
+
/** Frozen origin/dev sha the installed plugin was built from. */
|
|
59
|
+
sha: string;
|
|
60
|
+
/** `git rev-parse origin/dev:packages/omo-senpi` at install time. */
|
|
61
|
+
omoSenpiTree: string;
|
|
62
|
+
/** `git rev-parse origin/dev:packages/senpi-task` at install time. */
|
|
63
|
+
senpiTaskTree: string;
|
|
64
|
+
installedAt: string;
|
|
65
|
+
/** Post-install inventory: relative paths of every installed artifact present at stamp time. */
|
|
66
|
+
artifacts: string[];
|
|
67
|
+
}
|
|
68
|
+
/** exported for tests only */
|
|
69
|
+
export declare function omoLocalUpdateStampPath(agentDir: string): string;
|
|
70
|
+
/** exported for tests only */
|
|
71
|
+
export declare function readStamp(agentDir: string): OmoLocalUpdateStamp | undefined;
|
|
72
|
+
/** exported for tests only */
|
|
73
|
+
export declare function writeStamp(agentDir: string, stamp: OmoLocalUpdateStamp): void;
|
|
74
|
+
/** exported for tests only */
|
|
75
|
+
export interface ShouldSkipUpdateOptions {
|
|
76
|
+
stamp: OmoLocalUpdateStamp | undefined;
|
|
77
|
+
repoRoot: string;
|
|
78
|
+
remoteSha: string;
|
|
79
|
+
/** True only when every path recorded in stamp.artifacts still exists on disk. */
|
|
80
|
+
stampArtifactsExist: boolean;
|
|
81
|
+
force: boolean;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* exported for tests only
|
|
85
|
+
*
|
|
86
|
+
* Skip decision (taken BEFORE any worktree op, install, or write): skip only when the stamp
|
|
87
|
+
* belongs to this repo root, was installed at the frozen remote sha, recorded a non-empty
|
|
88
|
+
* artifact inventory, and every inventoried path still exists. A repoRoot mismatch always
|
|
89
|
+
* updates; an empty/absent inventory never skips; force always updates.
|
|
90
|
+
*/
|
|
91
|
+
export declare function shouldSkipUpdate(options: ShouldSkipUpdateOptions): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* exported for tests only
|
|
94
|
+
*
|
|
95
|
+
* Failure of one orchestrator-owned step (fetch/worktree/install/build/artifacts/swap/stamp).
|
|
96
|
+
* The stage feeds `OMO local plugin update failed (<stage>): ...`; `output` (combined
|
|
97
|
+
* stdout+stderr of the failed step) is echoed dim, last 40 lines.
|
|
98
|
+
*/
|
|
99
|
+
export declare class OmoLocalStepError extends Error {
|
|
100
|
+
readonly stage: string;
|
|
101
|
+
readonly output: string | undefined;
|
|
102
|
+
constructor(stage: string, message: string, output?: string);
|
|
103
|
+
}
|
|
104
|
+
/** The frozen state of origin/dev: commit sha, subject, and both package tree hashes. */
|
|
105
|
+
export interface OmoRemoteState {
|
|
106
|
+
sha: string;
|
|
107
|
+
subject: string;
|
|
108
|
+
omoSenpiTree: string;
|
|
109
|
+
senpiTaskTree: string;
|
|
110
|
+
}
|
|
111
|
+
/** exported for tests only */
|
|
112
|
+
export interface ComputeRemoteStateOptions {
|
|
113
|
+
repoRoot: string;
|
|
114
|
+
run: OmoLocalRun;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* exported for tests only
|
|
118
|
+
*
|
|
119
|
+
* Inspect the two packages' state ON ORIGIN/DEV: ONE `git fetch origin dev` (120s, read-only
|
|
120
|
+
* - the ONLY network/ref operation in the module), then rev-parse/log reads against the
|
|
121
|
+
* frozen `origin/dev` ref. A fetch failure throws an OmoLocalStepError with stage "fetch"
|
|
122
|
+
* before anything else is touched.
|
|
123
|
+
*/
|
|
124
|
+
export declare function computeRemoteState(options: ComputeRemoteStateOptions): Promise<OmoRemoteState>;
|
|
125
|
+
/** exported for tests only */
|
|
126
|
+
export declare function omoLocalUpdateLockPath(agentDir: string): string;
|
|
127
|
+
/** exported for tests only */
|
|
128
|
+
export declare function omoLocalUpdateBuildWorktreePath(agentDir: string): string;
|
|
129
|
+
/** exported for tests only */
|
|
130
|
+
export interface EnsureBuildWorktreeOptions {
|
|
131
|
+
/** Feature-owned persistent worktree path (inside agentDir). */
|
|
132
|
+
worktree: string;
|
|
133
|
+
repoRoot: string;
|
|
134
|
+
/** Frozen origin/dev sha to check out detached. */
|
|
135
|
+
sha: string;
|
|
136
|
+
run: OmoLocalRun;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* exported for tests only
|
|
140
|
+
*
|
|
141
|
+
* Validate/reuse the FEATURE-OWNED persistent build worktree:
|
|
142
|
+
* - present AND owned by this repo (`git -C <wt> rev-parse --git-common-dir` realpath-equals
|
|
143
|
+
* realpath(repoRoot/.git)) -> reuse: `git -C <wt> checkout --detach --force <sha>`. The
|
|
144
|
+
* --force is SAFE here: this worktree is exclusively feature-owned, so it only discards
|
|
145
|
+
* our own previous build outputs, and untracked node_modules survives for incremental
|
|
146
|
+
* installs.
|
|
147
|
+
* - present but foreign/invalid -> `git -C repoRoot worktree remove --force <wt>` (fs rm
|
|
148
|
+
* fallback), then re-add.
|
|
149
|
+
* - absent -> `git -C repoRoot worktree add --detach <wt> <sha>`.
|
|
150
|
+
* These are the ONLY git mutations in the module besides `git fetch`, and they touch only
|
|
151
|
+
* the feature-owned worktree registration - never the user's checkout state.
|
|
152
|
+
*/
|
|
153
|
+
export declare function ensureBuildWorktree(options: EnsureBuildWorktreeOptions): Promise<void>;
|
|
154
|
+
/** exported for tests only: injectable fs seam for the atomic swap. */
|
|
155
|
+
export interface OmoLocalFsSeam {
|
|
156
|
+
cpSync: (source: string, destination: string) => void;
|
|
157
|
+
renameSync: (oldPath: string, newPath: string) => void;
|
|
158
|
+
rmSync: (path: string) => void;
|
|
159
|
+
}
|
|
160
|
+
/** exported for tests only */
|
|
161
|
+
export interface SwapPluginDirOptions {
|
|
162
|
+
pluginPath: string;
|
|
163
|
+
/** The freshly built plugin dir inside the build worktree. */
|
|
164
|
+
sourceDir: string;
|
|
165
|
+
fs?: OmoLocalFsSeam;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* exported for tests only
|
|
169
|
+
*
|
|
170
|
+
* ATOMIC SWAP of the install target. staging/prev are siblings of pluginPath (same parent
|
|
171
|
+
* => same filesystem => atomic renames): copy the built tree to staging, move pluginPath
|
|
172
|
+
* aside to prev, move staging into place. If the staging rename fails, prev is restored
|
|
173
|
+
* and staging removed before the error propagates - the local install is never left
|
|
174
|
+
* half-swapped. On success prev is removed.
|
|
175
|
+
*/
|
|
176
|
+
export declare function swapPluginDir(options: SwapPluginDirOptions): void;
|
|
177
|
+
export interface RunOmoLocalUpdateBetaOptions {
|
|
178
|
+
env: Record<string, string | undefined>;
|
|
179
|
+
agentDir: string;
|
|
180
|
+
settings?: {
|
|
181
|
+
packages?: PackageSource[];
|
|
182
|
+
};
|
|
183
|
+
force?: boolean;
|
|
184
|
+
log?: (message: string) => void;
|
|
185
|
+
run?: OmoLocalRun;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Beta hook entry point, called from bare `senpi update` before the self-update.
|
|
189
|
+
*
|
|
190
|
+
* SINGLE owner of the ORDERED state machine: gate chain (kill-switch -> detection) ->
|
|
191
|
+
* atomic lock acquisition (held through fetch, worktree, build, swap, stamp AND notify;
|
|
192
|
+
* owner-checked unlink in `finally`) -> computeRemoteState (ONE read-only fetch + frozen
|
|
193
|
+
* rev-parse reads of origin/dev) -> skip decision BEFORE any worktree op, install, or
|
|
194
|
+
* write -> ensureBuildWorktree (feature-owned persistent worktree, reuse-or-recreate) ->
|
|
195
|
+
* `bun install` (600s, cwd = build worktree) -> `bun run build:senpi-plugin` (900s, cwd =
|
|
196
|
+
* build worktree) -> completeness check in the WORKTREE plugin dir -> atomic swap of the
|
|
197
|
+
* install target -> writeStamp (inventory from the NEW plugin dir) -> notify (green line
|
|
198
|
+
* + dim per-package tree comparison when an old stamp existed).
|
|
199
|
+
*
|
|
200
|
+
* HARD GUARANTEES: the user's checkout receives ZERO git mutations (no
|
|
201
|
+
* checkout/branch/commit/merge/reset/clean/stash/push anywhere; only `git fetch` and
|
|
202
|
+
* feature-owned worktree add/remove). Only pluginPath content is replaced. This hook NEVER
|
|
203
|
+
* throws and NEVER sets process.exitCode: every failure downgrades to a yellow warning +
|
|
204
|
+
* dim manual hint so the senpi self-update continues untouched.
|
|
205
|
+
*/
|
|
206
|
+
export declare function runOmoLocalUpdateBeta(options: RunOmoLocalUpdateBetaOptions): Promise<void>;
|
|
207
|
+
//# sourceMappingURL=omo-local-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omo-local-update.d.ts","sourceRoot":"","sources":["../../src/beta/omo-local-update.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAKjE,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM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