Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6839e4e
feat: add pi model controls and extension bridge
Canvinus May 22, 2026
1464f91
feat: expose pi resource overlays
Canvinus May 22, 2026
6112c2b
chore(deps): pin pi sdk to 0.75.4
Canvinus May 22, 2026
5e93fae
fix: make agent-server cli executable
Canvinus May 23, 2026
4ef86e4
feat: expose pi provider auth
Canvinus May 23, 2026
8ebfe58
feat: support pi subscription auth and custom providers
Canvinus May 23, 2026
edd6d6f
fix: reuse active pi subscription login
Canvinus May 23, 2026
957477b
feat: add project-scoped pi runtimes
Canvinus May 23, 2026
e1a9252
docs: clarify provider-neutral streaming
Canvinus May 23, 2026
aa3851e
fix(agent-server): return 404 for missing prompt sessions
Canvinus May 23, 2026
21d7e08
feat(agent-server): support single and multi project modes
Canvinus May 23, 2026
341785e
docs(agent-server): remove opencode migration wording
Canvinus May 23, 2026
5edce5c
add feature doc, pass .env during dev
neuromaxer May 26, 2026
d5751e1
docs(plan): add credentials extraction + thinking-level dedup plan
neuromaxer May 27, 2026
9c29e19
chore(deps): add @earendil-works/pi-ai for shared thinking-level helpers
neuromaxer May 27, 2026
1753d3b
feat(thinking): add src/thinking.ts wrapping Pi's clamp helpers
neuromaxer May 27, 2026
27c07a5
refactor(thinking): replace duplicated clamp helpers with src/thinkin…
neuromaxer May 27, 2026
23aebe8
feat(credentials): scaffold AgentCredentialsService class
neuromaxer May 27, 2026
7e9bbe6
feat(credentials): add listModels + modelRow projection
neuromaxer May 27, 2026
dcca078
feat(credentials): move listAuthProviders + provider key CRUD
neuromaxer May 27, 2026
838e319
feat(credentials): move OAuth subscription flow state machine
neuromaxer May 27, 2026
c7e5949
feat(credentials): move custom-provider models.json CRUD
neuromaxer May 27, 2026
b6b5496
feat(registry): construct shared AgentCredentialsService and inject i…
neuromaxer May 27, 2026
b2f2760
refactor(routes): split credentials routes into createCredentialsApp
neuromaxer May 27, 2026
f3629e8
refactor(runtime): drop credential code now provided by AgentCredenti…
neuromaxer May 27, 2026
d720ce9
chore(exports): re-export credentials service and thinking helpers
neuromaxer May 27, 2026
8f170af
docs(readme): update library-mode example to use createCredentialsApp
neuromaxer May 27, 2026
397b220
add builder isolation doc
neuromaxer May 31, 2026
d05a4c1
add docs on project runtime split and agent services
neuromaxer May 31, 2026
7229659
split runtime into ProjectRuntime and ProjectSession to separate resp…
neuromaxer May 31, 2026
029c811
use AgentSessionServices shared across sessions
neuromaxer May 31, 2026
21598db
organise files into sub-dirs
neuromaxer May 31, 2026
c9c1a65
rename AgentRuntimeRegistry to ProjectRegistry
neuromaxer Jun 2, 2026
6d70f41
factor out config from server
neuromaxer Jun 2, 2026
e5494a3
stick to pi convention in agent files
neuromaxer Jun 2, 2026
f9caf76
collapse multi and single modes, simplify project structure convention
neuromaxer Jun 3, 2026
35f664b
update docs
neuromaxer Jun 3, 2026
c0a48e2
update readme
neuromaxer Jun 6, 2026
1305e62
align types initial attempt
neuromaxer Jun 6, 2026
6f73da4
pass pi types from typia to zod
neuromaxer Jun 6, 2026
239951a
add operationId to each route
neuromaxer Jun 6, 2026
0cb017e
add gh action to check openapi freshness and pi breaking changes
neuromaxer Jun 6, 2026
cd17a24
factor out openapi contract generation logic
neuromaxer Jun 6, 2026
49f4d39
add pre-commit hook with schema generation and biom code formatter
neuromaxer Jun 6, 2026
9aa23aa
allow deleting sessions
neuromaxer Jun 7, 2026
d3014ec
allow deleting sessions p2
neuromaxer Jun 9, 2026
e22a433
surface pi llm errors in events
neuromaxer Jun 9, 2026
8faec1a
Merge pull request #2 from appx-org/pi-switch-refactor
neuromaxer Jun 9, 2026
0c3cd56
disable oasdiff for now
neuromaxer Jun 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# required
PROJECT_DIR=/abs/path/to/your/app
# required — workspace root holding every project dir plus .pi-global/.
# Mount as a Docker volume for restart-safe projects + registry.
WORKSPACE_DIR=/abs/path/to/workspace

# optional (with defaults)
# SESSIONS_DIR=$PROJECT_DIR/data/sessions
# AGENTS_FILE=.pi/AGENTS.md
# AGENT_SERVER_HOST=127.0.0.1
# AGENT_SERVER_PORT=4001

Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/contract.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#
# Contract gate for the agent-server OpenAPI surface.
#
# Two checks, both aimed at the one risk that matters here: pi (the upstream
# engine whose types we forward) drifting silently into our published contract.
#
# (1) Freshness — regenerate the committed contract artifacts
# (eventSchema.generated.json + openapi.json) and fail if the
# working tree changed. Catches "bumped pi / edited a route
# but forgot to regenerate + commit the contract".
#
# (2) Breaking — diff this PR's openapi.json against the base branch with
# oasdiff and fail on breaking changes. Turns silent drift
# into a reviewed, intentional event.
#
# The breaking-change check runs on pull_request because that's the only place
# it can actually *block* a merge (via branch protection). The freshness check
# also runs on push to main as a trunk safety net for direct pushes.
#
name: contract

on:
pull_request:
branches: [main]
push:
branches: [main]

# Cancel superseded runs on the same ref to save CI minutes.
concurrency:
group: contract-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# (1) The committed contract must be a faithful regeneration of the source.
freshness:
name: Contract artifacts are fresh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Regenerate contract artifacts
# Order matters: the typia-generated event schema must be refreshed
# before the OpenAPI dump, which merges it in.
run: |
npm run gen:event-schema
npm run openapi

- name: Verify committed artifacts are up to date
run: |
if ! git diff --exit-code -- openapi.json src/contract/eventSchema.generated.json; then
echo "::error::Contract artifacts are stale. Run 'npm run gen:event-schema && npm run openapi' and commit the result."
exit 1
fi

# (2) No breaking changes may reach main without review.
# breaking:
# name: No breaking contract changes
# # Only meaningful on PRs, where it can gate the merge against the base branch.
# if: github.event_name == 'pull_request'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4

# # oasdiff reads the base spec straight from git; fetch the base branch.
# - run: git fetch --depth=1 origin ${{ github.base_ref }}

# - name: Detect breaking changes (oasdiff)
# uses: oasdiff/oasdiff-action/breaking@v0.0.56
# with:
# base: origin/${{ github.base_ref }}:openapi.json
# revision: HEAD:openapi.json
# # Fail only on definite breaking changes (ERR). Intentional breaks can
# # be acknowledged via a `.oasdiff.yaml` err-ignore entry + a contract
# # version bump in src/openapi.ts.
# fail-on: ERR
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
node_modules/
dist/
.gen/
.env
.env.local
*.log
.DS_Store

# IDE
.vscode/*
!.vscode/settings.json
!.vscode/extensions.json

# Docs
docs/misc/

# Agents
.pi/todos/
46 changes: 46 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# agent-server pre-commit: shared formatting + a typed, in-sync contract.
#
# Always (fast, always relevant):
# 1. Biome format + lint (pi's conventions: tab/width-3, lineWidth 120).
# `--write` applies safe fixes; `--error-on-warnings` blocks on the rest.
# 2. Typecheck (tsc --noEmit) — fail fast on type errors.
#
# Only when the contract could have changed (a staged `src/` file or a
# dependency bump that might move pi's types):
# 3. Regenerate the typia SSE event schema, then the merged OpenAPI dump,
# and re-stage the artifacts. On unrelated commits this is skipped — the
# CI freshness gate (.github/workflows/contract.yml) remains the
# authoritative net for any deviation that slips through.
#
# Finally, re-stage everything that was already staged (Biome may have
# reformatted it). `set -e` aborts the commit on the first failing step.
set -e

# Snapshot what the user staged before Biome rewrites files in place.
STAGED_FILES=$(git diff --cached --name-only)

npm run check
npm run typecheck

# Does this commit touch anything that could change the published contract?
contract_touched=0
for file in $STAGED_FILES; do
case "$file" in
src/*.ts | src/**/*.ts | package.json | package-lock.json)
contract_touched=1
break
;;
esac
done

if [ "$contract_touched" -eq 1 ]; then
echo "Contract-relevant change staged — regenerating openapi.json + event schema..."
npm run gen:event-schema
npm run openapi
git add openapi.json src/contract/eventSchema.generated.json
fi

# Re-stage the previously-staged files (now possibly reformatted by Biome).
for file in $STAGED_FILES; do
[ -f "$file" ] && git add -- "$file"
done
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"window.title": "Agent-Server",

// Biome formats with real tab characters; these control how wide a tab
// renders so the editor matches biome.json's indentWidth (3).
"editor.tabSize": 4,
"editor.detectIndentation": false,

// Use Biome (see biome.json) as the single formatter on save so the editor
// matches the pre-commit hook (`biome check --write`) and avoids churn.
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"[typescript]": { "editor.defaultFormatter": "biomejs.biome" },
"[typescriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
"[javascript]": { "editor.defaultFormatter": "biomejs.biome" },
"[javascriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
"[json]": { "editor.defaultFormatter": "biomejs.biome" },
"[jsonc]": { "editor.defaultFormatter": "biomejs.biome" },
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit",
"quickfix.biome": "explicit"
}
}
Loading
Loading