@liy/mote-pi-runtime 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +9 -4
- package/dist/assets/skills/orchestrator/SKILL.md +24 -3
- package/dist/cli.js +34 -20
- package/dist/cli.js.map +4 -4
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -51,11 +51,16 @@ Agent profiles link to the stable `current` names, so a version swap needs no
|
|
|
51
51
|
profile rewrite. The orchestrator resolves `current` when it spawns, not at
|
|
52
52
|
boot, which is what lets an update land without restarting anything.
|
|
53
53
|
|
|
54
|
-
##
|
|
54
|
+
## Compatibility with the services
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
it
|
|
58
|
-
|
|
56
|
+
Nothing pairs the two packages by declaration. Semantic versioning carries that
|
|
57
|
+
judgement, as it does for every published package: a release that changes either
|
|
58
|
+
direction of the interface says so in its version.
|
|
59
|
+
|
|
60
|
+
One coupling is checked directly rather than by convention, because its failure
|
|
61
|
+
is silent: the services refuse to publish a staged version of this package whose
|
|
62
|
+
`extensions` and `skills` names do not resolve, since every agent profile links
|
|
63
|
+
to them and a relocated directory would quietly empty each profile.
|
|
59
64
|
|
|
60
65
|
## Release
|
|
61
66
|
|
|
@@ -48,7 +48,7 @@ orchestrator app update <app-id> "<shared brief>" # O
|
|
|
48
48
|
orchestrator ticket list --status <waiting|ongoing|intervention|done> [--unassigned]
|
|
49
49
|
orchestrator ticket get <ticket-id> # general ticket information
|
|
50
50
|
orchestrator ticket create '{"title":"...","summary":"...","description":"...","scope":["code"],"appId":"..."}' # appId optional; omit for standalone work
|
|
51
|
-
orchestrator ticket assign '{"ticketId":"...","assigneeAgentId":"..."}' # Overmind only; optional summary adds context
|
|
51
|
+
orchestrator ticket assign '{"ticketId":"...","assigneeAgentId":"..."}' # Overmind only; own agents only; optional summary adds context
|
|
52
52
|
orchestrator ticket park '{"ticketId":"...","summary":"<required human action or blocker>"}' # Overmind only; waiting tickets only
|
|
53
53
|
orchestrator ticket unpark '{"ticketId":"...","summary":"<why it can proceed>"}' # Overmind only
|
|
54
54
|
orchestrator ticket done '{"ticketId":"...","summary":"<acceptance>"}' # Overmind only
|
|
@@ -137,12 +137,33 @@ checks. Overmind marks the ticket done only after integration evidence is
|
|
|
137
137
|
present. Cleanup removes only clean, merged worktrees and branches and never
|
|
138
138
|
forces deletion.
|
|
139
139
|
|
|
140
|
+
## Ownership boundary
|
|
141
|
+
|
|
142
|
+
Every agent belongs to exactly one user, and so does every ticket. You act for
|
|
143
|
+
your own user alone: `agent list`, `agent get` and `agent prompt` show only
|
|
144
|
+
your own agents, and every judgment verb — `assign`, `park`, `unpark`, `done`,
|
|
145
|
+
`archive`, `unarchive`, plus the `guide` and `decision` notes — is limited to
|
|
146
|
+
tickets your user owns. Assignment
|
|
147
|
+
launches the Drone under its owner, so assigning an agent you do not own would
|
|
148
|
+
run work under someone else's identity; it is rejected, as is acting on another
|
|
149
|
+
user's ticket. Pick the assignee from your own `agent list` by role. Another
|
|
150
|
+
user's board work is dispatched to their own Overmind, never to you.
|
|
151
|
+
|
|
152
|
+
Reads are Org-wide and stay open: `ticket list`, `ticket get`, `ticket brief`,
|
|
153
|
+
`ticket worklog` and `ticket timeline` show every ticket in the Org, so the
|
|
154
|
+
board you see is wider than the board you may act on. Read another user's
|
|
155
|
+
ticket freely for context, including which of their agents holds it; write
|
|
156
|
+
only to your own. A write on another user's ticket is refused as
|
|
157
|
+
`ticket_owner_mismatch`.
|
|
158
|
+
|
|
140
159
|
## Board model
|
|
141
160
|
|
|
142
161
|
- `waiting` is the judgment queue: every finished Drone run lands its ticket
|
|
143
162
|
back here, unassigned, for Overmind to resolve — assign (re-assigning the
|
|
144
|
-
same agent resumes its session), park, or done.
|
|
145
|
-
|
|
163
|
+
same agent resumes its session), park, or done. Unassigned does not mean
|
|
164
|
+
unowned: a released ticket keeps the owner it was created with. Overmind
|
|
165
|
+
must resolve every unassigned `waiting` ticket **its own user owns**; the
|
|
166
|
+
native timeline records
|
|
146
167
|
how the last run ended and the Gen App build result. Dispatch is
|
|
147
168
|
automatic: the orchestrator spawns the ticket owner's Overmind for a
|
|
148
169
|
board assessment shortly after judgment work appears. Do not poll.
|
package/dist/cli.js
CHANGED
|
@@ -4,10 +4,12 @@ import { createRequire as ___liy_mote_pi_runtimeCreateRequire } from "node:modul
|
|
|
4
4
|
// ../sandbox-orchestrator/dist/index.js
|
|
5
5
|
import { createRequire as ___liy_sandbox_orchestratorCreateRequire } from "node:module";
|
|
6
6
|
import { execFile } from "node:child_process";
|
|
7
|
-
import { dirname as dirname2 } from "node:path";
|
|
8
7
|
import { promisify } from "node:util";
|
|
8
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
9
|
+
import { dirname as dirname2 } from "node:path";
|
|
10
|
+
import { promisify as promisify2 } from "node:util";
|
|
9
11
|
import { DatabaseSync } from "node:sqlite";
|
|
10
|
-
import { randomUUID as
|
|
12
|
+
import { randomUUID as randomUUID10 } from "node:crypto";
|
|
11
13
|
import { connect } from "node:net";
|
|
12
14
|
import { createInterface } from "node:readline";
|
|
13
15
|
var require2 = ___liy_sandbox_orchestratorCreateRequire(import.meta.url);
|
|
@@ -16,6 +18,7 @@ var __export = (target, all) => {
|
|
|
16
18
|
for (var name in all)
|
|
17
19
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
20
|
};
|
|
21
|
+
var AGENT_COVERS_MAX_LENGTH = 1e3;
|
|
19
22
|
var external_exports = {};
|
|
20
23
|
__export(external_exports, {
|
|
21
24
|
$brand: () => $brand,
|
|
@@ -13798,14 +13801,13 @@ var channelPrincipalSchema = external_exports.object({
|
|
|
13798
13801
|
principalId: external_exports.string().trim().uuid(),
|
|
13799
13802
|
kind: external_exports.enum(["user", "agent"]),
|
|
13800
13803
|
displayName: external_exports.string().trim().min(1).max(160),
|
|
13801
|
-
ownerUserId: external_exports.string().trim().uuid().optional()
|
|
13804
|
+
ownerUserId: external_exports.string().trim().uuid().optional(),
|
|
13805
|
+
covers: external_exports.string().trim().min(1).max(AGENT_COVERS_MAX_LENGTH).optional()
|
|
13802
13806
|
}).strict().superRefine((value, context) => {
|
|
13803
|
-
|
|
13804
|
-
|
|
13805
|
-
code: "custom",
|
|
13806
|
-
|
|
13807
|
-
message: "ownerUserId is required exactly for agent principals"
|
|
13808
|
-
});
|
|
13807
|
+
for (const field of ["ownerUserId", "covers"]) {
|
|
13808
|
+
if (value.kind === "agent" !== (value[field] !== void 0)) {
|
|
13809
|
+
context.addIssue({ code: "custom", path: [field], message: `${field} is required exactly for agent principals` });
|
|
13810
|
+
}
|
|
13809
13811
|
}
|
|
13810
13812
|
});
|
|
13811
13813
|
var channelPrincipalListSchema = external_exports.object({
|
|
@@ -13863,8 +13865,7 @@ var ticketScopeSchema = external_exports.enum(TICKET_SCOPES);
|
|
|
13863
13865
|
var ticketBoardProjectionShape = {
|
|
13864
13866
|
id: external_exports.string().trim().uuid(),
|
|
13865
13867
|
initiatorPrincipalId: external_exports.string().trim().uuid(),
|
|
13866
|
-
|
|
13867
|
-
ownerUserId: external_exports.string().trim().uuid().nullable().default(null),
|
|
13868
|
+
ownerUserId: external_exports.string().trim().uuid(),
|
|
13868
13869
|
title: external_exports.string(),
|
|
13869
13870
|
description: external_exports.string(),
|
|
13870
13871
|
status: ticketStatusSchema,
|
|
@@ -14069,6 +14070,20 @@ var applicantApplicationProjectionSchema = external_exports.object({
|
|
|
14069
14070
|
var orgCodeSubmissionSchema = external_exports.object({
|
|
14070
14071
|
orgCode: orgCodeSchema
|
|
14071
14072
|
}).strict();
|
|
14073
|
+
var orgProviderSubmissionSchema = external_exports.object({
|
|
14074
|
+
providerKind: external_exports.string().trim().toLowerCase().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
14075
|
+
credential: external_exports.string().trim().min(1).max(8 * 1024)
|
|
14076
|
+
}).strict();
|
|
14077
|
+
var orgProviderVerificationSchema = external_exports.object({
|
|
14078
|
+
verified: external_exports.boolean(),
|
|
14079
|
+
reason: external_exports.enum(["rejected", "unreachable"]).optional(),
|
|
14080
|
+
message: external_exports.string().trim().min(1).max(500).optional()
|
|
14081
|
+
}).strict();
|
|
14082
|
+
var orgProviderKindOptionSchema = external_exports.object({
|
|
14083
|
+
providerKind: external_exports.string().trim().min(1).max(100),
|
|
14084
|
+
displayName: external_exports.string().trim().min(1).max(120),
|
|
14085
|
+
defaultModel: external_exports.string().trim().min(1).max(160)
|
|
14086
|
+
}).strict();
|
|
14072
14087
|
var orgCodeAvailabilitySchema = external_exports.object({
|
|
14073
14088
|
orgCode: external_exports.string().trim().min(1).max(63),
|
|
14074
14089
|
availability: external_exports.enum(["available", "invalid", "taken"])
|
|
@@ -14234,6 +14249,11 @@ var MAX_HTTP_BODY_BYTES = 1024 * 1024;
|
|
|
14234
14249
|
var ensureQueue = Promise.resolve();
|
|
14235
14250
|
var profileUpdates = Promise.resolve();
|
|
14236
14251
|
var execFileAsync = promisify(execFile);
|
|
14252
|
+
var PI_RUNTIME_ALIASES = Object.freeze([
|
|
14253
|
+
Object.freeze({ path: "extensions", target: "dist/extensions" }),
|
|
14254
|
+
Object.freeze({ path: "skills", target: "dist/assets/skills" })
|
|
14255
|
+
]);
|
|
14256
|
+
var execFileAsync2 = promisify2(execFile2);
|
|
14237
14257
|
var SETPRIV_PATH = "/usr/bin/setpriv";
|
|
14238
14258
|
var WORKSPACE_UID = 1001;
|
|
14239
14259
|
var WORKSPACE_GID = 1001;
|
|
@@ -14283,7 +14303,7 @@ function createHostWorkspaceProcessRuntime() {
|
|
|
14283
14303
|
function createWorkspaceProcessRuntime(path, selectCommand) {
|
|
14284
14304
|
const run = async (command, args, options = {}) => {
|
|
14285
14305
|
const selected = selectCommand(command, args);
|
|
14286
|
-
const result = await
|
|
14306
|
+
const result = await execFileAsync2(selected.executable, selected.args, {
|
|
14287
14307
|
cwd: options.cwd,
|
|
14288
14308
|
encoding: "utf8",
|
|
14289
14309
|
env: createWorkspaceProcessEnvironment(path),
|
|
@@ -14376,13 +14396,7 @@ var TICKET_TRANSITION_TYPES = /* @__PURE__ */ new Set([
|
|
|
14376
14396
|
]);
|
|
14377
14397
|
var TICKET_TRANSITION_FIELDS2 = /* @__PURE__ */ new Set(["ticketId", "summary"]);
|
|
14378
14398
|
var TICKET_CREATE_FIELDS2 = /* @__PURE__ */ new Set(["title", "summary", "description", "scope", "appId", "contextTicketId"]);
|
|
14379
|
-
var TICKET_ASSIGN_FIELDS2 = /* @__PURE__ */ new Set([
|
|
14380
|
-
"ticketId",
|
|
14381
|
-
"assigneeAgentId",
|
|
14382
|
-
"assigneeAgentName",
|
|
14383
|
-
"assigneeAgentRole",
|
|
14384
|
-
"summary"
|
|
14385
|
-
]);
|
|
14399
|
+
var TICKET_ASSIGN_FIELDS2 = /* @__PURE__ */ new Set(["ticketId", "assigneeAgentId", "summary"]);
|
|
14386
14400
|
async function runOrchestratorCli(argv, env = process.env) {
|
|
14387
14401
|
try {
|
|
14388
14402
|
if (argv[0] === "mcp") {
|
|
@@ -14454,7 +14468,7 @@ function parseCliCommand(argv) {
|
|
|
14454
14468
|
const args = resource === "integration" ? [action, ...rest].filter((value) => value !== void 0) : rest;
|
|
14455
14469
|
const payload = parsePayload(type, args);
|
|
14456
14470
|
return {
|
|
14457
|
-
id: commandId ??
|
|
14471
|
+
id: commandId ?? randomUUID10(),
|
|
14458
14472
|
type,
|
|
14459
14473
|
payload
|
|
14460
14474
|
};
|