chore: checkpoint workspace changes
This commit is contained in:
parent
6612456934
commit
e5d655bdb3
474 changed files with 7263 additions and 1067 deletions
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
PRs without a linked issue will be closed.
|
PRs without a linked issue will be closed.
|
||||||
Open or find an issue first: https://github.com/gsd-build/gsd-2/issues
|
Open or find an issue first: https://github.com/singularity-forge/sf-run/issues
|
||||||
-->
|
-->
|
||||||
|
|
||||||
Closes #<!-- issue number — required -->
|
Closes #<!-- issue number — required -->
|
||||||
|
|
|
||||||
20
.github/workflows/pipeline.yml
vendored
20
.github/workflows/pipeline.yml
vendored
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/gsd-build/gsd-ci-builder:latest
|
image: ghcr.io/singularity-forge/sf-ci-builder:latest
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
@ -146,11 +146,11 @@ jobs:
|
||||||
DEV_VERSION: ${{ needs.dev-publish.outputs.dev-version }}
|
DEV_VERSION: ${{ needs.dev-publish.outputs.dev-version }}
|
||||||
run: |
|
run: |
|
||||||
docker build --target runtime \
|
docker build --target runtime \
|
||||||
-t "ghcr.io/gsd-build/gsd-pi:next" \
|
-t "ghcr.io/singularity-forge/sf-run:next" \
|
||||||
-t "ghcr.io/gsd-build/gsd-pi:${DEV_VERSION}" \
|
-t "ghcr.io/singularity-forge/sf-run:${DEV_VERSION}" \
|
||||||
.
|
.
|
||||||
docker push ghcr.io/gsd-build/gsd-pi:next
|
docker push ghcr.io/singularity-forge/sf-run:next
|
||||||
docker push "ghcr.io/gsd-build/gsd-pi:${DEV_VERSION}"
|
docker push "ghcr.io/singularity-forge/sf-run:${DEV_VERSION}"
|
||||||
|
|
||||||
prod-release:
|
prod-release:
|
||||||
name: Production Release
|
name: Production Release
|
||||||
|
|
@ -281,9 +281,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
DEV_VERSION: ${{ needs.dev-publish.outputs.dev-version }}
|
DEV_VERSION: ${{ needs.dev-publish.outputs.dev-version }}
|
||||||
run: |
|
run: |
|
||||||
docker pull "ghcr.io/gsd-build/gsd-pi:${DEV_VERSION}"
|
docker pull "ghcr.io/singularity-forge/sf-run:${DEV_VERSION}"
|
||||||
docker tag "ghcr.io/gsd-build/gsd-pi:${DEV_VERSION}" ghcr.io/gsd-build/gsd-pi:latest
|
docker tag "ghcr.io/singularity-forge/sf-run:${DEV_VERSION}" ghcr.io/singularity-forge/sf-run:latest
|
||||||
docker push ghcr.io/gsd-build/gsd-pi:latest
|
docker push ghcr.io/singularity-forge/sf-run:latest
|
||||||
|
|
||||||
update-builder:
|
update-builder:
|
||||||
name: Update CI Builder Image
|
name: Update CI Builder Image
|
||||||
|
|
@ -314,6 +314,6 @@ jobs:
|
||||||
if: steps.check.outputs.changed == 'true'
|
if: steps.check.outputs.changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
docker build --target builder \
|
docker build --target builder \
|
||||||
-t ghcr.io/gsd-build/gsd-ci-builder:latest \
|
-t ghcr.io/singularity-forge/sf-ci-builder:latest \
|
||||||
.
|
.
|
||||||
docker push ghcr.io/gsd-build/gsd-ci-builder:latest
|
docker push ghcr.io/singularity-forge/sf-ci-builder:latest
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Issue #672: Parallel Milestone Orchestration
|
# Issue #672: Parallel Milestone Orchestration
|
||||||
|
|
||||||
**Issue:** https://github.com/gsd-build/gsd-2/issues/672
|
**Issue:** https://github.com/singularity-forge/sf-run/issues/672
|
||||||
**Contributor:** @deseltrus (7 merged PRs, proven contributor)
|
**Contributor:** @deseltrus (7 merged PRs, proven contributor)
|
||||||
**Status:** WIP — foundation modules built, orchestrator core in progress
|
**Status:** WIP — foundation modules built, orchestrator core in progress
|
||||||
**Default:** `parallel.enabled: false` — opt-in, zero impact to existing users
|
**Default:** `parallel.enabled: false` — opt-in, zero impact to existing users
|
||||||
|
|
|
||||||
|
|
@ -777,8 +777,8 @@ Use expensive models where quality matters (planning, complex execution) and che
|
||||||
|
|
||||||
## Star History
|
## Star History
|
||||||
|
|
||||||
<a href="https://star-history.com/#gsd-build/gsd-2&Date">
|
<a href="https://star-history.com/#singularity-forge/sf-run&Date">
|
||||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=gsd-build/gsd-2&type=Date" />
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=singularity-forge/sf-run&type=Date" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
**Date:** 2026-03-26
|
**Date:** 2026-03-26
|
||||||
**Revised:** 2026-04-03
|
**Revised:** 2026-04-03
|
||||||
**Deciders:** Jeremy McSpadden
|
**Deciders:** Jeremy McSpadden
|
||||||
**Related:** ADR-003 (pipeline simplification), [Issue #2655](https://github.com/gsd-build/gsd-2/issues/2655), `docs/dynamic-model-routing.md`
|
**Related:** ADR-003 (pipeline simplification), [Issue #2655](https://github.com/singularity-forge/sf-run/issues/2655), `docs/dynamic-model-routing.md`
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
**Status:** Accepted
|
**Status:** Accepted
|
||||||
**Date:** 2026-03-27
|
**Date:** 2026-03-27
|
||||||
**Deciders:** Jeremy McSpadden
|
**Deciders:** Jeremy McSpadden
|
||||||
**Related:** ADR-004 (capability-aware model routing), ADR-003 (pipeline simplification), [Issue #2790](https://github.com/gsd-build/gsd-2/issues/2790)
|
**Related:** ADR-004 (capability-aware model routing), ADR-003 (pipeline simplification), [Issue #2790](https://github.com/singularity-forge/sf-run/issues/2790)
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
**Status:** Proposed
|
**Status:** Proposed
|
||||||
**Date:** 2026-04-03
|
**Date:** 2026-04-03
|
||||||
**Deciders:** Jeremy McSpadden
|
**Deciders:** Jeremy McSpadden
|
||||||
**Related:** ADR-004 (capability-aware model routing), [ADR-005](https://github.com/gsd-build/gsd-2/issues/2790), [ADR-006](https://github.com/gsd-build/gsd-2/issues/2995), `packages/pi-ai/src/providers/`, `packages/pi-ai/src/models.ts`
|
**Related:** ADR-004 (capability-aware model routing), [ADR-005](https://github.com/singularity-forge/sf-run/issues/2790), [ADR-006](https://github.com/singularity-forge/sf-run/issues/2995), `packages/pi-ai/src/providers/`, `packages/pi-ai/src/models.ts`
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,10 +42,10 @@ npx gsd-pi@latest # or just: npx gsd-pi
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Test candidate
|
# Test candidate
|
||||||
docker run --rm -v $(pwd):/workspace ghcr.io/gsd-build/gsd-pi:next --version
|
docker run --rm -v $(pwd):/workspace ghcr.io/singularity-forge/sf-run:next --version
|
||||||
|
|
||||||
# Stable
|
# Stable
|
||||||
docker run --rm -v $(pwd):/workspace ghcr.io/gsd-build/gsd-pi:latest --version
|
docker run --rm -v $(pwd):/workspace ghcr.io/singularity-forge/sf-run:latest --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Checking if a Fix Landed
|
### Checking if a Fix Landed
|
||||||
|
|
@ -129,9 +129,9 @@ If a broken version reaches production:
|
||||||
npm dist-tag add gsd-pi@<previous-good-version> latest
|
npm dist-tag add gsd-pi@<previous-good-version> latest
|
||||||
|
|
||||||
# Roll back Docker
|
# Roll back Docker
|
||||||
docker pull ghcr.io/gsd-build/gsd-pi:<previous-good-version>
|
docker pull ghcr.io/singularity-forge/sf-run:<previous-good-version>
|
||||||
docker tag ghcr.io/gsd-build/gsd-pi:<previous-good-version> ghcr.io/gsd-build/gsd-pi:latest
|
docker tag ghcr.io/singularity-forge/sf-run:<previous-good-version> ghcr.io/singularity-forge/sf-run:latest
|
||||||
docker push ghcr.io/gsd-build/gsd-pi:latest
|
docker push ghcr.io/singularity-forge/sf-run:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
For `@dev` or `@next` rollbacks, the next successful merge will overwrite the tag automatically.
|
For `@dev` or `@next` rollbacks, the next successful merge will overwrite the tag automatically.
|
||||||
|
|
@ -153,8 +153,8 @@ For `@dev` or `@next` rollbacks, the next successful merge will overwrite the ta
|
||||||
|
|
||||||
| Image | Base | Purpose | Tags |
|
| Image | Base | Purpose | Tags |
|
||||||
|-------|------|---------|------|
|
|-------|------|---------|------|
|
||||||
| `ghcr.io/gsd-build/gsd-ci-builder` | `node:24-bookworm` | CI build environment with Rust toolchain | `:latest`, `:<date>` |
|
| `ghcr.io/singularity-forge/sf-ci-builder` | `node:24-bookworm` | CI build environment with Rust toolchain | `:latest`, `:<date>` |
|
||||||
| `ghcr.io/gsd-build/gsd-pi` | `node:24-slim` | User-facing runtime | `:latest`, `:next`, `:v<version>` |
|
| `ghcr.io/singularity-forge/sf-run` | `node:24-slim` | User-facing runtime | `:latest`, `:next`, `:v<version>` |
|
||||||
|
|
||||||
The CI builder image is rebuilt automatically when the `Dockerfile` changes. It eliminates ~3-5 min of toolchain setup per CI run.
|
The CI builder image is rebuilt automatically when the `Dockerfile` changes. It eliminates ~3-5 min of toolchain setup per CI run.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Browser-Tools Feature Additions — Implementation Requirements
|
# Browser-Tools Feature Additions — Implementation Requirements
|
||||||
|
|
||||||
> Ref: [#698](https://github.com/gsd-build/gsd-2/issues/698)
|
> Ref: [#698](https://github.com/singularity-forge/sf-run/issues/698)
|
||||||
> Status: **Shipped** — all 10 features implemented and merged to main
|
> Status: **Shipped** — all 10 features implemented and merged to main
|
||||||
|
|
||||||
## Current State
|
## Current State
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ git commit -m "feat(ci): add version stamp script for dev publishes"
|
||||||
```dockerfile
|
```dockerfile
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
# Stage 1: CI Builder
|
# Stage 1: CI Builder
|
||||||
# Image: ghcr.io/gsd-build/gsd-ci-builder
|
# Image: ghcr.io/singularity-forge/sf-ci-builder
|
||||||
# Used by: pipeline.yml Dev stage
|
# Used by: pipeline.yml Dev stage
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
FROM node:22-bookworm AS builder
|
FROM node:22-bookworm AS builder
|
||||||
|
|
@ -124,7 +124,7 @@ RUN node --version && rustc --version && cargo --version
|
||||||
|
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
# Stage 2: Runtime
|
# Stage 2: Runtime
|
||||||
# Image: ghcr.io/gsd-build/gsd-pi
|
# Image: ghcr.io/singularity-forge/sf-run
|
||||||
# Used by: end users via docker run
|
# Used by: end users via docker run
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
FROM node:22-slim AS runtime
|
FROM node:22-slim AS runtime
|
||||||
|
|
@ -947,8 +947,8 @@ Add to `package.json` `scripts`:
|
||||||
"test:fixtures:record": "GSD_FIXTURE_MODE=record node --experimental-strip-types tests/fixtures/record.ts",
|
"test:fixtures:record": "GSD_FIXTURE_MODE=record node --experimental-strip-types tests/fixtures/record.ts",
|
||||||
"test:live": "GSD_LIVE_TESTS=1 node --experimental-strip-types tests/live/run.ts",
|
"test:live": "GSD_LIVE_TESTS=1 node --experimental-strip-types tests/live/run.ts",
|
||||||
"pipeline:version-stamp": "node scripts/version-stamp.mjs",
|
"pipeline:version-stamp": "node scripts/version-stamp.mjs",
|
||||||
"docker:build-runtime": "docker build --target runtime -t ghcr.io/gsd-build/gsd-pi .",
|
"docker:build-runtime": "docker build --target runtime -t ghcr.io/singularity-forge/sf-run .",
|
||||||
"docker:build-builder": "docker build --target builder -t ghcr.io/gsd-build/gsd-ci-builder ."
|
"docker:build-builder": "docker build --target builder -t ghcr.io/singularity-forge/sf-ci-builder ."
|
||||||
```
|
```
|
||||||
|
|
||||||
- [ ] **Step 5: Verify live tests skip without env var**
|
- [ ] **Step 5: Verify live tests skip without env var**
|
||||||
|
|
@ -997,7 +997,7 @@ jobs:
|
||||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/gsd-build/gsd-ci-builder:latest # Pin to date tag after first build
|
image: ghcr.io/singularity-forge/sf-ci-builder:latest # Pin to date tag after first build
|
||||||
environment: dev
|
environment: dev
|
||||||
outputs:
|
outputs:
|
||||||
dev-version: ${{ steps.stamp.outputs.version }}
|
dev-version: ${{ steps.stamp.outputs.version }}
|
||||||
|
|
@ -1082,11 +1082,11 @@ jobs:
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
docker build --target runtime \
|
docker build --target runtime \
|
||||||
--build-arg GSD_VERSION=${{ needs.dev-publish.outputs.dev-version }} \
|
--build-arg GSD_VERSION=${{ needs.dev-publish.outputs.dev-version }} \
|
||||||
-t ghcr.io/gsd-build/gsd-pi:next \
|
-t ghcr.io/singularity-forge/sf-run:next \
|
||||||
-t ghcr.io/gsd-build/gsd-pi:${{ needs.dev-publish.outputs.dev-version }} \
|
-t ghcr.io/singularity-forge/sf-run:${{ needs.dev-publish.outputs.dev-version }} \
|
||||||
.
|
.
|
||||||
docker push ghcr.io/gsd-build/gsd-pi:next
|
docker push ghcr.io/singularity-forge/sf-run:next
|
||||||
docker push ghcr.io/gsd-build/gsd-pi:${{ needs.dev-publish.outputs.dev-version }}
|
docker push ghcr.io/singularity-forge/sf-run:${{ needs.dev-publish.outputs.dev-version }}
|
||||||
|
|
||||||
# ─── PROD STAGE ────────────────────────────────────────────
|
# ─── PROD STAGE ────────────────────────────────────────────
|
||||||
prod-release:
|
prod-release:
|
||||||
|
|
@ -1124,9 +1124,9 @@ jobs:
|
||||||
- name: Tag and push Docker images
|
- name: Tag and push Docker images
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
docker pull ghcr.io/gsd-build/gsd-pi:${{ needs.dev-publish.outputs.dev-version }}
|
docker pull ghcr.io/singularity-forge/sf-run:${{ needs.dev-publish.outputs.dev-version }}
|
||||||
docker tag ghcr.io/gsd-build/gsd-pi:${{ needs.dev-publish.outputs.dev-version }} ghcr.io/gsd-build/gsd-pi:latest
|
docker tag ghcr.io/singularity-forge/sf-run:${{ needs.dev-publish.outputs.dev-version }} ghcr.io/singularity-forge/sf-run:latest
|
||||||
docker push ghcr.io/gsd-build/gsd-pi:latest
|
docker push ghcr.io/singularity-forge/sf-run:latest
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -1164,16 +1164,16 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
docker build --target builder \
|
docker build --target builder \
|
||||||
-t ghcr.io/gsd-build/gsd-ci-builder:latest \
|
-t ghcr.io/singularity-forge/sf-ci-builder:latest \
|
||||||
-t ghcr.io/gsd-build/gsd-ci-builder:${{ steps.tag.outputs.date }} \
|
-t ghcr.io/singularity-forge/sf-ci-builder:${{ steps.tag.outputs.date }} \
|
||||||
.
|
.
|
||||||
docker push ghcr.io/gsd-build/gsd-ci-builder:latest
|
docker push ghcr.io/singularity-forge/sf-ci-builder:latest
|
||||||
docker push ghcr.io/gsd-build/gsd-ci-builder:${{ steps.tag.outputs.date }}
|
docker push ghcr.io/singularity-forge/sf-ci-builder:${{ steps.tag.outputs.date }}
|
||||||
|
|
||||||
- name: Verify builder image
|
- name: Verify builder image
|
||||||
run: |
|
run: |
|
||||||
docker run --rm ghcr.io/gsd-build/gsd-ci-builder:latest node --version
|
docker run --rm ghcr.io/singularity-forge/sf-ci-builder:latest node --version
|
||||||
docker run --rm ghcr.io/gsd-build/gsd-ci-builder:latest rustc --version
|
docker run --rm ghcr.io/singularity-forge/sf-ci-builder:latest rustc --version
|
||||||
```
|
```
|
||||||
|
|
||||||
- [ ] **Step 2: Validate YAML syntax**
|
- [ ] **Step 2: Validate YAML syntax**
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ Policy:
|
||||||
|---------|--------|----------|
|
|---------|--------|----------|
|
||||||
| Dev publish succeeds, smoke test fails | Broken version on `@dev` tag | Next successful merge overwrites `@dev`. Manual fix: `npm dist-tag add gsd-pi@<last-good> dev` |
|
| Dev publish succeeds, smoke test fails | Broken version on `@dev` tag | Next successful merge overwrites `@dev`. Manual fix: `npm dist-tag add gsd-pi@<last-good> dev` |
|
||||||
| Test stage fails after promoting to `@next` | Broken version on `@next` tag | Manual: `npm dist-tag add gsd-pi@<last-good> next`. `@latest` is never affected. |
|
| Test stage fails after promoting to `@next` | Broken version on `@next` tag | Manual: `npm dist-tag add gsd-pi@<last-good> next`. `@latest` is never affected. |
|
||||||
| Prod promotion publishes `@latest` then found broken | Broken production release | Manual: `npm dist-tag add gsd-pi@<previous-stable> latest` and `docker tag ghcr.io/gsd-build/gsd-pi:<previous> latest && docker push`. Post-mortem required. |
|
| Prod promotion publishes `@latest` then found broken | Broken production release | Manual: `npm dist-tag add gsd-pi@<previous-stable> latest` and `docker tag ghcr.io/singularity-forge/sf-run:<previous> latest && docker push`. Post-mortem required. |
|
||||||
| Docker push succeeds, npm dist-tag fails | Images and npm out of sync | Re-run the failed job (GitHub Actions retry). Images are tagged by version so stale tags are harmless. |
|
| Docker push succeeds, npm dist-tag fails | Images and npm out of sync | Re-run the failed job (GitHub Actions retry). Images are tagged by version so stale tags are harmless. |
|
||||||
| GHCR push fails | No Docker image for this version | Non-blocking — npm publish is the primary distribution. Docker image can be rebuilt manually. |
|
| GHCR push fails | No Docker image for this version | Non-blocking — npm publish is the primary distribution. Docker image can be rebuilt manually. |
|
||||||
|
|
||||||
|
|
@ -131,7 +131,7 @@ Two images from a single `Dockerfile` at the repo root.
|
||||||
|
|
||||||
#### CI Builder Image
|
#### CI Builder Image
|
||||||
|
|
||||||
- **Name:** `ghcr.io/gsd-build/gsd-ci-builder`
|
- **Name:** `ghcr.io/singularity-forge/sf-ci-builder`
|
||||||
- **Base:** `node:22-bookworm`
|
- **Base:** `node:22-bookworm`
|
||||||
- **Contains:** Node 22, Rust stable toolchain, `aarch64-linux-gnu` cross-compiler
|
- **Contains:** Node 22, Rust stable toolchain, `aarch64-linux-gnu` cross-compiler
|
||||||
- **Size:** ~2 GB
|
- **Size:** ~2 GB
|
||||||
|
|
@ -148,13 +148,13 @@ Builder images are tagged with both `:latest` and a date stamp (e.g., `:2026-03-
|
||||||
|
|
||||||
#### Runtime Image
|
#### Runtime Image
|
||||||
|
|
||||||
- **Name:** `ghcr.io/gsd-build/gsd-pi`
|
- **Name:** `ghcr.io/singularity-forge/sf-run`
|
||||||
- **Base:** `node:22-slim`
|
- **Base:** `node:22-slim`
|
||||||
- **Contains:** Node 22, git, `gsd-pi` installed globally
|
- **Contains:** Node 22, git, `gsd-pi` installed globally
|
||||||
- **Size:** ~250 MB
|
- **Size:** ~250 MB
|
||||||
- **Tags:** `:latest`, `:next`, `:v2.27.0`
|
- **Tags:** `:latest`, `:next`, `:v2.27.0`
|
||||||
- **Published:** On every Prod promotion
|
- **Published:** On every Prod promotion
|
||||||
- **Purpose:** `docker run ghcr.io/gsd-build/gsd-pi` as alternative to `npx`
|
- **Purpose:** `docker run ghcr.io/singularity-forge/sf-run` as alternative to `npx`
|
||||||
|
|
||||||
### Why These Base Images
|
### Why These Base Images
|
||||||
|
|
||||||
|
|
@ -329,8 +329,8 @@ All test files use `.ts` with `--experimental-strip-types` for consistency with
|
||||||
"test:fixtures:record": "GSD_FIXTURE_MODE=record node --experimental-strip-types tests/fixtures/record.ts",
|
"test:fixtures:record": "GSD_FIXTURE_MODE=record node --experimental-strip-types tests/fixtures/record.ts",
|
||||||
"test:live": "GSD_LIVE_TESTS=1 node --experimental-strip-types tests/live/run.ts",
|
"test:live": "GSD_LIVE_TESTS=1 node --experimental-strip-types tests/live/run.ts",
|
||||||
"pipeline:version-stamp": "node scripts/version-stamp.mjs",
|
"pipeline:version-stamp": "node scripts/version-stamp.mjs",
|
||||||
"docker:build-runtime": "docker build --target runtime -t ghcr.io/gsd-build/gsd-pi .",
|
"docker:build-runtime": "docker build --target runtime -t ghcr.io/singularity-forge/sf-run .",
|
||||||
"docker:build-builder": "docker build --target builder -t ghcr.io/gsd-build/gsd-ci-builder ."
|
"docker:build-builder": "docker build --target builder -t ghcr.io/singularity-forge/sf-ci-builder ."
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -352,6 +352,6 @@ All test files use `.ts` with `--experimental-strip-types` for consistency with
|
||||||
2. Fixture replay tests complete in under 60 seconds with zero API calls
|
2. Fixture replay tests complete in under 60 seconds with zero API calls
|
||||||
3. The full Dev → Test promotion completes without human intervention
|
3. The full Dev → Test promotion completes without human intervention
|
||||||
4. Prod promotion is blocked until a maintainer explicitly approves
|
4. Prod promotion is blocked until a maintainer explicitly approves
|
||||||
5. `docker run ghcr.io/gsd-build/gsd-pi --version` returns the correct version
|
5. `docker run ghcr.io/singularity-forge/sf-run --version` returns the correct version
|
||||||
6. Existing `ci.yml` and `build-native.yml` workflows continue to work unchanged
|
6. Existing `ci.yml` and `build-native.yml` workflows continue to work unchanged
|
||||||
7. CI builder image reduces toolchain setup from ~3-5 min to ~30s pull
|
7. CI builder image reduces toolchain setup from ~3-5 min to ~30s pull
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ Run GSD in an isolated sandbox without installing Node.js on your host.
|
||||||
**Step 2 — Clone the GSD repo:**
|
**Step 2 — Clone the GSD repo:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/gsd-build/gsd-2.git
|
git clone https://github.com/singularity-forge/sf-run.git
|
||||||
cd gsd-2/docker
|
cd gsd-2/docker
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ gsd --version # 输出已安装版本
|
||||||
**第 2 步:克隆 GSD 仓库:**
|
**第 2 步:克隆 GSD 仓库:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/gsd-build/gsd-2.git
|
git clone https://github.com/singularity-forge/sf-run.git
|
||||||
cd gsd-2/docker
|
cd gsd-2/docker
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
35
flake.nix
Normal file
35
flake.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
description = "Minimal runtime shell for gsd-2";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
packages = with pkgs; [
|
||||||
|
bash
|
||||||
|
bun
|
||||||
|
git
|
||||||
|
nodejs_24
|
||||||
|
];
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
export GSD_SOURCE_DIR="${toString ./.}"
|
||||||
|
export PATH="$GSD_SOURCE_DIR/bin:$PATH"
|
||||||
|
|
||||||
|
echo "gsd-2 runtime shell"
|
||||||
|
echo " bun : $(command -v bun)"
|
||||||
|
echo " node: $(command -v node)"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
"links": [
|
"links": [
|
||||||
{
|
{
|
||||||
"label": "GitHub",
|
"label": "GitHub",
|
||||||
"href": "https://github.com/gsd-build/gsd-2"
|
"href": "https://github.com/singularity-forge/sf-run"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primary": {
|
"primary": {
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"socials": {
|
"socials": {
|
||||||
"github": "https://github.com/gsd-build/gsd-2"
|
"github": "https://github.com/singularity-forge/sf-run"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"navigation": {
|
"navigation": {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd-build/engine-darwin-arm64",
|
"name": "@singularity-forge/engine-darwin-arm64",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "GSD native engine binary for macOS ARM64",
|
"description": "GSD native engine binary for macOS ARM64",
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -15,6 +15,6 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/gsd-build/gsd-2.git"
|
"url": "git+https://github.com/singularity-forge/sf-run.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd-build/engine-darwin-x64",
|
"name": "@singularity-forge/engine-darwin-x64",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "GSD native engine binary for macOS Intel",
|
"description": "GSD native engine binary for macOS Intel",
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -15,6 +15,6 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/gsd-build/gsd-2.git"
|
"url": "git+https://github.com/singularity-forge/sf-run.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd-build/engine-linux-arm64-gnu",
|
"name": "@singularity-forge/engine-linux-arm64-gnu",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "GSD native engine binary for Linux ARM64 (glibc)",
|
"description": "GSD native engine binary for Linux ARM64 (glibc)",
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -15,6 +15,6 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/gsd-build/gsd-2.git"
|
"url": "git+https://github.com/singularity-forge/sf-run.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd-build/engine-linux-x64-gnu",
|
"name": "@singularity-forge/engine-linux-x64-gnu",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "GSD native engine binary for Linux x64 (glibc)",
|
"description": "GSD native engine binary for Linux x64 (glibc)",
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -15,6 +15,6 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/gsd-build/gsd-2.git"
|
"url": "git+https://github.com/singularity-forge/sf-run.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd-build/engine-win32-x64-msvc",
|
"name": "@singularity-forge/engine-win32-x64-msvc",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "GSD native engine binary for Windows x64 (MSVC)",
|
"description": "GSD native engine binary for Windows x64 (MSVC)",
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -15,6 +15,6 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/gsd-build/gsd-2.git"
|
"url": "git+https://github.com/singularity-forge/sf-run.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
54
package.json
54
package.json
|
|
@ -1,15 +1,15 @@
|
||||||
{
|
{
|
||||||
"name": "gsd-pi",
|
"name": "sf-run",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "GSD — Get Shit Done coding agent",
|
"description": "sf-run — Singularity Forge runtime core",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/gsd-build/gsd-2.git"
|
"url": "https://github.com/singularity-forge/sf-run.git"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/gsd-build/gsd-2#readme",
|
"homepage": "https://github.com/singularity-forge/sf-run#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/gsd-build/gsd-2/issues"
|
"url": "https://github.com/singularity-forge/sf-run/issues"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
|
@ -17,8 +17,8 @@
|
||||||
"studio"
|
"studio"
|
||||||
],
|
],
|
||||||
"bin": {
|
"bin": {
|
||||||
"gsd": "dist/loader.js",
|
"sf": "dist/loader.js",
|
||||||
"gsd-cli": "dist/loader.js"
|
"sf-cli": "dist/loader.js"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
|
|
@ -33,22 +33,22 @@
|
||||||
"README.md"
|
"README.md"
|
||||||
],
|
],
|
||||||
"piConfig": {
|
"piConfig": {
|
||||||
"name": "gsd",
|
"name": "sf",
|
||||||
"configDir": ".gsd"
|
"configDir": ".sf"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.0.0"
|
"node": ">=22.0.0"
|
||||||
},
|
},
|
||||||
"packageManager": "npm@10.9.3",
|
"packageManager": "npm@10.9.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:pi-tui": "npm run build -w @gsd/pi-tui",
|
"build:pi-tui": "npm run build -w @sf-run/pi-tui",
|
||||||
"build:pi-ai": "npm run build -w @gsd/pi-ai",
|
"build:pi-ai": "npm run build -w @sf-run/pi-ai",
|
||||||
"build:pi-agent-core": "npm run build -w @gsd/pi-agent-core",
|
"build:pi-agent-core": "npm run build -w @sf-run/pi-agent-core",
|
||||||
"build:pi-coding-agent": "npm run build -w @gsd/pi-coding-agent",
|
"build:pi-coding-agent": "npm run build -w @sf-run/pi-coding-agent",
|
||||||
"build:native-pkg": "npm run build -w @gsd/native",
|
"build:native-pkg": "npm run build -w @sf-run/native",
|
||||||
"build:rpc-client": "npm run build -w @gsd-build/rpc-client",
|
"build:rpc-client": "npm run build -w @singularity-forge/rpc-client",
|
||||||
"build:pi": "npm run build:native-pkg && npm run build:pi-tui && npm run build:pi-ai && npm run build:pi-agent-core && npm run build:pi-coding-agent",
|
"build:pi": "npm run build:native-pkg && npm run build:pi-tui && npm run build:pi-ai && npm run build:pi-agent-core && npm run build:pi-coding-agent",
|
||||||
"build:mcp-server": "npm run build -w @gsd-build/mcp-server",
|
"build:mcp-server": "npm run build -w @singularity-forge/mcp-server",
|
||||||
"build:core": "npm run build:pi && npm run build:rpc-client && npm run build:mcp-server && tsc && npm run copy-resources && npm run copy-themes && npm run copy-export-html",
|
"build:core": "npm run build:pi && npm run build:rpc-client && npm run build:mcp-server && tsc && npm run copy-resources && npm run copy-themes && npm run copy-export-html",
|
||||||
"build": "npm run build:core && node scripts/build-web-if-stale.cjs",
|
"build": "npm run build:core && node scripts/build-web-if-stale.cjs",
|
||||||
"stage:web-host": "node scripts/stage-web-standalone.cjs",
|
"stage:web-host": "node scripts/stage-web-standalone.cjs",
|
||||||
|
|
@ -76,10 +76,10 @@
|
||||||
"build:native": "node native/scripts/build.js",
|
"build:native": "node native/scripts/build.js",
|
||||||
"build:native:dev": "node native/scripts/build.js --dev",
|
"build:native:dev": "node native/scripts/build.js --dev",
|
||||||
"dev": "node scripts/dev.js",
|
"dev": "node scripts/dev.js",
|
||||||
"gsd": "node scripts/dev-cli.js",
|
"sf": "node scripts/dev-cli.js",
|
||||||
"gsd:web": "npm run build:pi && npm run copy-resources && node scripts/build-web-if-stale.cjs && node scripts/dev-cli.js --web",
|
"sf:web": "npm run build:pi && npm run copy-resources && node scripts/build-web-if-stale.cjs && node scripts/dev-cli.js --web",
|
||||||
"gsd:web:stop": "node scripts/dev-cli.js web stop",
|
"sf:web:stop": "node scripts/dev-cli.js web stop",
|
||||||
"gsd:web:stop:all": "node scripts/dev-cli.js web stop all",
|
"sf:web:stop:all": "node scripts/dev-cli.js web stop all",
|
||||||
"postinstall": "node scripts/link-workspace-packages.cjs && node scripts/ensure-workspace-builds.cjs && node scripts/postinstall.js",
|
"postinstall": "node scripts/link-workspace-packages.cjs && node scripts/ensure-workspace-builds.cjs && node scripts/postinstall.js",
|
||||||
"pi:install-global": "node scripts/install-pi-global.js",
|
"pi:install-global": "node scripts/install-pi-global.js",
|
||||||
"pi:uninstall-global": "node scripts/uninstall-pi-global.js",
|
"pi:uninstall-global": "node scripts/uninstall-pi-global.js",
|
||||||
|
|
@ -91,8 +91,8 @@
|
||||||
"release:changelog": "node scripts/generate-changelog.mjs",
|
"release:changelog": "node scripts/generate-changelog.mjs",
|
||||||
"release:bump": "node scripts/bump-version.mjs",
|
"release:bump": "node scripts/bump-version.mjs",
|
||||||
"release:update-changelog": "node scripts/update-changelog.mjs",
|
"release:update-changelog": "node scripts/update-changelog.mjs",
|
||||||
"docker:build-runtime": "docker build --target runtime -t ghcr.io/gsd-build/gsd-pi .",
|
"docker:build-runtime": "docker build --target runtime -t ghcr.io/singularity-forge/sf-run .",
|
||||||
"docker:build-builder": "docker build --target builder -t ghcr.io/gsd-build/gsd-ci-builder .",
|
"docker:build-builder": "docker build --target builder -t ghcr.io/singularity-forge/sf-ci-builder .",
|
||||||
"prepublishOnly": "npm run sync-pkg-version && npm run sync-platform-versions && node scripts/prepublish-check.mjs && npm run build && npm run typecheck:extensions && npm run validate-pack",
|
"prepublishOnly": "npm run sync-pkg-version && npm run sync-platform-versions && node scripts/prepublish-check.mjs && npm run build && npm run typecheck:extensions && npm run validate-pack",
|
||||||
"test:live-regression": "node --experimental-strip-types tests/live-regression/run.ts"
|
"test:live-regression": "node --experimental-strip-types tests/live-regression/run.ts"
|
||||||
},
|
},
|
||||||
|
|
@ -145,11 +145,11 @@
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@anthropic-ai/claude-agent-sdk": "^0.2.83",
|
"@anthropic-ai/claude-agent-sdk": "^0.2.83",
|
||||||
"@gsd-build/engine-darwin-arm64": ">=2.10.2",
|
"@singularity-forge/engine-darwin-arm64": ">=2.10.2",
|
||||||
"@gsd-build/engine-darwin-x64": ">=2.10.2",
|
"@singularity-forge/engine-darwin-x64": ">=2.10.2",
|
||||||
"@gsd-build/engine-linux-arm64-gnu": ">=2.10.2",
|
"@singularity-forge/engine-linux-arm64-gnu": ">=2.10.2",
|
||||||
"@gsd-build/engine-linux-x64-gnu": ">=2.10.2",
|
"@singularity-forge/engine-linux-x64-gnu": ">=2.10.2",
|
||||||
"@gsd-build/engine-win32-x64-msvc": ">=2.10.2",
|
"@singularity-forge/engine-win32-x64-msvc": ">=2.10.2",
|
||||||
"fsevents": "~2.3.3",
|
"fsevents": "~2.3.3",
|
||||||
"koffi": "^2.9.0"
|
"koffi": "^2.9.0"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd-build/daemon",
|
"name": "@singularity-forge/daemon",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "GSD daemon — background process for project monitoring and Discord integration",
|
"description": "sf-run daemon — background process for project monitoring and Discord integration",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/gsd-build/gsd-2.git",
|
"url": "https://github.com/singularity-forge/sf-run.git",
|
||||||
"directory": "packages/daemon"
|
"directory": "packages/daemon"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"gsd-daemon": "./dist/cli.js"
|
"sf-daemon": "./dist/cli.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/sdk": "^0.52.0",
|
"@anthropic-ai/sdk": "^0.52.0",
|
||||||
"@gsd-build/rpc-client": "^2.74.0",
|
"@singularity-forge/rpc-client": "^2.74.0",
|
||||||
"discord.js": "^14.25.1",
|
"discord.js": "^14.25.1",
|
||||||
"yaml": "^2.8.0",
|
"yaml": "^2.8.0",
|
||||||
"zod": "^3.24.0"
|
"zod": "^3.24.0"
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import { EventEmitter } from 'node:events';
|
||||||
import { EventBridge } from './event-bridge.js';
|
import { EventBridge } from './event-bridge.js';
|
||||||
import type { EventBridgeOptions, BridgeClient } from './event-bridge.js';
|
import type { EventBridgeOptions, BridgeClient } from './event-bridge.js';
|
||||||
import type { PendingBlocker, ManagedSession, DaemonConfig, SessionStatus } from './types.js';
|
import type { PendingBlocker, ManagedSession, DaemonConfig, SessionStatus } from './types.js';
|
||||||
import type { SdkAgentEvent, RpcClient, RpcExtensionUIRequest } from '@gsd-build/rpc-client';
|
import type { SdkAgentEvent, RpcClient, RpcExtensionUIRequest } from '@singularity-forge/rpc-client';
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Mock factories
|
// Mock factories
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
import type { Client, Message, TextChannel, MessageComponentInteraction } from 'discord.js';
|
import type { Client, Message, TextChannel, MessageComponentInteraction } from 'discord.js';
|
||||||
import { EmbedBuilder, ComponentType } from 'discord.js';
|
import { EmbedBuilder, ComponentType } from 'discord.js';
|
||||||
import type { SdkAgentEvent } from '@gsd-build/rpc-client';
|
import type { SdkAgentEvent } from '@singularity-forge/rpc-client';
|
||||||
import type { Logger } from './logger.js';
|
import type { Logger } from './logger.js';
|
||||||
import type { DaemonConfig, PendingBlocker } from './types.js';
|
import type { DaemonConfig, PendingBlocker } from './types.js';
|
||||||
import type { SessionManager } from './session-manager.js';
|
import type { SessionManager } from './session-manager.js';
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { describe, it } from 'node:test';
|
import { describe, it } from 'node:test';
|
||||||
import assert from 'node:assert/strict';
|
import assert from 'node:assert/strict';
|
||||||
import { EmbedBuilder, ActionRowBuilder, ButtonBuilder } from 'discord.js';
|
import { EmbedBuilder, ActionRowBuilder, ButtonBuilder } from 'discord.js';
|
||||||
import type { SdkAgentEvent } from '@gsd-build/rpc-client';
|
import type { SdkAgentEvent } from '@singularity-forge/rpc-client';
|
||||||
import type { PendingBlocker, FormattedEvent } from './types.js';
|
import type { PendingBlocker, FormattedEvent } from './types.js';
|
||||||
import type { RpcExtensionUIRequest } from '@gsd-build/rpc-client';
|
import type { RpcExtensionUIRequest } from '@singularity-forge/rpc-client';
|
||||||
import {
|
import {
|
||||||
formatToolStart,
|
formatToolStart,
|
||||||
formatToolEnd,
|
formatToolEnd,
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js';
|
import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js';
|
||||||
import type { SdkAgentEvent } from '@gsd-build/rpc-client';
|
import type { SdkAgentEvent } from '@singularity-forge/rpc-client';
|
||||||
import type { RpcExtensionUIRequest } from '@gsd-build/rpc-client';
|
import type { RpcExtensionUIRequest } from '@singularity-forge/rpc-client';
|
||||||
import type { FormattedEvent, PendingBlocker } from './types.js';
|
import type { FormattedEvent, PendingBlocker } from './types.js';
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
import { execSync } from 'node:child_process';
|
import { execSync } from 'node:child_process';
|
||||||
import { basename, resolve } from 'node:path';
|
import { basename, resolve } from 'node:path';
|
||||||
import { EventEmitter } from 'node:events';
|
import { EventEmitter } from 'node:events';
|
||||||
import { RpcClient } from '@gsd-build/rpc-client';
|
import { RpcClient } from '@singularity-forge/rpc-client';
|
||||||
import type { SdkAgentEvent, RpcInitResult, RpcCostUpdateEvent, RpcExtensionUIRequest } from '@gsd-build/rpc-client';
|
import type { SdkAgentEvent, RpcInitResult, RpcCostUpdateEvent, RpcExtensionUIRequest } from '@singularity-forge/rpc-client';
|
||||||
import type {
|
import type {
|
||||||
ManagedSession,
|
ManagedSession,
|
||||||
StartSessionOptions,
|
StartSessionOptions,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { RpcClient, SdkAgentEvent, RpcExtensionUIRequest } from '@gsd-build/rpc-client';
|
import type { RpcClient, SdkAgentEvent, RpcExtensionUIRequest } from '@singularity-forge/rpc-client';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log severity levels, ordered from most to least verbose.
|
* Log severity levels, ordered from most to least verbose.
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd-build/mcp-server",
|
"name": "@singularity-forge/mcp-server",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "MCP server exposing GSD orchestration tools for Claude Code, Cursor, and other MCP clients",
|
"description": "MCP server exposing sf-run orchestration tools for Claude Code, Cursor, and other MCP clients",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/gsd-build/gsd-2.git",
|
"url": "https://github.com/singularity-forge/sf-run.git",
|
||||||
"directory": "packages/mcp-server"
|
"directory": "packages/mcp-server"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"gsd-mcp-server": "./dist/cli.js"
|
"sf-mcp-server": "./dist/cli.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.27.1",
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
||||||
"@gsd-build/rpc-client": "^2.74.0",
|
"@singularity-forge/rpc-client": "^2.74.0",
|
||||||
"zod": "^4.0.0"
|
"zod": "^4.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @gsd-build/mcp-server CLI — stdio transport entry point.
|
* @singularity-forge/mcp-server CLI — stdio transport entry point.
|
||||||
*
|
*
|
||||||
* Connects the MCP server to stdin/stdout for use by Claude Code,
|
* Connects the MCP server to stdin/stdout for use by Claude Code,
|
||||||
* Cursor, and other MCP-compatible clients.
|
* Cursor, and other MCP-compatible clients.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// @gsd-build/mcp-server — Tests for env-writer utilities
|
// @singularity-forge/mcp-server — Tests for env-writer utilities
|
||||||
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
||||||
|
|
||||||
import { describe, it, afterEach } from 'node:test';
|
import { describe, it, afterEach } from 'node:test';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// @gsd-build/mcp-server — Environment variable write utilities
|
// @singularity-forge/mcp-server — Environment variable write utilities
|
||||||
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
||||||
//
|
//
|
||||||
// Shared helpers for writing env vars to .env files, detecting project
|
// Shared helpers for writing env vars to .env files, detecting project
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @gsd-build/mcp-server — MCP server for GSD orchestration and project state.
|
* @singularity-forge/mcp-server — MCP server for GSD orchestration and project state.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { SessionManager } from './session-manager.js';
|
export { SessionManager } from './session-manager.js';
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @gsd-build/mcp-server — Integration and unit tests.
|
* @singularity-forge/mcp-server — Integration and unit tests.
|
||||||
*
|
*
|
||||||
* Strategy: We cannot mock @gsd-build/rpc-client at the module level without
|
* Strategy: We cannot mock @singularity-forge/rpc-client at the module level without
|
||||||
* --experimental-test-module-mocks. Instead we test by:
|
* --experimental-test-module-mocks. Instead we test by:
|
||||||
*
|
*
|
||||||
* 1. Subclassing SessionManager to inject a mock client factory
|
* 1. Subclassing SessionManager to inject a mock client factory
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// @gsd-build/mcp-server — Tests for secure_env_collect MCP tool
|
// @singularity-forge/mcp-server — Tests for secure_env_collect MCP tool
|
||||||
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
// Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
|
||||||
//
|
//
|
||||||
// Tests the secure_env_collect tool registered in createMcpServer.
|
// Tests the secure_env_collect tool registered in createMcpServer.
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
import { execSync } from 'node:child_process';
|
import { execSync } from 'node:child_process';
|
||||||
import { resolve } from 'node:path';
|
import { resolve } from 'node:path';
|
||||||
import { RpcClient } from '@gsd-build/rpc-client';
|
import { RpcClient } from '@singularity-forge/rpc-client';
|
||||||
import type { SdkAgentEvent, RpcInitResult, RpcCostUpdateEvent, RpcExtensionUIRequest } from '@gsd-build/rpc-client';
|
import type { SdkAgentEvent, RpcInitResult, RpcCostUpdateEvent, RpcExtensionUIRequest } from '@singularity-forge/rpc-client';
|
||||||
import type {
|
import type {
|
||||||
ManagedSession,
|
ManagedSession,
|
||||||
ExecuteOptions,
|
ExecuteOptions,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
* MCP Server types — session lifecycle and orchestration.
|
* MCP Server types — session lifecycle and orchestration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { RpcClient, SdkAgentEvent, RpcCostUpdateEvent, RpcExtensionUIRequest } from '@gsd-build/rpc-client';
|
import type { RpcClient, SdkAgentEvent, RpcCostUpdateEvent, RpcExtensionUIRequest } from '@singularity-forge/rpc-client';
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Session Status
|
// Session Status
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd/native",
|
"name": "@sf-run/native",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "Native Rust bindings for GSD — high-performance native modules via N-API",
|
"description": "Native Rust bindings for sf-run — high-performance native modules via N-API",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ for (const candidate of candidates) {
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error(
|
console.error(
|
||||||
"Native addon not found. Run `npm run build:native -w @gsd/native` first.",
|
"Native addon not found. Run `npm run build:native -w @sf-run/native` first.",
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ for (const candidate of candidates) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error("Native addon not found. Run `npm run build:native -w @gsd/native` first.");
|
console.error("Native addon not found. Run `npm run build:native -w @sf-run/native` first.");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ for (const candidate of candidates) {
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error(
|
console.error(
|
||||||
"Native addon not found. Run `npm run build:native -w @gsd/native` first.",
|
"Native addon not found. Run `npm run build:native -w @sf-run/native` first.",
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ for (const candidate of candidates) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error("Native addon not found. Run `npm run build:native -w @gsd/native` first.");
|
console.error("Native addon not found. Run `npm run build:native -w @sf-run/native` first.");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ for (const candidate of candidates) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error("Native addon not found. Run `npm run build:native -w @gsd/native` first.");
|
console.error("Native addon not found. Run `npm run build:native -w @sf-run/native` first.");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ for (const candidate of candidates) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error("Native addon not found. Run `npm run build:native -w @gsd/native` first.");
|
console.error("Native addon not found. Run `npm run build:native -w @sf-run/native` first.");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ for (const candidate of candidates) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error("Native addon not found. Run 'npm run build:native -w @gsd/native' first.");
|
console.error("Native addon not found. Run 'npm run build:native -w @sf-run/native' first.");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ for (const candidate of candidates) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error("Native addon not found. Run `npm run build:native -w @gsd/native` first.");
|
console.error("Native addon not found. Run `npm run build:native -w @sf-run/native` first.");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Tests that the @gsd/native package.json is correctly configured
|
* Tests that the @sf-run/native package.json is correctly configured
|
||||||
* for Node.js module resolution (ESM/CJS compatibility).
|
* for Node.js module resolution (ESM/CJS compatibility).
|
||||||
*
|
*
|
||||||
* Regression test for #2861: "type": "module" + "import"-only export
|
* Regression test for #2861: "type": "module" + "import"-only export
|
||||||
|
|
@ -17,7 +17,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const pkgPath = path.resolve(__dirname, "..", "..", "package.json");
|
const pkgPath = path.resolve(__dirname, "..", "..", "package.json");
|
||||||
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
||||||
|
|
||||||
describe("@gsd/native module compatibility (#2861)", () => {
|
describe("@sf-run/native module compatibility (#2861)", () => {
|
||||||
test("package.json must not declare type: module (compiled output is CJS-compatible)", () => {
|
test("package.json must not declare type: module (compiled output is CJS-compatible)", () => {
|
||||||
// The compiled output uses createRequire() to load .node addons.
|
// The compiled output uses createRequire() to load .node addons.
|
||||||
// Declaring "type": "module" forces Node.js to treat .js files as ESM,
|
// Declaring "type": "module" forces Node.js to treat .js files as ESM,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ for (const candidate of candidates) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error("Native addon not found. Run `npm run build:native -w @gsd/native` first.");
|
console.error("Native addon not found. Run `npm run build:native -w @sf-run/native` first.");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ for (const candidate of candidates) {
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error(
|
console.error(
|
||||||
"Native addon not found. Run `npm run build:native -w @gsd/native` first.",
|
"Native addon not found. Run `npm run build:native -w @sf-run/native` first.",
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ for (const candidate of candidates) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!native) {
|
if (!native) {
|
||||||
console.error("Native addon not found. Run `npm run build:native -w @gsd/native` first.");
|
console.error("Native addon not found. Run `npm run build:native -w @sf-run/native` first.");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { describe, it } from "node:test";
|
import { describe, it } from "node:test";
|
||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import { xxHash32, xxHash32Fallback } from "@gsd/native/xxhash";
|
import { xxHash32, xxHash32Fallback } from "@sf-run/native/xxhash";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reference values computed from the pure-JS xxHash32 implementation
|
* Reference values computed from the pure-JS xxHash32 implementation
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @gsd/native — High-performance Rust modules exposed via N-API.
|
* @sf-run/native — High-performance Rust modules exposed via N-API.
|
||||||
*
|
*
|
||||||
* Modules:
|
* Modules:
|
||||||
* - clipboard: native clipboard access (text + image)
|
* - clipboard: native clipboard access (text + image)
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Locates and loads the compiled Rust N-API addon (`.node` file).
|
* Locates and loads the compiled Rust N-API addon (`.node` file).
|
||||||
* Resolution order:
|
* Resolution order:
|
||||||
* 1. @gsd-build/engine-{platform} npm optional dependency (production install)
|
* 1. @singularity-forge/engine-{platform} npm optional dependency (production install)
|
||||||
* 2. native/addon/gsd_engine.{platform}.node (local release build)
|
* 2. native/addon/gsd_engine.{platform}.node (local release build)
|
||||||
* 3. native/addon/gsd_engine.dev.node (local debug build)
|
* 3. native/addon/gsd_engine.dev.node (local debug build)
|
||||||
*/
|
*/
|
||||||
|
|
@ -37,10 +37,10 @@ function loadNative(): Record<string, unknown> {
|
||||||
const packageSuffix = platformPackageMap[platformTag];
|
const packageSuffix = platformPackageMap[platformTag];
|
||||||
if (packageSuffix) {
|
if (packageSuffix) {
|
||||||
try {
|
try {
|
||||||
_loadedSuccessfully = true; return _require(`@gsd-build/engine-${packageSuffix}`) as Record<string, unknown>;
|
_loadedSuccessfully = true; return _require(`@singularity-forge/engine-${packageSuffix}`) as Record<string, unknown>;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const message = err instanceof Error ? err.message : String(err);
|
const message = err instanceof Error ? err.message : String(err);
|
||||||
errors.push(`@gsd-build/engine-${packageSuffix}: ${message}`);
|
errors.push(`@singularity-forge/engine-${packageSuffix}: ${message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd/pi-agent-core",
|
"name": "@sf-run/pi-agent-core",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "General-purpose agent core (vendored from pi-mono)",
|
"description": "General-purpose agent core (vendored from pi-mono)",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import { fileURLToPath } from "node:url";
|
||||||
import { Type } from "@sinclair/typebox";
|
import { Type } from "@sinclair/typebox";
|
||||||
import { agentLoop, MAX_CONSECUTIVE_VALIDATION_FAILURES } from "./agent-loop.js";
|
import { agentLoop, MAX_CONSECUTIVE_VALIDATION_FAILURES } from "./agent-loop.js";
|
||||||
import type { AgentContext, AgentLoopConfig, AgentTool, AgentEvent, AgentMessage } from "./types.js";
|
import type { AgentContext, AgentLoopConfig, AgentTool, AgentEvent, AgentMessage } from "./types.js";
|
||||||
import { AssistantMessageEventStream, EventStream } from "@gsd/pi-ai";
|
import { AssistantMessageEventStream, EventStream } from "@sf-run/pi-ai";
|
||||||
import type { AssistantMessage, AssistantMessageEvent, Model } from "@gsd/pi-ai";
|
import type { AssistantMessage, AssistantMessageEvent, Model } from "@sf-run/pi-ai";
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import {
|
||||||
streamSimple,
|
streamSimple,
|
||||||
type ToolResultMessage,
|
type ToolResultMessage,
|
||||||
validateToolArguments,
|
validateToolArguments,
|
||||||
} from "@gsd/pi-ai";
|
} from "@sf-run/pi-ai";
|
||||||
import type {
|
import type {
|
||||||
AgentContext,
|
AgentContext,
|
||||||
AgentEvent,
|
AgentEvent,
|
||||||
|
|
@ -27,7 +27,7 @@ import type {
|
||||||
* schema validation before the loop terminates. This prevents unbounded retry
|
* schema validation before the loop terminates. This prevents unbounded retry
|
||||||
* loops when the LLM repeatedly emits tool calls with arguments that cannot
|
* loops when the LLM repeatedly emits tool calls with arguments that cannot
|
||||||
* pass validation (e.g., schema overload, truncated JSON, missing required
|
* pass validation (e.g., schema overload, truncated JSON, missing required
|
||||||
* fields). See: https://github.com/gsd-build/gsd-2/issues/2783
|
* fields). See: https://github.com/singularity-forge/sf-run/issues/2783
|
||||||
*/
|
*/
|
||||||
export const MAX_CONSECUTIVE_VALIDATION_FAILURES = 3;
|
export const MAX_CONSECUTIVE_VALIDATION_FAILURES = 3;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Agent activeInferenceModel regression tests
|
// Agent activeInferenceModel regression tests
|
||||||
// Verifies that activeInferenceModel is set/cleared correctly in _runLoop,
|
// Verifies that activeInferenceModel is set/cleared correctly in _runLoop,
|
||||||
// and that the footer reads activeInferenceModel instead of state.model.
|
// and that the footer reads activeInferenceModel instead of state.model.
|
||||||
// Regression test for https://github.com/gsd-build/gsd-2/issues/1844 Bug 2
|
// Regression test for https://github.com/singularity-forge/sf-run/issues/1844 Bug 2
|
||||||
|
|
||||||
import { describe, it } from "node:test";
|
import { describe, it } from "node:test";
|
||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
|
|
@ -9,7 +9,7 @@ import { readFileSync } from "node:fs";
|
||||||
import { join, dirname } from "node:path";
|
import { join, dirname } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { Agent } from "./agent.ts";
|
import { Agent } from "./agent.ts";
|
||||||
import { getModel, type AssistantMessageEventStream } from "@gsd/pi-ai";
|
import { getModel, type AssistantMessageEventStream } from "@sf-run/pi-ai";
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import {
|
||||||
type TextContent,
|
type TextContent,
|
||||||
type ThinkingBudgets,
|
type ThinkingBudgets,
|
||||||
type Transport,
|
type Transport,
|
||||||
} from "@gsd/pi-ai";
|
} from "@sf-run/pi-ai";
|
||||||
import { agentLoop, agentLoopContinue, ZERO_USAGE } from "./agent-loop.js";
|
import { agentLoop, agentLoopContinue, ZERO_USAGE } from "./agent-loop.js";
|
||||||
import type {
|
import type {
|
||||||
AgentContext,
|
AgentContext,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import {
|
||||||
type SimpleStreamOptions,
|
type SimpleStreamOptions,
|
||||||
type StopReason,
|
type StopReason,
|
||||||
type ToolCall,
|
type ToolCall,
|
||||||
} from "@gsd/pi-ai";
|
} from "@sf-run/pi-ai";
|
||||||
import { ZERO_USAGE } from "./agent-loop.js";
|
import { ZERO_USAGE } from "./agent-loop.js";
|
||||||
|
|
||||||
// Create stream class matching ProxyMessageEventStream
|
// Create stream class matching ProxyMessageEventStream
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import type {
|
||||||
TextContent,
|
TextContent,
|
||||||
Tool,
|
Tool,
|
||||||
ToolResultMessage,
|
ToolResultMessage,
|
||||||
} from "@gsd/pi-ai";
|
} from "@sf-run/pi-ai";
|
||||||
import type { Static, TSchema } from "@sinclair/typebox";
|
import type { Static, TSchema } from "@sinclair/typebox";
|
||||||
|
|
||||||
/** Stream function - can return sync or Promise for async config lookup */
|
/** Stream function - can return sync or Promise for async config lookup */
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd/pi-ai",
|
"name": "@sf-run/pi-ai",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "Unified LLM API (vendored from pi-mono)",
|
"description": "Unified LLM API (vendored from pi-mono)",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ async function main(): Promise<void> {
|
||||||
|
|
||||||
if (!command || command === "help" || command === "--help" || command === "-h") {
|
if (!command || command === "help" || command === "--help" || command === "-h") {
|
||||||
const providerList = PROVIDERS.map((p) => ` ${p.id.padEnd(20)} ${p.name}`).join("\n");
|
const providerList = PROVIDERS.map((p) => ` ${p.id.padEnd(20)} ${p.name}`).join("\n");
|
||||||
console.log(`Usage: npx @gsd/pi-ai <command> [provider]
|
console.log(`Usage: npx @sf-run/pi-ai <command> [provider]
|
||||||
|
|
||||||
Commands:
|
Commands:
|
||||||
login [provider] Login to an OAuth provider
|
login [provider] Login to an OAuth provider
|
||||||
|
|
@ -74,9 +74,9 @@ Providers:
|
||||||
${providerList}
|
${providerList}
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
npx @gsd/pi-ai login # interactive provider selection
|
npx @sf-run/pi-ai login # interactive provider selection
|
||||||
npx @gsd/pi-ai login anthropic # login to specific provider
|
npx @sf-run/pi-ai login anthropic # login to specific provider
|
||||||
npx @gsd/pi-ai list # list providers
|
npx @sf-run/pi-ai list # list providers
|
||||||
`);
|
`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -113,7 +113,7 @@ Examples:
|
||||||
|
|
||||||
if (!PROVIDERS.some((p) => p.id === provider)) {
|
if (!PROVIDERS.some((p) => p.id === provider)) {
|
||||||
console.error(`Unknown provider: ${provider}`);
|
console.error(`Unknown provider: ${provider}`);
|
||||||
console.error(`Use 'npx @gsd/pi-ai list' to see available providers`);
|
console.error(`Use 'npx @sf-run/pi-ai list' to see available providers`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,7 +123,7 @@ Examples:
|
||||||
}
|
}
|
||||||
|
|
||||||
console.error(`Unknown command: ${command}`);
|
console.error(`Unknown command: ${command}`);
|
||||||
console.error(`Use 'npx @gsd/pi-ai --help' for usage`);
|
console.error(`Use 'npx @sf-run/pi-ai --help' for usage`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
// third-party catalog. Providers that use proprietary endpoints and are not
|
// third-party catalog. Providers that use proprietary endpoints and are not
|
||||||
// listed on models.dev must be defined here so they survive regeneration.
|
// listed on models.dev must be defined here so they survive regeneration.
|
||||||
//
|
//
|
||||||
// See: https://github.com/gsd-build/gsd-2/issues/2339
|
// See: https://github.com/singularity-forge/sf-run/issues/2339
|
||||||
//
|
//
|
||||||
// To add a custom provider:
|
// To add a custom provider:
|
||||||
// 1. Add its model definitions below following the existing pattern.
|
// 1. Add its model definitions below following the existing pattern.
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ for (const [provider, models] of Object.entries(MODELS)) {
|
||||||
|
|
||||||
// Merge manually-maintained custom providers that are NOT in models.dev.
|
// Merge manually-maintained custom providers that are NOT in models.dev.
|
||||||
// Custom models are additive — they never overwrite generated entries.
|
// Custom models are additive — they never overwrite generated entries.
|
||||||
// See: https://github.com/gsd-build/gsd-2/issues/2339
|
// See: https://github.com/singularity-forge/sf-run/issues/2339
|
||||||
for (const [provider, models] of Object.entries(CUSTOM_MODELS)) {
|
for (const [provider, models] of Object.entries(CUSTOM_MODELS)) {
|
||||||
if (!modelRegistry.has(provider)) {
|
if (!modelRegistry.has(provider)) {
|
||||||
modelRegistry.set(provider, new Map<string, Model<Api>>());
|
modelRegistry.set(provider, new Map<string, Model<Api>>());
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { parseStreamingJson as nativeParseStreamingJson } from "@gsd/native";
|
import { parseStreamingJson as nativeParseStreamingJson } from "@sf-run/native";
|
||||||
import { hasXmlParameterTags, hasYamlBulletLists, repairToolJson } from "./repair-tool-json.js";
|
import { hasXmlParameterTags, hasYamlBulletLists, repairToolJson } from "./repair-tool-json.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
*
|
*
|
||||||
* This module detects and repairs such patterns before JSON.parse is called.
|
* This module detects and repairs such patterns before JSON.parse is called.
|
||||||
*
|
*
|
||||||
* @see https://github.com/gsd-build/gsd-2/issues/2660
|
* @see https://github.com/singularity-forge/sf-run/issues/2660
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -34,7 +34,7 @@ export function hasYamlBulletLists(json: string): boolean {
|
||||||
* Some models mix XML tool-call syntax into JSON string values,
|
* Some models mix XML tool-call syntax into JSON string values,
|
||||||
* producing hybrid output that fails JSON.parse.
|
* producing hybrid output that fails JSON.parse.
|
||||||
*
|
*
|
||||||
* @see https://github.com/gsd-build/gsd-2/issues/3403
|
* @see https://github.com/singularity-forge/sf-run/issues/3403
|
||||||
*/
|
*/
|
||||||
export function hasXmlParameterTags(json: string): boolean {
|
export function hasXmlParameterTags(json: string): boolean {
|
||||||
return /<\/?parameter[\s>]/.test(json);
|
return /<\/?parameter[\s>]/.test(json);
|
||||||
|
|
@ -47,7 +47,7 @@ export function hasXmlParameterTags(json: string): boolean {
|
||||||
* Smaller models sometimes emit incomplete numbers when the value
|
* Smaller models sometimes emit incomplete numbers when the value
|
||||||
* is cut off mid-generation.
|
* is cut off mid-generation.
|
||||||
*
|
*
|
||||||
* @see https://github.com/gsd-build/gsd-2/issues/3464
|
* @see https://github.com/singularity-forge/sf-run/issues/3464
|
||||||
*/
|
*/
|
||||||
export function hasTruncatedNumbers(json: string): boolean {
|
export function hasTruncatedNumbers(json: string): boolean {
|
||||||
// Match: colon, optional whitespace, then a comma or } without a value
|
// Match: colon, optional whitespace, then a comma or } without a value
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gsd/pi-coding-agent",
|
"name": "@sf-run/pi-coding-agent",
|
||||||
"version": "2.74.0",
|
"version": "2.74.0",
|
||||||
"description": "Coding agent CLI (vendored from pi-mono)",
|
"description": "Coding agent CLI (vendored from pi-mono)",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@
|
||||||
*/
|
*/
|
||||||
process.title = "pi";
|
process.title = "pi";
|
||||||
|
|
||||||
import { setBedrockProviderModule } from "@gsd/pi-ai";
|
import { setBedrockProviderModule } from "@sf-run/pi-ai";
|
||||||
import { bedrockProviderModule } from "@gsd/pi-ai/bedrock-provider";
|
import { bedrockProviderModule } from "@sf-run/pi-ai/bedrock-provider";
|
||||||
import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
|
import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
|
||||||
import { main } from "./main.js";
|
import { main } from "./main.js";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
* CLI argument parsing and help display
|
* CLI argument parsing and help display
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { ThinkingLevel } from "@gsd/pi-agent-core";
|
import type { ThinkingLevel } from "@sf-run/pi-agent-core";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from "../config.js";
|
import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from "../config.js";
|
||||||
import { allTools, type ToolName } from "../core/tools/index.js";
|
import { allTools, type ToolName } from "../core/tools/index.js";
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
* TUI config selector for `pi config` command
|
* TUI config selector for `pi config` command
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ProcessTerminal, TUI } from "@gsd/pi-tui";
|
import { ProcessTerminal, TUI } from "@sf-run/pi-tui";
|
||||||
import type { ResolvedPaths } from "../core/package-manager.js";
|
import type { ResolvedPaths } from "../core/package-manager.js";
|
||||||
import type { SettingsManager } from "../core/settings-manager.js";
|
import type { SettingsManager } from "../core/settings-manager.js";
|
||||||
import { ConfigSelectorComponent } from "../modes/interactive/components/config-selector.js";
|
import { ConfigSelectorComponent } from "../modes/interactive/components/config-selector.js";
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { access, readFile, stat } from "node:fs/promises";
|
import { access, readFile, stat } from "node:fs/promises";
|
||||||
import type { ImageContent } from "@gsd/pi-ai";
|
import type { ImageContent } from "@sf-run/pi-ai";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
import { resolve } from "path";
|
import { resolve } from "path";
|
||||||
import { resolveReadPath } from "../core/tools/path-utils.js";
|
import { resolveReadPath } from "../core/tools/path-utils.js";
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
* List available models with optional fuzzy search and discovery support
|
* List available models with optional fuzzy search and discovery support
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Api, Model } from "@gsd/pi-ai";
|
import type { Api, Model } from "@sf-run/pi-ai";
|
||||||
import { fuzzyFilter } from "@gsd/pi-tui";
|
import { fuzzyFilter } from "@sf-run/pi-tui";
|
||||||
import type { ModelRegistry } from "../core/model-registry.js";
|
import type { ModelRegistry } from "../core/model-registry.js";
|
||||||
|
|
||||||
export interface ListModelsOptions {
|
export interface ListModelsOptions {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
* TUI session selector for --resume flag
|
* TUI session selector for --resume flag
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ProcessTerminal, TUI } from "@gsd/pi-tui";
|
import { ProcessTerminal, TUI } from "@sf-run/pi-tui";
|
||||||
import { KeybindingsManager } from "../core/keybindings.js";
|
import { KeybindingsManager } from "../core/keybindings.js";
|
||||||
import type { SessionInfo, SessionListProgress } from "../core/session-manager.js";
|
import type { SessionInfo, SessionListProgress } from "../core/session-manager.js";
|
||||||
import { SessionSelectorComponent } from "../modes/interactive/components/session-selector.js";
|
import { SessionSelectorComponent } from "../modes/interactive/components/session-selector.js";
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { afterEach, beforeEach, describe, it } from "node:test";
|
import { afterEach, beforeEach, describe, it } from "node:test";
|
||||||
|
|
||||||
import { Agent } from "@gsd/pi-agent-core";
|
import { Agent } from "@sf-run/pi-agent-core";
|
||||||
import { Type } from "@sinclair/typebox";
|
import { Type } from "@sinclair/typebox";
|
||||||
import type { ToolDefinition } from "./extensions/types.js";
|
import type { ToolDefinition } from "./extensions/types.js";
|
||||||
import { AgentSession } from "./agent-session.js";
|
import { AgentSession } from "./agent-session.js";
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ import type {
|
||||||
AgentState,
|
AgentState,
|
||||||
AgentTool,
|
AgentTool,
|
||||||
ThinkingLevel,
|
ThinkingLevel,
|
||||||
} from "@gsd/pi-agent-core";
|
} from "@sf-run/pi-agent-core";
|
||||||
import type { AssistantMessage, ImageContent, Message, Model, TextContent } from "@gsd/pi-ai";
|
import type { AssistantMessage, ImageContent, Message, Model, TextContent } from "@sf-run/pi-ai";
|
||||||
import { modelsAreEqual, resetApiProviders, supportsXhigh } from "@gsd/pi-ai";
|
import { modelsAreEqual, resetApiProviders, supportsXhigh } from "@sf-run/pi-ai";
|
||||||
import { Type } from "@sinclair/typebox";
|
import { Type } from "@sinclair/typebox";
|
||||||
import { getDocsPath } from "../config.js";
|
import { getDocsPath } from "../config.js";
|
||||||
import { getErrorMessage } from "../utils/error.js";
|
import { getErrorMessage } from "../utils/error.js";
|
||||||
|
|
@ -305,7 +305,7 @@ export class AgentSession {
|
||||||
|
|
||||||
// Whether model changes should write defaultProvider/defaultModel to settings.json.
|
// Whether model changes should write defaultProvider/defaultModel to settings.json.
|
||||||
// Defaults to false — callers must explicitly opt into persistence. This is the
|
// Defaults to false — callers must explicitly opt into persistence. This is the
|
||||||
// safe default for SDK consumers: a third party building on @gsd/pi-coding-agent
|
// safe default for SDK consumers: a third party building on @sf-run/pi-coding-agent
|
||||||
// should not silently mutate the user's global settings just by switching models.
|
// should not silently mutate the user's global settings just by switching models.
|
||||||
// Interactive CLI entry points (gsd wrapper's interactive branch and pi main's
|
// Interactive CLI entry points (gsd wrapper's interactive branch and pi main's
|
||||||
// isInteractive branch) explicitly set this to true so user model picks still
|
// isInteractive branch) explicitly set this to true so user model picks still
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ import {
|
||||||
type OAuthCredentials,
|
type OAuthCredentials,
|
||||||
type OAuthLoginCallbacks,
|
type OAuthLoginCallbacks,
|
||||||
type OAuthProviderId,
|
type OAuthProviderId,
|
||||||
} from "@gsd/pi-ai";
|
} from "@sf-run/pi-ai";
|
||||||
import { getOAuthApiKey, getOAuthProvider, getOAuthProviders } from "@gsd/pi-ai/oauth";
|
import { getOAuthApiKey, getOAuthProvider, getOAuthProviders } from "@sf-run/pi-ai/oauth";
|
||||||
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
||||||
import { dirname, join } from "path";
|
import { dirname, join } from "path";
|
||||||
import { getAgentDir } from "../config.js";
|
import { getAgentDir } from "../config.js";
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ function registerTempCleanup(): void {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
import { processStreamChunk, type StreamState } from "@gsd/native";
|
import { processStreamChunk, type StreamState } from "@sf-run/native";
|
||||||
import { getShellConfig, getShellEnv, killProcessTree, sanitizeCommand } from "../utils/shell.js";
|
import { getShellConfig, getShellEnv, killProcessTree, sanitizeCommand } from "../utils/shell.js";
|
||||||
import type { BashOperations } from "./tools/bash.js";
|
import type { BashOperations } from "./tools/bash.js";
|
||||||
import { DEFAULT_MAX_BYTES, truncateTail } from "./tools/truncate.js";
|
import { DEFAULT_MAX_BYTES, truncateTail } from "./tools/truncate.js";
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ function createHost() {
|
||||||
test("chat-controller renders content blocks in content[] index order (tool-first stream)", async () => {
|
test("chat-controller renders content blocks in content[] index order (tool-first stream)", async () => {
|
||||||
// ToolExecutionComponent uses the global theme singleton.
|
// ToolExecutionComponent uses the global theme singleton.
|
||||||
// Install a minimal no-op theme implementation for this unit test.
|
// Install a minimal no-op theme implementation for this unit test.
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -166,7 +166,7 @@ test("chat-controller renders content blocks in content[] index order (tool-firs
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller renders serverToolUse before trailing text matching content[] index order", async () => {
|
test("chat-controller renders serverToolUse before trailing text matching content[] index order", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -235,7 +235,7 @@ test("chat-controller renders serverToolUse before trailing text matching conten
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller keeps pre-tool prose visible until post-tool prose arrives, then prunes it", async () => {
|
test("chat-controller keeps pre-tool prose visible until post-tool prose arrives, then prunes it", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -326,7 +326,7 @@ test("chat-controller keeps pre-tool prose visible until post-tool prose arrives
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller keeps pre-tool thinking visible for claude-code MCP turns without post-tool prose", async () => {
|
test("chat-controller keeps pre-tool thinking visible for claude-code MCP turns without post-tool prose", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -393,7 +393,7 @@ test("chat-controller keeps pre-tool thinking visible for claude-code MCP turns
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller prunes orphaned provisional text after claude-code sub-turn shrink when MCP tools appear", async () => {
|
test("chat-controller prunes orphaned provisional text after claude-code sub-turn shrink when MCP tools appear", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -494,7 +494,7 @@ test("chat-controller prunes orphaned provisional text after claude-code sub-tur
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller pins latest assistant text above editor when tool calls are present", async () => {
|
test("chat-controller pins latest assistant text above editor when tool calls are present", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -548,7 +548,7 @@ test("chat-controller pins latest assistant text above editor when tool calls ar
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller clears pinned zone when a new assistant message starts", async () => {
|
test("chat-controller clears pinned zone when a new assistant message starts", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -598,7 +598,7 @@ test("chat-controller clears pinned zone when a new assistant message starts", a
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller clears pinned zone when the agent turn ends", async () => {
|
test("chat-controller clears pinned zone when the agent turn ends", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -646,7 +646,7 @@ test("chat-controller clears pinned zone when the agent turn ends", async () =>
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller clears pinned zone when assistant message ends", async () => {
|
test("chat-controller clears pinned zone when assistant message ends", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -696,7 +696,7 @@ test("chat-controller clears pinned zone when assistant message ends", async ()
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller does not pin when there are no tool calls", async () => {
|
test("chat-controller does not pin when there are no tool calls", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -731,7 +731,7 @@ test("chat-controller does not pin when there are no tool calls", async () => {
|
||||||
// Expected chatContainer order: textRun(A), toolExec(T1), textRun(B), toolExec(T2), textRun(C)
|
// Expected chatContainer order: textRun(A), toolExec(T1), textRun(B), toolExec(T2), textRun(C)
|
||||||
// Each AssistantMessageComponent must render ONLY its own text — no duplication after message_end.
|
// Each AssistantMessageComponent must render ONLY its own text — no duplication after message_end.
|
||||||
test("chat-controller renders interleaved text and tool blocks in content[] index order (#4144)", async () => {
|
test("chat-controller renders interleaved text and tool blocks in content[] index order (#4144)", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -844,7 +844,7 @@ test("chat-controller renders interleaved text and tool blocks in content[] inde
|
||||||
});
|
});
|
||||||
|
|
||||||
test("chat-controller does not duplicate text when content is [text, tool, text] (interleaved stream)", async () => {
|
test("chat-controller does not duplicate text when content is [text, tool, text] (interleaved stream)", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -924,7 +924,7 @@ test("chat-controller does not duplicate text when content is [text, tool, text]
|
||||||
// sub-turn children must stay frozen; new sub-turn segments must append after
|
// sub-turn children must stay frozen; new sub-turn segments must append after
|
||||||
// them, and the pinned "Latest Output" mirror must re-evaluate for the new sub-turn.
|
// them, and the pinned "Latest Output" mirror must re-evaluate for the new sub-turn.
|
||||||
test("chat-controller freezes prior sub-turn and appends new segments when content shrinks", async () => {
|
test("chat-controller freezes prior sub-turn and appends new segments when content shrinks", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
@ -1026,7 +1026,7 @@ test("chat-controller freezes prior sub-turn and appends new segments when conte
|
||||||
// pinned "Latest Output" mirror can display text from the new sub-turn instead
|
// pinned "Latest Output" mirror can display text from the new sub-turn instead
|
||||||
// of staying frozen on a stale snapshot (the "bottom green stays" symptom).
|
// of staying frozen on a stale snapshot (the "bottom green stays" symptom).
|
||||||
test("chat-controller updates pinned zone after sub-turn shrink", async () => {
|
test("chat-controller updates pinned zone after sub-turn shrink", async () => {
|
||||||
(globalThis as any)[Symbol.for("@gsd/pi-coding-agent:theme")] = {
|
(globalThis as any)[Symbol.for("@sf-run/pi-coding-agent:theme")] = {
|
||||||
fg: (_key: string, text: string) => text,
|
fg: (_key: string, text: string) => text,
|
||||||
bg: (_key: string, text: string) => text,
|
bg: (_key: string, text: string) => text,
|
||||||
bold: (text: string) => text,
|
bold: (text: string) => text,
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@
|
||||||
* - Branch summarization abort coordination
|
* - Branch summarization abort coordination
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Agent } from "@gsd/pi-agent-core";
|
import type { Agent } from "@sf-run/pi-agent-core";
|
||||||
import type { AssistantMessage, Model } from "@gsd/pi-ai";
|
import type { AssistantMessage, Model } from "@sf-run/pi-ai";
|
||||||
import { isContextOverflow } from "@gsd/pi-ai";
|
import { isContextOverflow } from "@sf-run/pi-ai";
|
||||||
import {
|
import {
|
||||||
type CompactionResult,
|
type CompactionResult,
|
||||||
calculateContextTokens,
|
calculateContextTokens,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
|
|
||||||
import type { Message } from "@gsd/pi-ai";
|
import type { Message } from "@sf-run/pi-ai";
|
||||||
|
|
||||||
import { serializeConversation } from "./compaction/index.js";
|
import { serializeConversation } from "./compaction/index.js";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
* a summary of the branch being left so context isn't lost.
|
* a summary of the branch being left so context isn't lost.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { AgentMessage } from "@gsd/pi-agent-core";
|
import type { AgentMessage } from "@sf-run/pi-agent-core";
|
||||||
import type { Model } from "@gsd/pi-ai";
|
import type { Model } from "@sf-run/pi-ai";
|
||||||
import { completeSimple } from "@gsd/pi-ai";
|
import { completeSimple } from "@sf-run/pi-ai";
|
||||||
import { COMPACTION_RESERVE_TOKENS } from "../constants.js";
|
import { COMPACTION_RESERVE_TOKENS } from "../constants.js";
|
||||||
import { convertToLlm } from "../messages.js";
|
import { convertToLlm } from "../messages.js";
|
||||||
import type { ReadonlySessionManager, SessionEntry } from "../session-manager.js";
|
import type { ReadonlySessionManager, SessionEntry } from "../session-manager.js";
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import { describe, it, mock } from "node:test";
|
import { describe, it, mock } from "node:test";
|
||||||
|
|
||||||
import type { AgentMessage } from "@gsd/pi-agent-core";
|
import type { AgentMessage } from "@sf-run/pi-agent-core";
|
||||||
import type { Model, AssistantMessage } from "@gsd/pi-ai";
|
import type { Model, AssistantMessage } from "@sf-run/pi-ai";
|
||||||
|
|
||||||
import { generateSummary, estimateTokens, chunkMessages } from "./compaction.js";
|
import { generateSummary, estimateTokens, chunkMessages } from "./compaction.js";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
* and after compaction the session is reloaded.
|
* and after compaction the session is reloaded.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { AgentMessage } from "@gsd/pi-agent-core";
|
import type { AgentMessage } from "@sf-run/pi-agent-core";
|
||||||
import type { AssistantMessage, Model, Usage } from "@gsd/pi-ai";
|
import type { AssistantMessage, Model, Usage } from "@sf-run/pi-ai";
|
||||||
import { completeSimple } from "@gsd/pi-ai";
|
import { completeSimple } from "@sf-run/pi-ai";
|
||||||
import { COMPACTION_KEEP_RECENT_TOKENS, COMPACTION_RESERVE_TOKENS } from "../constants.js";
|
import { COMPACTION_KEEP_RECENT_TOKENS, COMPACTION_RESERVE_TOKENS } from "../constants.js";
|
||||||
import { convertToLlm } from "../messages.js";
|
import { convertToLlm } from "../messages.js";
|
||||||
import type { CompactionEntry, SessionEntry } from "../session-manager.js";
|
import type { CompactionEntry, SessionEntry } from "../session-manager.js";
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
* Shared utilities for compaction and branch summarization.
|
* Shared utilities for compaction and branch summarization.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { AgentMessage } from "@gsd/pi-agent-core";
|
import type { AgentMessage } from "@sf-run/pi-agent-core";
|
||||||
import type { Message } from "@gsd/pi-ai";
|
import type { Message } from "@sf-run/pi-ai";
|
||||||
import { TOOL_RESULT_MAX_CHARS } from "../constants.js";
|
import { TOOL_RESULT_MAX_CHARS } from "../constants.js";
|
||||||
import {
|
import {
|
||||||
createBranchSummaryMessage,
|
createBranchSummaryMessage,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
import type { ThinkingLevel } from "@gsd/pi-agent-core";
|
import type { ThinkingLevel } from "@sf-run/pi-agent-core";
|
||||||
|
|
||||||
export const DEFAULT_THINKING_LEVEL: ThinkingLevel = "medium";
|
export const DEFAULT_THINKING_LEVEL: ThinkingLevel = "medium";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { AgentState } from "@gsd/pi-agent-core";
|
import type { AgentState } from "@sf-run/pi-agent-core";
|
||||||
import { existsSync, readFileSync, writeFileSync } from "fs";
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
||||||
import { basename, join } from "path";
|
import { basename, join } from "path";
|
||||||
import { APP_NAME, getExportTemplateDir } from "../../config.js";
|
import { APP_NAME, getExportTemplateDir } from "../../config.js";
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* and converting the ANSI output to HTML.
|
* and converting the ANSI output to HTML.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { ImageContent, TextContent } from "@gsd/pi-ai";
|
import type { ImageContent, TextContent } from "@sf-run/pi-ai";
|
||||||
import type { Theme } from "../../modes/interactive/theme/theme.js";
|
import type { Theme } from "../../modes/interactive/theme/theme.js";
|
||||||
import type { ToolDefinition } from "../extensions/types.js";
|
import type { ToolDefinition } from "../extensions/types.js";
|
||||||
import { ansiLinesToHtml } from "./ansi-to-html.js";
|
import { ansiLinesToHtml } from "./ansi-to-html.js";
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@ import * as os from "node:os";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { createJiti } from "@mariozechner/jiti";
|
import { createJiti } from "@mariozechner/jiti";
|
||||||
import * as _bundledPiAgentCore from "@gsd/pi-agent-core";
|
import * as _bundledPiAgentCore from "@sf-run/pi-agent-core";
|
||||||
import * as _bundledPiAi from "@gsd/pi-ai";
|
import * as _bundledPiAi from "@sf-run/pi-ai";
|
||||||
import * as _bundledPiAiOauth from "@gsd/pi-ai/oauth";
|
import * as _bundledPiAiOauth from "@sf-run/pi-ai/oauth";
|
||||||
import type { KeyId } from "@gsd/pi-tui";
|
import type { KeyId } from "@sf-run/pi-tui";
|
||||||
import * as _bundledPiTui from "@gsd/pi-tui";
|
import * as _bundledPiTui from "@sf-run/pi-tui";
|
||||||
// Static imports of packages that extensions may use.
|
// Static imports of packages that extensions may use.
|
||||||
// These MUST be static so Bun bundles them into the compiled binary.
|
// These MUST be static so Bun bundles them into the compiled binary.
|
||||||
// The virtualModules option then makes them available to extensions.
|
// The virtualModules option then makes them available to extensions.
|
||||||
|
|
@ -31,7 +31,7 @@ import * as _bundledMcpServerStreamableHttp from "@modelcontextprotocol/sdk/serv
|
||||||
import * as _bundledMcpTypes from "@modelcontextprotocol/sdk/types.js";
|
import * as _bundledMcpTypes from "@modelcontextprotocol/sdk/types.js";
|
||||||
import { getAgentDir, isBunBinary } from "../../config.js";
|
import { getAgentDir, isBunBinary } from "../../config.js";
|
||||||
// NOTE: This import works because loader.ts exports are NOT re-exported from index.ts,
|
// NOTE: This import works because loader.ts exports are NOT re-exported from index.ts,
|
||||||
// avoiding a circular dependency. Extensions can import from @gsd/pi-coding-agent.
|
// avoiding a circular dependency. Extensions can import from "@sf-run/pi-coding-agent.
|
||||||
import * as _bundledPiCodingAgent from "../../index.js";
|
import * as _bundledPiCodingAgent from "../../index.js";
|
||||||
import { createEventBus, type EventBus } from "../event-bus.js";
|
import { createEventBus, type EventBus } from "../event-bus.js";
|
||||||
import type { ExecOptions } from "../exec.js";
|
import type { ExecOptions } from "../exec.js";
|
||||||
|
|
@ -58,11 +58,11 @@ import type {
|
||||||
*/
|
*/
|
||||||
const STATIC_BUNDLED_MODULES: Record<string, unknown> = {
|
const STATIC_BUNDLED_MODULES: Record<string, unknown> = {
|
||||||
"@sinclair/typebox": _bundledTypebox,
|
"@sinclair/typebox": _bundledTypebox,
|
||||||
"@gsd/pi-agent-core": _bundledPiAgentCore,
|
"@sf-run/pi-agent-core": _bundledPiAgentCore,
|
||||||
"@gsd/pi-tui": _bundledPiTui,
|
"@sf-run/pi-tui": _bundledPiTui,
|
||||||
"@gsd/pi-ai": _bundledPiAi,
|
"@sf-run/pi-ai": _bundledPiAi,
|
||||||
"@gsd/pi-ai/oauth": _bundledPiAiOauth,
|
"@sf-run/pi-ai/oauth": _bundledPiAiOauth,
|
||||||
"@gsd/pi-coding-agent": _bundledPiCodingAgent,
|
"@sf-run/pi-coding-agent": _bundledPiCodingAgent,
|
||||||
"yaml": _bundledYaml,
|
"yaml": _bundledYaml,
|
||||||
"@modelcontextprotocol/sdk/client": _bundledMcpClient,
|
"@modelcontextprotocol/sdk/client": _bundledMcpClient,
|
||||||
"@modelcontextprotocol/sdk/client/stdio": _bundledMcpStdio,
|
"@modelcontextprotocol/sdk/client/stdio": _bundledMcpStdio,
|
||||||
|
|
@ -324,19 +324,19 @@ function getAliases(): Record<string, string> {
|
||||||
// Auto-discovered subpath exports (lowest priority — overridden by manual entries below)
|
// Auto-discovered subpath exports (lowest priority — overridden by manual entries below)
|
||||||
...autoDiscovered,
|
...autoDiscovered,
|
||||||
// Manual entries for workspace packages and packages needing special resolution
|
// Manual entries for workspace packages and packages needing special resolution
|
||||||
"@gsd/pi-coding-agent": packageIndex,
|
"@sf-run/pi-coding-agent": packageIndex,
|
||||||
"@gsd/pi-agent-core": resolveWorkspaceOrImport("agent/dist/index.js", "@gsd/pi-agent-core"),
|
"@sf-run/pi-agent-core": resolveWorkspaceOrImport("agent/dist/index.js", "@sf-run/pi-agent-core"),
|
||||||
"@gsd/pi-tui": resolveWorkspaceOrImport("tui/dist/index.js", "@gsd/pi-tui"),
|
"@sf-run/pi-tui": resolveWorkspaceOrImport("tui/dist/index.js", "@sf-run/pi-tui"),
|
||||||
"@gsd/pi-ai": resolveWorkspaceOrImport("ai/dist/index.js", "@gsd/pi-ai"),
|
"@sf-run/pi-ai": resolveWorkspaceOrImport("ai/dist/index.js", "@sf-run/pi-ai"),
|
||||||
"@gsd/pi-ai/oauth": resolveWorkspaceOrImport("ai/dist/oauth.js", "@gsd/pi-ai/oauth"),
|
"@sf-run/pi-ai/oauth": resolveWorkspaceOrImport("ai/dist/oauth.js", "@sf-run/pi-ai/oauth"),
|
||||||
"@sinclair/typebox": typeboxRoot,
|
"@sinclair/typebox": typeboxRoot,
|
||||||
"yaml": yamlRoot,
|
"yaml": yamlRoot,
|
||||||
// Aliases for external PI ecosystem packages that import from the original scope
|
// Aliases for external PI ecosystem packages that import from the original scope
|
||||||
"@mariozechner/pi-coding-agent": packageIndex,
|
"@mariozechner/pi-coding-agent": packageIndex,
|
||||||
"@mariozechner/pi-agent-core": resolveWorkspaceOrImport("agent/dist/index.js", "@gsd/pi-agent-core"),
|
"@mariozechner/pi-agent-core": resolveWorkspaceOrImport("agent/dist/index.js", "@sf-run/pi-agent-core"),
|
||||||
"@mariozechner/pi-tui": resolveWorkspaceOrImport("tui/dist/index.js", "@gsd/pi-tui"),
|
"@mariozechner/pi-tui": resolveWorkspaceOrImport("tui/dist/index.js", "@sf-run/pi-tui"),
|
||||||
"@mariozechner/pi-ai": resolveWorkspaceOrImport("ai/dist/index.js", "@gsd/pi-ai"),
|
"@mariozechner/pi-ai": resolveWorkspaceOrImport("ai/dist/index.js", "@sf-run/pi-ai"),
|
||||||
"@mariozechner/pi-ai/oauth": resolveWorkspaceOrImport("ai/dist/oauth.js", "@gsd/pi-ai/oauth"),
|
"@mariozechner/pi-ai/oauth": resolveWorkspaceOrImport("ai/dist/oauth.js", "@sf-run/pi-ai/oauth"),
|
||||||
};
|
};
|
||||||
|
|
||||||
return _aliases;
|
return _aliases;
|
||||||
|
|
@ -638,7 +638,7 @@ export function containsTypeScriptSyntax(source: string): boolean {
|
||||||
* Shared jiti instance for loading extension modules.
|
* Shared jiti instance for loading extension modules.
|
||||||
*
|
*
|
||||||
* Before this fix (#2108), each extension created a NEW jiti instance with
|
* Before this fix (#2108), each extension created a NEW jiti instance with
|
||||||
* `moduleCache: false`, causing shared dependencies (e.g. @gsd/pi-agent-core)
|
* `moduleCache: false`, causing shared dependencies (e.g. @sf-run/pi-agent-core)
|
||||||
* to be recompiled for every extension — turning a ~3s parallel load into a
|
* to be recompiled for every extension — turning a ~3s parallel load into a
|
||||||
* ~15-30s serial compilation bottleneck.
|
* ~15-30s serial compilation bottleneck.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
* Extension runner - executes extensions and manages their lifecycle.
|
* Extension runner - executes extensions and manages their lifecycle.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { AgentMessage } from "@gsd/pi-agent-core";
|
import type { AgentMessage } from "@sf-run/pi-agent-core";
|
||||||
import type { ImageContent, Model } from "@gsd/pi-ai";
|
import type { ImageContent, Model } from "@sf-run/pi-ai";
|
||||||
import type { KeyId } from "@gsd/pi-tui";
|
import type { KeyId } from "@sf-run/pi-tui";
|
||||||
import { type Theme, theme } from "../../modes/interactive/theme/theme.js";
|
import { type Theme, theme } from "../../modes/interactive/theme/theme.js";
|
||||||
import type { ResourceDiagnostic } from "../diagnostics.js";
|
import type { ResourceDiagnostic } from "../diagnostics.js";
|
||||||
import type { KeyAction, KeybindingsConfig } from "../keybindings.js";
|
import type { KeyAction, KeybindingsConfig } from "../keybindings.js";
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import type {
|
||||||
AgentToolResult,
|
AgentToolResult,
|
||||||
AgentToolUpdateCallback,
|
AgentToolUpdateCallback,
|
||||||
ThinkingLevel,
|
ThinkingLevel,
|
||||||
} from "@gsd/pi-agent-core";
|
} from "@sf-run/pi-agent-core";
|
||||||
import type {
|
import type {
|
||||||
Api,
|
Api,
|
||||||
AssistantMessageEvent,
|
AssistantMessageEvent,
|
||||||
|
|
@ -26,7 +26,7 @@ import type {
|
||||||
SimpleStreamOptions,
|
SimpleStreamOptions,
|
||||||
TextContent,
|
TextContent,
|
||||||
ToolResultMessage,
|
ToolResultMessage,
|
||||||
} from "@gsd/pi-ai";
|
} from "@sf-run/pi-ai";
|
||||||
import type {
|
import type {
|
||||||
AutocompleteItem,
|
AutocompleteItem,
|
||||||
Component,
|
Component,
|
||||||
|
|
@ -36,7 +36,7 @@ import type {
|
||||||
OverlayHandle,
|
OverlayHandle,
|
||||||
OverlayOptions,
|
OverlayOptions,
|
||||||
TUI,
|
TUI,
|
||||||
} from "@gsd/pi-tui";
|
} from "@sf-run/pi-tui";
|
||||||
import type { Static, TSchema } from "@sinclair/typebox";
|
import type { Static, TSchema } from "@sinclair/typebox";
|
||||||
import type { Theme } from "../../modes/interactive/theme/theme.js";
|
import type { Theme } from "../../modes/interactive/theme/theme.js";
|
||||||
import type { BashResult } from "../bash-executor.js";
|
import type { BashResult } from "../bash-executor.js";
|
||||||
|
|
@ -194,12 +194,12 @@ export interface ExtensionUIContext {
|
||||||
* - `keybindings`: KeybindingsManager for app-level keybindings
|
* - `keybindings`: KeybindingsManager for app-level keybindings
|
||||||
*
|
*
|
||||||
* For full app keybinding support (escape, ctrl+d, model switching, etc.),
|
* For full app keybinding support (escape, ctrl+d, model switching, etc.),
|
||||||
* extend `CustomEditor` from `@gsd/pi-coding-agent` and call
|
* extend `CustomEditor` from `@sf-run/pi-coding-agent` and call
|
||||||
* `super.handleInput(data)` for keys you don't handle.
|
* `super.handleInput(data)` for keys you don't handle.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
* import { CustomEditor } from "@gsd/pi-coding-agent";
|
* import { CustomEditor } from "@sf-run/pi-coding-agent";
|
||||||
*
|
*
|
||||||
* class VimEditor extends CustomEditor {
|
* class VimEditor extends CustomEditor {
|
||||||
* private mode: "normal" | "insert" = "insert";
|
* private mode: "normal" | "insert" = "insert";
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
* Tool wrappers for extensions.
|
* Tool wrappers for extensions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { AgentTool, AgentToolUpdateCallback } from "@gsd/pi-agent-core";
|
import type { AgentTool, AgentToolUpdateCallback } from "@sf-run/pi-agent-core";
|
||||||
import type { ExtensionRunner } from "./runner.js";
|
import type { ExtensionRunner } from "./runner.js";
|
||||||
import type { RegisteredTool, ToolCallEventResult } from "./types.js";
|
import type { RegisteredTool, ToolCallEventResult } from "./types.js";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
import { describe, it, beforeEach, mock } from "node:test";
|
import { describe, it, beforeEach, mock } from "node:test";
|
||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import { FallbackResolver } from "./fallback-resolver.js";
|
import { FallbackResolver } from "./fallback-resolver.js";
|
||||||
import type { Api, Model } from "@gsd/pi-ai";
|
import type { Api, Model } from "@sf-run/pi-ai";
|
||||||
import type { AuthStorage } from "./auth-storage.js";
|
import type { AuthStorage } from "./auth-storage.js";
|
||||||
import type { ModelRegistry } from "./model-registry.js";
|
import type { ModelRegistry } from "./model-registry.js";
|
||||||
import type { FallbackChainEntry, SettingsManager } from "./settings-manager.js";
|
import type { FallbackChainEntry, SettingsManager } from "./settings-manager.js";
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
* restoration: checking if a higher-priority provider has recovered before each request.
|
* restoration: checking if a higher-priority provider has recovered before each request.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Api, Model } from "@gsd/pi-ai";
|
import type { Api, Model } from "@sf-run/pi-ai";
|
||||||
import type { AuthStorage, UsageLimitErrorType } from "./auth-storage.js";
|
import type { AuthStorage, UsageLimitErrorType } from "./auth-storage.js";
|
||||||
import type { ModelRegistry } from "./model-registry.js";
|
import type { ModelRegistry } from "./model-registry.js";
|
||||||
import type { FallbackChainEntry, SettingsManager } from "./settings-manager.js";
|
import type { FallbackChainEntry, SettingsManager } from "./settings-manager.js";
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import {
|
||||||
MANY_IMAGE_MAX_DIMENSION,
|
MANY_IMAGE_MAX_DIMENSION,
|
||||||
downsizeConversationImages,
|
downsizeConversationImages,
|
||||||
} from "./image-overflow-recovery.js";
|
} from "./image-overflow-recovery.js";
|
||||||
import type { Message } from "@gsd/pi-ai";
|
import type { Message } from "@sf-run/pi-ai";
|
||||||
|
|
||||||
// ─── isImageDimensionError ────────────────────────────────────────────────────
|
// ─── isImageDimensionError ────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@
|
||||||
* recovers by stripping older images from the conversation history, preserving
|
* recovers by stripping older images from the conversation history, preserving
|
||||||
* the most recent ones to maintain session continuity.
|
* the most recent ones to maintain session continuity.
|
||||||
*
|
*
|
||||||
* @see https://github.com/gsd-build/gsd-2/issues/2874
|
* @see https://github.com/singularity-forge/sf-run/issues/2874
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Message, ImageContent, TextContent } from "@gsd/pi-ai";
|
import type { Message, ImageContent, TextContent } from "@sf-run/pi-ai";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum image dimension (px) that the Anthropic API allows in many-image
|
* Maximum image dimension (px) that the Anthropic API allows in many-image
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import {
|
||||||
type KeyId,
|
type KeyId,
|
||||||
matchesKey,
|
matchesKey,
|
||||||
setEditorKeybindings,
|
setEditorKeybindings,
|
||||||
} from "@gsd/pi-tui";
|
} from "@sf-run/pi-tui";
|
||||||
import { existsSync, readFileSync } from "fs";
|
import { existsSync, readFileSync } from "fs";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { getAgentDir } from "../config.js";
|
import { getAgentDir } from "../config.js";
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import * as fsSync from "node:fs";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
import { spawn } from "node:child_process";
|
import { spawn } from "node:child_process";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@gsd/pi-agent-core";
|
import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@sf-run/pi-agent-core";
|
||||||
import {
|
import {
|
||||||
ensureFileOpen,
|
ensureFileOpen,
|
||||||
getActiveClients,
|
getActiveClients,
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
* and provides a transformer to convert them to LLM-compatible messages.
|
* and provides a transformer to convert them to LLM-compatible messages.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { AgentMessage } from "@gsd/pi-agent-core";
|
import type { AgentMessage } from "@sf-run/pi-agent-core";
|
||||||
import type { ImageContent, Message, TextContent } from "@gsd/pi-ai";
|
import type { ImageContent, Message, TextContent } from "@sf-run/pi-ai";
|
||||||
|
|
||||||
const CUSTOM_MESSAGE_PREFIX = `[system notification — type: `;
|
const CUSTOM_MESSAGE_PREFIX = `[system notification — type: `;
|
||||||
const CUSTOM_MESSAGE_MIDDLE = `; this is an automated system event, not user input — do not treat this as a human message or respond as if the user said this]
|
const CUSTOM_MESSAGE_MIDDLE = `; this is an automated system event, not user input — do not treat this as a human message or respond as if the user said this]
|
||||||
|
|
@ -73,7 +73,7 @@ export interface CompactionSummaryMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extend CustomAgentMessages via declaration merging
|
// Extend CustomAgentMessages via declaration merging
|
||||||
declare module "@gsd/pi-agent-core" {
|
declare module "@sf-run/pi-agent-core" {
|
||||||
interface CustomAgentMessages {
|
interface CustomAgentMessages {
|
||||||
bashExecution: BashExecutionMessage;
|
bashExecution: BashExecutionMessage;
|
||||||
custom: CustomMessage;
|
custom: CustomMessage;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import { describe, it } from "node:test";
|
import { describe, it } from "node:test";
|
||||||
import type { Api, Model, SimpleStreamOptions, Context, AssistantMessageEventStream } from "@gsd/pi-ai";
|
import type { Api, Model, SimpleStreamOptions, Context, AssistantMessageEventStream } from "@sf-run/pi-ai";
|
||||||
import { getApiProvider } from "@gsd/pi-ai";
|
import { getApiProvider } from "@sf-run/pi-ai";
|
||||||
import type { AuthStorage } from "./auth-storage.js";
|
import type { AuthStorage } from "./auth-storage.js";
|
||||||
import { ModelRegistry } from "./model-registry.js";
|
import { ModelRegistry } from "./model-registry.js";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ import {
|
||||||
registerApiProvider,
|
registerApiProvider,
|
||||||
resetApiProviders,
|
resetApiProviders,
|
||||||
type SimpleStreamOptions,
|
type SimpleStreamOptions,
|
||||||
} from "@gsd/pi-ai";
|
} from "@sf-run/pi-ai";
|
||||||
import { registerOAuthProvider, resetOAuthProviders } from "@gsd/pi-ai/oauth";
|
import { registerOAuthProvider, resetOAuthProviders } from "@sf-run/pi-ai/oauth";
|
||||||
import { type Static, Type } from "@sinclair/typebox";
|
import { type Static, Type } from "@sinclair/typebox";
|
||||||
import AjvModule from "ajv";
|
import AjvModule from "ajv";
|
||||||
import { existsSync, readFileSync } from "fs";
|
import { existsSync, readFileSync } from "fs";
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue