Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docs/acp-implementation-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The implementation evidence comes from these source files:
- `src/acp/interaction-mapper.js`
- `src/shared/session/session-runtime.ts`
- `src/shared/session/session-runtime-events.js`
- `src/shared/session/session-runtime-interactions.js`
- `src/shared/session/session-runtime-interactions.ts`
- `src/acp/protocol-smoke.test.ts`
- `src/acp/session-map.test.js`
- `src/acp/server.test.js`
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Forbidden edges are as important as the shown edges:
## Public Runtime boundary

The public boundary lives in `src/shared/session/session-runtime.ts`, `src/shared/session/session-runtime-events.js`,
and `src/shared/session/session-runtime-interactions.js`.
and `src/shared/session/session-runtime-interactions.ts`.

| Surface | Consumer-visible contract |
| ----------------------- | ---------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -1090,7 +1090,7 @@ The highest-value cross-boundary paths for later confidence analysis are visible
| Per-session state | `src/shared/session/hosted-session.js` |
| Session registry | `src/shared/session/session-host.ts` |
| Runtime event contract | `src/shared/session/session-runtime-events.js` |
| Interaction contract | `src/shared/session/session-runtime-interactions.js` |
| Interaction contract | `src/shared/session/session-runtime-interactions.ts` |
| Pi session construction and prompt bridge | `src/shared/session/session.js` |
| Agent definition layering | `src/shared/session/agents.js` |
| Agent switching | `src/shared/session/agent-switching.ts` |
Expand Down
2 changes: 1 addition & 1 deletion docs/plans/remote-ssh-development/manual-qa.md
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ Evidence: `/tmp/wld-child13-linked-space-retry.log`, receipt 0, suite `wld-cli-w
#### Evidence boundaries after these repairs

`source-delta-from-693.json` in the final candidate compares the saved snapshots. The base HEAD is unchanged. Production
changes since `693c6b96…` are limited to `plan-written.ts`, `session-runtime-interactions.js`, and `execution-start.ts`;
changes since `693c6b96…` are limited to `plan-written.ts`, `session-runtime-interactions.ts`, and `execution-start.ts`;
other differences are documentation, test registration, and tests. Existing ordinary-primary-checkout journeys pass the
same cwd value before and after these substitutions. Cases without Plan Review or execution-start do not enter the
changed paths. Thus the earlier results keep their original build IDs and this explicit unaffected-case rationale;
Expand Down
1 change: 0 additions & 1 deletion scripts/language-policy-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"src/shared/session/root-session.js",

"src/shared/session/session-runtime-events.js",
"src/shared/session/session-runtime-interactions.js",
"src/shared/session/session-transcript-projection.js",
"src/shared/session/session.js",
"src/shared/session/types.js",
Expand Down
2 changes: 1 addition & 1 deletion src/acp/chat-interaction-runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createSessionRuntime } from "../shared/session/session-runtime.ts";
import type {
RuntimeInteractionRequest,
RuntimeInteractionResponse,
} from "../shared/session/session-runtime-interactions.js";
} from "../shared/session/session-runtime-interactions.ts";

for (const type of ["select", "text", "approval", "plan_review"] as const) {
test(`ACP broker answers only active chat interaction types: ${type}`, async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/acp/chat-interaction.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from "node:test";
import { assertEquals, assertStringIncludes } from "../testing/assertions.ts";
import type { RuntimeInteractionRequest } from "../shared/session/session-runtime-interactions.js";
import type { RuntimeInteractionRequest } from "../shared/session/session-runtime-interactions.ts";
import { formatChatQuestion, parseChatReply } from "./chat-interaction.ts";

test("interview chat only matches a unique exact label or displayed number", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/acp/chat-interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
type RuntimeInteractionRequest,
type RuntimeInteractionResponse,
RuntimeInteractionTypes,
} from "../shared/session/session-runtime-interactions.js";
} from "../shared/session/session-runtime-interactions.ts";

function displayLabel(label: string) {
return label.replace(/\s*\(recommended\)$/i, "");
Expand Down
12 changes: 6 additions & 6 deletions src/acp/interaction-mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
isApprovalAcceptedValue,
RuntimeInteractionOutcomes,
RuntimeInteractionTypes,
} from "../shared/session/session-runtime-interactions.js";
} from "../shared/session/session-runtime-interactions.ts";
import { startBrowserQuestionServer } from "../shared/session/browser-question.ts";
import { requestLocalReviewInteraction } from "../shared/session/local-review-interactions.ts";

Expand Down Expand Up @@ -43,10 +43,10 @@ function notifyClient(context, method, params) {
}

/**
* @param {{ context: any, acpSessionId: string, interaction: import('../shared/session/session-runtime-interactions.js').RuntimeInteractionRequest, signal?: AbortSignal }} options
* @param {{ context: any, acpSessionId: string, interaction: import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionRequest, signal?: AbortSignal }} options
*/
async function requestBrowserQuestion(options) {
/** @type {PromiseWithResolvers<import('../shared/session/session-runtime-interactions.js').RuntimeInteractionResponse>} */
/** @type {PromiseWithResolvers<import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionResponse>} */
const answered = Promise.withResolvers();
let used = false;
let origin = "";
Expand Down Expand Up @@ -145,7 +145,7 @@ async function requestBrowserQuestion(options) {
}

/**
* @param {import('../shared/session/session-runtime-interactions.js').RuntimeInteractionRequest} interaction
* @param {import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionRequest} interaction
*/
function buildSchema(interaction) {
if (interaction.type === RuntimeInteractionTypes.SELECT || interaction.type === RuntimeInteractionTypes.APPROVAL) {
Expand Down Expand Up @@ -188,8 +188,8 @@ function buildSchema(interaction) {
}

/**
* @param {{ context: any, acpSessionId: string, clientCapabilities?: unknown, presentChatQuestion?: (interaction: import('../shared/session/session-runtime-interactions.js').RuntimeInteractionRequest, signal?: AbortSignal) => Promise<import('../shared/session/session-runtime-interactions.js').RuntimeInteractionResponse> }} options
* @returns {import('../shared/session/session-runtime-interactions.js').RuntimeInteractionAdapter}
* @param {{ context: any, acpSessionId: string, clientCapabilities?: unknown, presentChatQuestion?: (interaction: import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionRequest, signal?: AbortSignal) => Promise<import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionResponse> }} options
* @returns {import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionAdapter}
*/
export function createAcpInteractionAdapter({ context, acpSessionId, clientCapabilities, presentChatQuestion }) {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/acp/interaction-mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { test } from "node:test";
*/

import { createAcpInteractionAdapter } from "./interaction-mapper.js";
import type { RuntimeInteractionRequest } from "../shared/session/session-runtime-interactions.js";
import type { RuntimeInteractionRequest } from "../shared/session/session-runtime-interactions.ts";

interface QuestionNotification {
update: {
Expand Down
10 changes: 5 additions & 5 deletions src/acp/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { formatChatQuestion, parseChatReply } from "./chat-interaction.ts";
import { buildAcpModelOptions } from "./model-options.ts";
import { getCommandDefinition, getSlashCommandDefinition, getSlashCommandDefinitions } from "../cmd/registry.js";
import { ProjectRuntimeEntryRefusedError } from "../shared/project-runtime-layout.ts";
import { RuntimeInteractionOutcomes, RuntimeInteractionTypes } from "../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionOutcomes, RuntimeInteractionTypes } from "../shared/session/session-runtime-interactions.ts";
import {
applyUserModelSelection,
listUserModelOptions,
Expand Down Expand Up @@ -526,7 +526,7 @@ async function notifyAcpContextUsage(context, runtime, sessionMap, runtimeSessio
*/
function createAcpCommandUiAPI(options) {
/**
* @param {import('../shared/session/session-runtime-interactions.js').RuntimeInteractionRequest['type']} type
* @param {import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionRequest['type']} type
* @param {string} title
* @param {AcpCommandSelectOption[]} choices
* @param {{ defaultValue?: string, placeholder?: string, allowEmpty?: boolean }} [requestOptions]
Expand Down Expand Up @@ -917,7 +917,7 @@ function createLiveOperation(options) {
let tail = Promise.resolve();
/** @type {PromiseWithResolvers<void>} */
let wake = Promise.withResolvers();
/** @type {{ interaction: import('../shared/session/session-runtime-interactions.js').RuntimeInteractionRequest, delivered: boolean, queued: boolean } | null} */
/** @type {{ interaction: import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionRequest, delivered: boolean, queued: boolean } | null} */
let question = null;
let settled = false;
let cancelled = false;
Expand Down Expand Up @@ -984,7 +984,7 @@ function createLiveOperation(options) {
message: "Interaction canceled.",
});
}
/** @type {PromiseWithResolvers<import('../shared/session/session-runtime-interactions.js').RuntimeInteractionResponse>} */
/** @type {PromiseWithResolvers<import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionResponse>} */
const answered = Promise.withResolvers();
const current = { interaction, delivered: false, queued: false };
question = current;
Expand Down Expand Up @@ -1235,7 +1235,7 @@ function createLiveOperation(options) {
cancel() {
cancelled = true;
},
/** @param {AcpNotificationContext & { requestId?: string | number | null }} context @param {string | undefined} expectedInteractionId @param {import('../shared/session/session-runtime-interactions.js').RuntimeInteractionResponse | null | undefined} reply @param {string} [feedback]
/** @param {AcpNotificationContext & { requestId?: string | number | null }} context @param {string | undefined} expectedInteractionId @param {import('../shared/session/session-runtime-interactions.ts').RuntimeInteractionResponse | null | undefined} reply @param {string} [feedback]
* @returns {Promise<import('@agentclientprotocol/sdk').PromptResponse>} */
async attach(context, expectedInteractionId, reply, feedback) {
attachRequest(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { InteractiveSessionPort } from "../../ui/tui/interactive-session-po
import type {
RuntimeInteractionRequest,
RuntimeInteractionResponse,
} from "../../shared/session/session-runtime-interactions.js";
} from "../../shared/session/session-runtime-interactions.ts";

interface InitUi {
messages: Array<{ message: string; error?: boolean }>;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/load-plan/plan-review-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
requestRecoverablePlanReview,
SESSION_COMPLETE_GUIDANCE,
} from "../../shared/workflow/plan-review-recovery.js";
import { RuntimeInteractionOutcomes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionOutcomes } from "../../shared/session/session-runtime-interactions.ts";
import type { UiAPI } from "../../ui/tui/types.js";
import { buildReReviewRevisionRequest } from "./plan-presentation.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/load-plan/plan-session-surface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { resetTuiState as resetTuiStateFn } from "../command-helpers.ts";
import {
RuntimeInteractionOutcomes,
RuntimeInteractionTypes,
} from "../../shared/session/session-runtime-interactions.js";
} from "../../shared/session/session-runtime-interactions.ts";
import type { SessionRuntime } from "../../shared/session/session-runtime.ts";
import type { UiAPI } from "../../ui/tui/types.js";
import type { PlanFrontMatter } from "../../plan-store.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ensurePlanIdentity, loadPlan, savePlan } from "../../plan-store.js";
import { createSessionRuntime } from "../../shared/session/session-runtime.ts";
import { openOwnerCoordinationStore } from "../../shared/owner-coordination/index.ts";
import { requestLocalReviewInteraction } from "../../shared/session/local-review-interactions.ts";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.ts";
import type { PlanReviewConversation } from "../../shared/session/plan-review-conversation.ts";
import { withRuntimeCommandFixture } from "../testing/runtime-command-fixture.ts";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { ensurePlanIdentity, loadPlan, savePlan } from "../../plan-store.js";
import { createSessionRuntime } from "../../shared/session/session-runtime.ts";
import { openOwnerCoordinationStore } from "../../shared/owner-coordination/index.ts";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.ts";
import { applySharedPlanReviewDecision } from "../../shared/workflow/plan-review-actions.ts";
import { withRuntimeCommandFixture } from "../testing/runtime-command-fixture.ts";
import type { SequenceReviewDocument } from "../../shared/workflow/sequence-review.ts";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { fauxAssistantMessage, fauxText } from "@earendil-works/pi-ai";
import { ensurePlanIdentity, loadPlan, savePlan } from "../../plan-store.js";
import { createSessionRuntime } from "../../shared/session/session-runtime.ts";
import { openOwnerCoordinationStore } from "../../shared/owner-coordination/index.ts";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.ts";
import { withRuntimeCommandFixture } from "../testing/runtime-command-fixture.ts";
import { createOwnerWorkspaceApp } from "../../ui/workspace/server.js";

Expand Down Expand Up @@ -50,7 +50,7 @@ test("a Session reopens the current saved Plan after its pending review process
import.meta.resolve("../../shared/owner-coordination/index.ts"),
)};
import { RuntimeInteractionTypes } from ${JSON.stringify(
import.meta.resolve("../../shared/session/session-runtime-interactions.js"),
import.meta.resolve("../../shared/session/session-runtime-interactions.ts"),
)};
const ownerStore = openOwnerCoordinationStore({ dbPath: ${JSON.stringify(
join(homeDir, "owner.sqlite3"),
Expand Down Expand Up @@ -195,7 +195,7 @@ test("Workspace opens and approves a saved Plan review after its owner is SIGKIL
import.meta.resolve("../../shared/owner-coordination/index.ts"),
)};
import { RuntimeInteractionTypes } from ${JSON.stringify(
import.meta.resolve("../../shared/session/session-runtime-interactions.js"),
import.meta.resolve("../../shared/session/session-runtime-interactions.ts"),
)};
const store = openOwnerCoordinationStore({ dbPath: ${JSON.stringify(join(homeDir, "owner.sqlite3"))} });
const runtime = createSessionRuntime({ sessionStore: store, ownerProcessKind: "test" });
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/load-plan/reopen-plan-review-launch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { withRuntimeCommandFixture } from "../testing/runtime-command-fixture.ts
import { createSessionRuntime } from "../../shared/session/session-runtime.ts";
import { openOwnerCoordinationStore } from "../../shared/owner-coordination/index.ts";
import { ensurePlanIdentity, savePlan } from "../../plan-store.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.ts";

test("a failed review launch does not claim the review was completed", async () => {
await withRuntimeCommandFixture("reopen-launch-", async ({ homeDir, projectRoot }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/load-plan/reopen-plan-review-live.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { test } from "node:test";
import { withRuntimeCommandFixture } from "../testing/runtime-command-fixture.ts";
import { createSessionRuntime } from "../../shared/session/session-runtime.ts";
import { openOwnerCoordinationStore } from "../../shared/owner-coordination/index.ts";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.ts";

test("reopening a live review returns its address without opening another review", async () => {
await withRuntimeCommandFixture("reopen-live-", async ({ homeDir, projectRoot }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { fauxAssistantMessage, fauxText, type TranscriptContext } from "@earendi
import { ensurePlanIdentity, loadPlan, savePlan } from "../../plan-store.js";
import { createSessionRuntime } from "../../shared/session/session-runtime.ts";
import { openOwnerCoordinationStore } from "../../shared/owner-coordination/index.ts";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.ts";
import type { SequenceReviewDocument } from "../../shared/workflow/sequence-review.ts";
import { withRuntimeCommandFixture } from "../testing/runtime-command-fixture.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/load-plan/reopen-plan-review-shapes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { withRuntimeCommandFixture } from "../testing/runtime-command-fixture.ts
import { createSessionRuntime } from "../../shared/session/session-runtime.ts";
import { openOwnerCoordinationStore } from "../../shared/owner-coordination/index.ts";
import { ensurePlanIdentity, loadPlan, savePlan } from "../../plan-store.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.ts";

for (const classification of ["PLANNED_CHANGE", "PROJECT"] as const) {
test(`an idle Session opens the current ${classification} Plan and cancellation leaves its status unchanged`, async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { defineCommittedGitFixture } from "../../shared/git-test-fixture.ts";
import { archivePlan, ensurePlanIdentity, loadPlan, savePlan } from "../../plan-store.js";
import { createSessionRuntime } from "../../shared/session/session-runtime.ts";
import { openOwnerCoordinationStore } from "../../shared/owner-coordination/index.ts";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.ts";
import { withRuntimeCommandFixture } from "../testing/runtime-command-fixture.ts";

const gitFixture = defineCommittedGitFixture();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from "../../shared/workflow/sequence-review.ts";
import { createSessionRuntime } from "../../shared/session/session-runtime.ts";
import { openOwnerCoordinationStore } from "../../shared/owner-coordination/index.ts";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.js";
import { RuntimeInteractionTypes } from "../../shared/session/session-runtime-interactions.ts";
import { withRuntimeCommandFixture } from "../testing/runtime-command-fixture.ts";
import { reopenSavedPlanReview } from "./reopen-plan-review.ts";

Expand Down
Loading
Loading