mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 01:24:30 +01:00
feat(dot): expand governed Runner capabilities and finish pairing setup
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
426e9fac15
commit
ebc99db2f5
45 files changed
+1409
-105
No files matched your search
@@ -98,7 +98,7 @@ export function buildPaperclipRunnerConfig(v: CreateConfigValues): Record<string
|
||||
? providerCandidate
|
||||
: "codex";
|
||||
if (provider === "openai_dot") {
|
||||
return { provider, lifecycleMode: "per_turn", allowUnmeteredProvider: schemaValues.allowUnmeteredProvider === true,
|
||||
return { provider, lifecycleMode: "per_turn", allowUnmeteredProvider: schemaValues.allowUnmeteredProvider === true, dotWorkspaceAccess: schemaValues.dotWorkspaceAccess === true,
|
||||
...(typeof schemaValues.dotBindingId === "string" ? { dotBindingId: schemaValues.dotBindingId } : {}) };
|
||||
}
|
||||
const selectedAcpxProfile = PAPERCLIP_RUNNER_ACPX_PROFILES.find(profile => profile.value === schemaValues.acpxAgent);
|
||||
|
||||
@@ -74,7 +74,7 @@ export const dotMailboxItems = pgTable("dot_mailbox_items", {
|
||||
bindingId: uuid("binding_id").notNull().references(() => dotAgentBindings.id, { onDelete: "cascade" }),
|
||||
bindingGeneration: integer("binding_generation").notNull(),
|
||||
assignmentId: uuid("assignment_id").references(() => dotRunnerAssignments.id, { onDelete: "cascade" }),
|
||||
kind: text("kind").$type<"assignment" | "operation_result" | "authority_revoked" | "readiness_challenge">().notNull(),
|
||||
kind: text("kind").$type<"assignment" | "operation_result" | "authority_revoked" | "readiness_challenge" | "follow_up">().notNull(),
|
||||
sourceEventId: text("source_event_id").notNull(),
|
||||
// References only. Task content and tool results stay in authorized projections.
|
||||
references: jsonb("references").$type<Record<string, unknown>>().notNull(),
|
||||
|
||||
@@ -1 +1 @@
|
||||
[{"annotations":{"exposure":"always","operationId":"get_task_context","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Read the active task and actor, including the exact approved Markdown revision when this issue has an accepted plan.","inputSchema":{"additionalProperties":false,"properties":{},"required":[],"type":"object"},"name":"get_task_context","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"get_task_history","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Read bounded comments on the active task.","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},"required":[],"type":"object"},"name":"get_task_history","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"list_documents","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"List revisioned documents on the active task.","inputSchema":{"additionalProperties":false,"properties":{},"required":[],"type":"object"},"name":"list_documents","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"read_document","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Read the current revision of one active-task document.","inputSchema":{"additionalProperties":false,"properties":{"key":{"description":"Stable issue-document key.","maxLength":120,"minLength":1,"type":"string"}},"required":["key"],"type":"object"},"name":"read_document","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"list_document_revisions","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Read bounded revision history for one active-task document.","inputSchema":{"additionalProperties":false,"properties":{"key":{"description":"Stable issue-document key.","maxLength":120,"minLength":1,"type":"string"},"limit":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},"required":["key"],"type":"object"},"name":"list_document_revisions","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"report_progress","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Append a durable progress comment to the active task.","inputSchema":{"additionalProperties":false,"properties":{"body":{"description":"Multiline progress update.","maxLength":20000,"minLength":1,"type":"string"},"idempotencyKey":{"description":"Caller-stable retry key.","maxLength":240,"minLength":1,"type":"string"}},"required":["idempotencyKey","body"],"type":"object"},"name":"report_progress","outputSchema":{"additionalProperties":false,"properties":{"commandId":{"description":"Stable command identifier.","maxLength":200,"minLength":1,"type":"string"},"disposition":{"enum":["applied","duplicate"]},"entityRefs":{"description":"Entities affected by the operation.","items":{"minLength":1,"type":"string"},"maxItems":200,"type":"array","uniqueItems":true},"scheduledWakeIds":{"description":"Wake identifiers scheduled by the operation.","items":{"minLength":1,"type":"string"},"maxItems":200,"type":"array","uniqueItems":true},"stateRevision":{"minimum":0,"type":"integer"}},"required":["commandId","disposition","stateRevision","entityRefs","scheduledWakeIds"],"type":"object"}},{"annotations":{"exposure":"always","operationId":"answer_status_question","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Append the answer to a status-only wake without changing task disposition.","inputSchema":{"additionalProperties":false,"properties":{"body":{"description":"Concise status answer.","maxLength":20000,"minLength":1,"type":"string"},"idempotencyKey":{"description":"Caller-stable retry key.","maxLength":240,"minLength":1,"type":"string"}},"required":["idempotencyKey","body"],"type":"object"},"name":"answer_status_question","outputSchema":{"additionalProperties":false,"properties":{"commandId":{"description":"Stable command identifier.","maxLength":200,"minLength":1,"type":"string"},"disposition":{"enum":["applied","duplicate"]},"entityRefs":{"description":"Entities affected by the operation.","items":{"minLength":1,"type":"string"},"maxItems":200,"type":"array","uniqueItems":true},"scheduledWakeIds":{"description":"Wake identifiers scheduled by the operation.","items":{"minLength":1,"type":"string"},"maxItems":200,"type":"array","uniqueItems":true},"stateRevision":{"minimum":0,"type":"integer"}},"required":["commandId","disposition","stateRevision","entityRefs","scheduledWakeIds"],"type":"object"}},{"annotations":{"exposure":"always","operationId":"write_document","requiredClaimLine truncated
|
||||
[{"annotations":{"exposure":"always","operationId":"get_task_context","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Read the active task and actor, including the exact approved Markdown revision when this issue has an accepted plan.","inputSchema":{"additionalProperties":false,"properties":{},"required":[],"type":"object"},"name":"get_task_context","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"get_task_history","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Read bounded comments on the active task.","inputSchema":{"additionalProperties":false,"properties":{"limit":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},"required":[],"type":"object"},"name":"get_task_history","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"list_documents","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"List revisioned documents on the active task.","inputSchema":{"additionalProperties":false,"properties":{},"required":[],"type":"object"},"name":"list_documents","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"read_document","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Read the current revision of one active-task document.","inputSchema":{"additionalProperties":false,"properties":{"key":{"description":"Stable issue-document key.","maxLength":120,"minLength":1,"type":"string"}},"required":["key"],"type":"object"},"name":"read_document","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"list_document_revisions","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Read bounded revision history for one active-task document.","inputSchema":{"additionalProperties":false,"properties":{"key":{"description":"Stable issue-document key.","maxLength":120,"minLength":1,"type":"string"},"limit":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},"required":["key"],"type":"object"},"name":"list_document_revisions","outputSchema":{"additionalProperties":true,"type":"object"}},{"annotations":{"exposure":"always","operationId":"report_progress","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Append a durable progress comment to the active task.","inputSchema":{"additionalProperties":false,"properties":{"body":{"description":"Multiline progress update.","maxLength":20000,"minLength":1,"type":"string"},"idempotencyKey":{"description":"Caller-stable retry key.","maxLength":240,"minLength":1,"type":"string"}},"required":["idempotencyKey","body"],"type":"object"},"name":"report_progress","outputSchema":{"additionalProperties":false,"properties":{"commandId":{"description":"Stable command identifier.","maxLength":200,"minLength":1,"type":"string"},"disposition":{"enum":["applied","duplicate"]},"entityRefs":{"description":"Entities affected by the operation.","items":{"minLength":1,"type":"string"},"maxItems":200,"type":"array","uniqueItems":true},"scheduledWakeIds":{"description":"Wake identifiers scheduled by the operation.","items":{"minLength":1,"type":"string"},"maxItems":200,"type":"array","uniqueItems":true},"stateRevision":{"minimum":0,"type":"integer"}},"required":["commandId","disposition","stateRevision","entityRefs","scheduledWakeIds"],"type":"object"}},{"annotations":{"exposure":"always","operationId":"answer_status_question","requiredClaims":[],"semanticContract":"paperclip.semantic-tool.v1","version":1},"description":"Append the answer to a status-only wake without changing task disposition.","inputSchema":{"additionalProperties":false,"properties":{"body":{"description":"Concise status answer.","maxLength":20000,"minLength":1,"type":"string"},"idempotencyKey":{"description":"Caller-stable retry key.","maxLength":240,"minLength":1,"type":"string"}},"required":["idempotencyKey","body"],"type":"object"},"name":"answer_status_question","outputSchema":{"additionalProperties":false,"properties":{"commandId":{"description":"Stable command identifier.","maxLength":200,"minLength":1,"type":"string"},"disposition":{"enum":["applied","duplicate"]},"entityRefs":{"description":"Entities affected by the operation.","items":{"minLength":1,"type":"string"},"maxItems":200,"type":"array","uniqueItems":true},"scheduledWakeIds":{"description":"Wake identifiers scheduled by the operation.","items":{"minLength":1,"type":"string"},"maxItems":200,"type":"array","uniqueItems":true},"stateRevision":{"minimum":0,"type":"integer"}},"required":["commandId","disposition","stateRevision","entityRefs","scheduledWakeIds"],"type":"object"}},{"annotations":{"exposure":"always","operationId":"write_document","requiredClaimLine truncated
|
||||
@@ -1674,9 +1674,18 @@
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"assigneeActorId": {
|
||||
"description": "New company agent ID from list_agents.",
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
"description": "New company agent ID from list_agents; null when assigning a person.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"assigneeUserId": {
|
||||
"description": "Company person ID from list_people. Mutually exclusive with assigneeActorId.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"expectedAssigneeActorId": {
|
||||
"description": "Current assigneeAgentId from search_tasks; null means unassigned.",
|
||||
@@ -1685,6 +1694,13 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"expectedAssigneeUserId": {
|
||||
"description": "Current assigneeUserId from search_tasks; omit only when there is no person assigned.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"expectedStatusVersion": {
|
||||
"description": "Current statusVersion from search_tasks.",
|
||||
"minimum": 0,
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"prpVersion": 1,
|
||||
"nativeExecutionVersion": 1,
|
||||
"catalogVersion": 1,
|
||||
"catalogSha256": "sha256:c1d5a0b1008f9eb582aa91acf64804ef0dbb272a3117ac1a58ad22c91b7a1cb4",
|
||||
"catalogSha256": "sha256:2fba572bf222f7a770dfaf1ac23bfddc0a34ac125fed865b2ae36091fe0cae61",
|
||||
"driverContractVersion": 1,
|
||||
"driverKind": "paperclip-deterministic",
|
||||
"driverVersion": "1.0.0"
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
},
|
||||
{
|
||||
"path": "fixtures/evals/native-execution-seeded.json",
|
||||
"sha256": "38a46fbb0d8721db2a8c10d58344d861d4e5970c7db165bfa409f5f7b07a058b",
|
||||
"sha256": "28a7a9e36758954829fa2490cc186be5357e350b8ec06ef13b97d1c3274ad8f4",
|
||||
"expectation": "accept",
|
||||
"compatibilityCase": "canonical"
|
||||
},
|
||||
|
||||
@@ -165,6 +165,7 @@ impl State {
|
||||
"tool" => &["name", "arguments"],
|
||||
"progress" => &["text"],
|
||||
"finish" => &["result"],
|
||||
"renew" => &["expiresAtUnixMs"],
|
||||
_ => return Err(invalid("Dot action is unsupported")),
|
||||
};
|
||||
if op.input.as_object().is_none_or(|input| {
|
||||
@@ -409,6 +410,20 @@ impl DotCommandExecutor {
|
||||
// ACK releases the command lane. semantic_tool.result settles this operation later.
|
||||
return Ok(json!({"status":"pending","requestId":id}));
|
||||
}
|
||||
"renew" => {
|
||||
let expiry = op.input["expiresAtUnixMs"]
|
||||
.as_u64()
|
||||
.ok_or_else(|| invalid("Dot renewal expiry missing"))?;
|
||||
if state.lifecycle != "running"
|
||||
|| expiry <= now
|
||||
|| expiry > now + 2 * 60 * 60 * 1000
|
||||
|| expiry > state.descriptor.accept_by_unix_ms + 24 * 60 * 60 * 1000
|
||||
{
|
||||
return Err(invalid("Dot renewal exceeds current authority bounds"));
|
||||
}
|
||||
state.descriptor.expires_at_unix_ms = expiry;
|
||||
json!({"status":"renewed","expiresAtUnixMs":expiry})
|
||||
}
|
||||
"progress" => {
|
||||
if state.lifecycle != "running" {
|
||||
return Err(invalid("Dot turn is not running"));
|
||||
@@ -817,6 +832,50 @@ mod tests {
|
||||
operation("accept-1", "accept", json!({})),
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn renewal_is_durable_bounded_and_cannot_revive_fenced_authority() {
|
||||
let dir = TestDirectory::new();
|
||||
let mut executor = prepared(dir.path());
|
||||
call(
|
||||
&mut executor,
|
||||
"external_provider.operation",
|
||||
operation("accept", "accept", json!({})),
|
||||
);
|
||||
let expiry = crate::durable::current_unix_ms().unwrap() + 60 * 60 * 1000;
|
||||
let renew = operation("renew", "renew", json!({"expiresAtUnixMs":expiry}));
|
||||
assert_eq!(
|
||||
call(&mut executor, "external_provider.operation", renew.clone())["status"],
|
||||
"renewed"
|
||||
);
|
||||
assert_eq!(
|
||||
call(&mut executor, "external_provider.operation", renew.clone())["expiresAtUnixMs"],
|
||||
expiry
|
||||
);
|
||||
assert!(executor
|
||||
.execute(&command(
|
||||
"external_provider.operation",
|
||||
operation(
|
||||
"too-long",
|
||||
"renew",
|
||||
json!({"expiresAtUnixMs":expiry + 24 * 60 * 60 * 1000})
|
||||
)
|
||||
))
|
||||
.is_err());
|
||||
drop(executor);
|
||||
let mut recovered = DotCommandExecutor::with_runner_config(dir.path(), &config(dir.path()));
|
||||
assert_eq!(
|
||||
call(&mut recovered, "external_provider.operation", renew)["expiresAtUnixMs"],
|
||||
expiry
|
||||
);
|
||||
recovered.state.as_mut().unwrap().lifecycle = "fenced".into();
|
||||
assert!(recovered
|
||||
.execute(&command(
|
||||
"external_provider.operation",
|
||||
operation("fenced", "renew", json!({"expiresAtUnixMs":expiry}))
|
||||
))
|
||||
.is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn acceptance_is_explicit_and_tool_receipts_survive_restart_without_reexecution() {
|
||||
let dir = TestDirectory::new();
|
||||
|
||||
@@ -11,6 +11,7 @@ import type {
|
||||
import type { CodexAppServerTransport } from "../drivers/codex/app-server-transport.js";
|
||||
import { CodexAppServerDriver } from "../drivers/codex/codex-app-server-driver.js";
|
||||
import type { CodexWorkingDirectoryAuthority } from "../drivers/codex/codex-boundaries.js";
|
||||
import { describeRunnerdDotDriver } from "../drivers/dot/runnerd-dot-driver.js";
|
||||
import { HarnessDriverBackend } from "./harness-driver-backend.js";
|
||||
import {
|
||||
nativeSystemInstructions,
|
||||
@@ -202,6 +203,17 @@ function createTransportBackedNativeSessionBackend(
|
||||
export function describeRunnerdNativeSessionBackend(
|
||||
input: NativeExecutionInput,
|
||||
): Promise<NativeSessionBackendDescriptor> {
|
||||
if (input.schema === "paperclip.native-execution-input.v6") {
|
||||
// Dot uses its dedicated Rust bridge, rather than the JSON-RPC facade.
|
||||
const descriptor = describeRunnerdDotDriver();
|
||||
return Promise.resolve({
|
||||
kind: "runner",
|
||||
name: descriptor.kind,
|
||||
version: descriptor.version,
|
||||
capabilities: descriptor.capabilities,
|
||||
runtimeContextCapabilities: descriptor.runtimeContextCapabilities,
|
||||
});
|
||||
}
|
||||
return createTransportBackedNativeSessionBackend(input, {}).descriptor();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export function nativeSystemInstructions(input: NativeExecutionInput): string {
|
||||
const entry = readFileSync(entryPath, "utf8");
|
||||
if (input.provider.kind === "openai_dot") {
|
||||
return [input.runtimeContext.prompt.text, entry.trim(),
|
||||
"This provider has no mounted workspace. Use Paperclip semantic tools for task coordination and write_document for durable text deliverables. Assigned skills and third-party MCP tools are currently unsupported.",
|
||||
"This provider has no mounted workspace. Use Paperclip semantic tools for task coordination and write_document for durable text deliverables. Read pinned skills with list_assigned_skills and read_assigned_skill. Assigned app tools run through the Paperclip MCP gateway with normal permissions and approvals. If workspace tools are advertised, use them for files and sandboxed commands, then register_deliverable for requested downloadable files. Use get_identity and list_people to discover the responsible person and assignees. Read the current catalog before concluding a capability is unavailable.",
|
||||
`Assigned skills: ${input.runtimeContext.skills.map(skill => skill.runtimeName).join(", ") || "none"}.`].join("\n\n");
|
||||
}
|
||||
return composeNativeSystemInstructions(input.runtimeContext, entry);
|
||||
|
||||
@@ -24,7 +24,7 @@ export interface ExternalProviderOperation {
|
||||
turnId: string;
|
||||
assignmentRevision: number;
|
||||
digest: string;
|
||||
action: "accept" | "tool" | "progress" | "finish";
|
||||
action: "accept" | "tool" | "progress" | "finish" | "renew";
|
||||
input: Record<string, unknown>;
|
||||
}
|
||||
/** Broker port uses only the authenticated run's existing PRP command lane. */
|
||||
|
||||
@@ -4,6 +4,8 @@ import { tmpdir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
import { expect, it, vi } from "vitest";
|
||||
import { RunnerdDotDriver, type RunnerdDotDriverOptions } from "./runnerd-dot-driver.js";
|
||||
import { describeRunnerdNativeSessionBackend } from "../../backends/codex-native-backend.js";
|
||||
import { createNativeSessionBackend } from "../../backends/native-backend-factory.js";
|
||||
import * as controlPlane from "../../control-plane/durable-prp-control-plane.js";
|
||||
import { externalOperationDigest, type ExternalProviderOperation } from "../../contracts/external-provider.js";
|
||||
import { buildNativeModelEnvelope, parseNativeExecutionInput, type NativeExecutionInputV6 } from "../../contracts/native-execution.js";
|
||||
@@ -48,6 +50,33 @@ it("v6 closes Dot identity, workspace, model and credential fields", () => {
|
||||
]) expect(() => parseNativeExecutionInput(changed)).toThrow();
|
||||
});
|
||||
|
||||
it("admits the heartbeat descriptor with the real Dot capabilities and no broker or process startup", async () => {
|
||||
const input = execution("/synthetic/pinned-instructions");
|
||||
const spawnSpy = vi.spyOn(controlPlane, "spawnRunner");
|
||||
try {
|
||||
const descriptor = await describeRunnerdNativeSessionBackend(input);
|
||||
const backend = createNativeSessionBackend(input, {
|
||||
dotRunnerOptions: {
|
||||
stateDirectory: "/must-not-be-created",
|
||||
identity: { runnerInstanceId: randomUUID(), environmentLeaseId: randomUUID(), runId: input.binding.runId,
|
||||
normalizedSessionId: input.session.normalizedSessionId!, turnId: "turn", itemId: "item" },
|
||||
port: {
|
||||
dispatch: async () => { throw new Error("Descriptor must not dispatch work"); },
|
||||
settle: async () => { throw new Error("Descriptor must not settle work"); },
|
||||
attach: async () => { throw new Error("Descriptor must not attach a broker"); },
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(descriptor).toEqual(await backend.descriptor());
|
||||
expect(descriptor).toMatchObject({
|
||||
kind: "runner", name: "openai_dot_mcp", version: "dot-mcp-v1",
|
||||
capabilities: { resume: false, steering: false, interruption: false, usage: false, dynamicTools: true },
|
||||
runtimeContextCapabilities: { instructions: "native", skills: "native", mcp: "native" },
|
||||
});
|
||||
expect(spawnSpy).not.toHaveBeenCalled();
|
||||
} finally { spawnSpy.mockRestore(); }
|
||||
});
|
||||
|
||||
it.each(["shutdown", "unexpected exit"] as const)("classifies a real Rust %s before the next command poll", async kind => {
|
||||
const root = await mkdtemp(join(tmpdir(), "dot-driver-exit-"));
|
||||
await writeFile(join(root, "AGENTS.md"), "Use only the synthetic counter.");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { existsSync, mkdirSync, readFileSync, statSync } from "node:fs";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { resolve } from "node:path";
|
||||
import type { HarnessDriver, HarnessSession, OpenHarnessSessionInput, PersistedHarnessSession } from "../../contracts/harness-driver.js";
|
||||
import type { HarnessDriver, HarnessDriverDescriptor, HarnessSession, OpenHarnessSessionInput, PersistedHarnessSession } from "../../contracts/harness-driver.js";
|
||||
import type { NativeExecutionInputV6 } from "../../contracts/native-execution.js";
|
||||
import type { ExternalProviderPort } from "../../contracts/external-provider.js";
|
||||
import type { PrpEvent } from "../../protocol/replay-contract.js";
|
||||
@@ -33,12 +33,17 @@ const capabilities = {
|
||||
dynamicTools: true, unsupported: ["resume", "steering", "interruption", "usage", "goals", "runtimeRequestResolution", "threadLineage"],
|
||||
};
|
||||
|
||||
/** The admission path can inspect Dot without allocating a broker port or Runner. */
|
||||
export function describeRunnerdDotDriver(): HarnessDriverDescriptor {
|
||||
return { kind: "openai_dot_mcp", displayName: "OpenAI Dot", version: "dot-mcp-v1", protocolVersion: "prp.v3",
|
||||
capabilities: structuredClone(capabilities), runtimeContextCapabilities: { instructions: "native", skills: "native", mcp: "native" } };
|
||||
}
|
||||
|
||||
/** Thin SDK projection. Rust owns every lifecycle decision and durable receipt. */
|
||||
export class RunnerdDotDriver implements HarnessDriver {
|
||||
constructor(readonly options: RunnerdDotDriverOptions) {}
|
||||
async descriptor() {
|
||||
return { kind: "openai_dot_mcp", displayName: "OpenAI Dot", version: "dot-mcp-v1", protocolVersion: "prp.v3",
|
||||
capabilities, runtimeContextCapabilities: { instructions: "native" as const, skills: "unsupported" as const, mcp: "unsupported" as const } };
|
||||
return describeRunnerdDotDriver();
|
||||
}
|
||||
async openSession(input: OpenHarnessSessionInput): Promise<HarnessSession> {
|
||||
if (input.runId !== this.options.identity.runId || input.normalizedSessionId !== this.options.identity.normalizedSessionId) {
|
||||
|
||||
@@ -109,6 +109,7 @@ export const createTaskAction = {
|
||||
"description": "Child task description.",
|
||||
"maxLength": 20000
|
||||
},
|
||||
"assigneeUserId": { "type": ["string", "null"], "description": "Company person ID from list_people. Mutually exclusive with assigneeActorId." },
|
||||
"assigneeActorId": {
|
||||
"type": [
|
||||
"string",
|
||||
@@ -225,7 +226,8 @@ export const createTaskAction = {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"assigneeActorId": {
|
||||
"assigneeUserId": { "type": ["string", "null"], "description": "Company person ID from list_people. Mutually exclusive with assigneeActorId." },
|
||||
"assigneeActorId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -271,6 +273,7 @@ export const createTaskAction = {
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"assigneeUserId": { "type": ["string", "null"], "description": "Company person ID from list_people. Mutually exclusive with assigneeActorId." },
|
||||
"assigneeActorId": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -97,11 +97,12 @@ export const reassignTaskAction = {
|
||||
"minLength": 1,
|
||||
"description": "Existing task ID from search_tasks."
|
||||
},
|
||||
"assigneeUserId": { "type": ["string", "null"], "description": "Company person ID from list_people. Mutually exclusive with assigneeActorId." },
|
||||
"assigneeActorId": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"description": "New company agent ID from list_agents."
|
||||
"type": ["string", "null"],
|
||||
"description": "New company agent ID from list_agents; null when assigning a person."
|
||||
},
|
||||
"expectedAssigneeUserId": { "type": ["string", "null"], "description": "Current assigneeUserId from search_tasks; omit only when there is no person assigned." },
|
||||
"expectedAssigneeActorId": {
|
||||
"type": [
|
||||
"string",
|
||||
@@ -197,11 +198,12 @@ export const reassignTaskAction = {
|
||||
"minLength": 1,
|
||||
"description": "Existing task ID from search_tasks."
|
||||
},
|
||||
"assigneeUserId": { "type": ["string", "null"], "description": "Company person ID from list_people. Mutually exclusive with assigneeActorId." },
|
||||
"assigneeActorId": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"description": "New company agent ID from list_agents."
|
||||
"type": ["string", "null"],
|
||||
"description": "New company agent ID from list_agents; null when assigning a person."
|
||||
},
|
||||
"expectedAssigneeUserId": { "type": ["string", "null"], "description": "Current assigneeUserId from search_tasks; omit only when there is no person assigned." },
|
||||
"expectedAssigneeActorId": {
|
||||
"type": [
|
||||
"string",
|
||||
|
||||
@@ -45,3 +45,12 @@ export interface McpConnection {
|
||||
createdAt: string;
|
||||
revokedAt: string | null;
|
||||
}
|
||||
|
||||
/** Code-scoped details shown before activating an operator-approved Dot agent. */
|
||||
export interface McpDotPairingPreview {
|
||||
company: { id: string; name: string };
|
||||
agent: { id: string; name: string };
|
||||
permissions: string;
|
||||
accessDuration: string;
|
||||
pairingExpiresAt: string;
|
||||
}
|
||||
Reference in new issue
Block a user