@chipschat/harness 0.0.0-stage → 1.0.0
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/LICENSE +201 -0
- package/README.md +66 -2
- package/dist/asks.d.ts +75 -0
- package/dist/asks.d.ts.map +1 -0
- package/dist/asks.js +103 -0
- package/dist/asks.js.map +1 -0
- package/dist/connect.d.ts +406 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/connect.js +883 -0
- package/dist/connect.js.map +1 -0
- package/dist/events.d.ts +89 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +36 -0
- package/dist/events.js.map +1 -0
- package/dist/files.d.ts +34 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +78 -0
- package/dist/files.js.map +1 -0
- package/dist/heard.d.ts +22 -0
- package/dist/heard.d.ts.map +1 -0
- package/dist/heard.js +32 -0
- package/dist/heard.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/join.d.ts +101 -0
- package/dist/join.d.ts.map +1 -0
- package/dist/join.js +289 -0
- package/dist/join.js.map +1 -0
- package/dist/keep.d.ts +33 -0
- package/dist/keep.d.ts.map +1 -0
- package/dist/keep.js +160 -0
- package/dist/keep.js.map +1 -0
- package/dist/lane.d.ts +73 -0
- package/dist/lane.d.ts.map +1 -0
- package/dist/lane.js +105 -0
- package/dist/lane.js.map +1 -0
- package/dist/outbox.d.ts +50 -0
- package/dist/outbox.d.ts.map +1 -0
- package/dist/outbox.js +52 -0
- package/dist/outbox.js.map +1 -0
- package/dist/project.d.ts +224 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +619 -0
- package/dist/project.js.map +1 -0
- package/dist/prompt.d.ts +61 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +87 -0
- package/dist/prompt.js.map +1 -0
- package/dist/rules.d.ts +18 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +25 -0
- package/dist/rules.js.map +1 -0
- package/dist/run.d.ts +246 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +295 -0
- package/dist/run.js.map +1 -0
- package/dist/sending.d.ts +78 -0
- package/dist/sending.d.ts.map +1 -0
- package/dist/sending.js +149 -0
- package/dist/sending.js.map +1 -0
- package/dist/service.d.ts +124 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +349 -0
- package/dist/service.js.map +1 -0
- package/dist/settings.d.ts +137 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +228 -0
- package/dist/settings.js.map +1 -0
- package/dist/steps.d.ts +27 -0
- package/dist/steps.d.ts.map +1 -0
- package/dist/steps.js +26 -0
- package/dist/steps.js.map +1 -0
- package/dist/store.d.ts +35 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +52 -0
- package/dist/store.js.map +1 -0
- package/package.json +37 -3
package/dist/run.js
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One run, from the harness's side. `runs.start` returns one; everything it sends carries the
|
|
3
|
+
* run id, so the person sees a timeline, a receipt, and cards that belong to it. An approval
|
|
4
|
+
* or a question is a promise: send the ask, and the decision comes back when a person — or
|
|
5
|
+
* the policy engine, at once — has answered, however many reconnects happen in between.
|
|
6
|
+
*/
|
|
7
|
+
import { Emitter } from "./events.js";
|
|
8
|
+
import { Lane } from "./lane.js";
|
|
9
|
+
/** An ask's optional fields as the wire spells them, leaving out each one that was not given. */
|
|
10
|
+
function givenFields(input) {
|
|
11
|
+
const fields = {
|
|
12
|
+
question: input.question,
|
|
13
|
+
effect: input.effect,
|
|
14
|
+
lasts: input.lasts,
|
|
15
|
+
preview: input.preview,
|
|
16
|
+
step_id: input.stepId,
|
|
17
|
+
sources: input.sources,
|
|
18
|
+
fallback: input.fallback,
|
|
19
|
+
approvers: input.approvers,
|
|
20
|
+
editable: input.editable,
|
|
21
|
+
};
|
|
22
|
+
return Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== undefined));
|
|
23
|
+
}
|
|
24
|
+
const cost = (usd) => usd === undefined ? {} : { cost: { usd, estimated: true } };
|
|
25
|
+
export class Run {
|
|
26
|
+
id;
|
|
27
|
+
spaceId;
|
|
28
|
+
wire;
|
|
29
|
+
laneId;
|
|
30
|
+
events = new Emitter();
|
|
31
|
+
held = false;
|
|
32
|
+
ended = false;
|
|
33
|
+
constructor(id, spaceId, wire,
|
|
34
|
+
/** The lane this run is, when a lead routed it here (`chips.runs.accept`). */
|
|
35
|
+
laneId) {
|
|
36
|
+
this.id = id;
|
|
37
|
+
this.spaceId = spaceId;
|
|
38
|
+
this.wire = wire;
|
|
39
|
+
this.laneId = laneId;
|
|
40
|
+
}
|
|
41
|
+
/** A person paused the run and has not resumed it. */
|
|
42
|
+
get paused() {
|
|
43
|
+
return this.held;
|
|
44
|
+
}
|
|
45
|
+
/** A person stopped the run, or it completed or failed. Nothing more should be sent. */
|
|
46
|
+
get over() {
|
|
47
|
+
return this.ended;
|
|
48
|
+
}
|
|
49
|
+
on(name, handler) {
|
|
50
|
+
return this.events.on(name, handler);
|
|
51
|
+
}
|
|
52
|
+
/** What a person did to this run, from the connection. */
|
|
53
|
+
hear(event) {
|
|
54
|
+
switch (event["type"]) {
|
|
55
|
+
case "run.steer":
|
|
56
|
+
this.events.emit("steer", event);
|
|
57
|
+
return;
|
|
58
|
+
case "run.pause":
|
|
59
|
+
this.held = true;
|
|
60
|
+
this.events.emit("pause", event);
|
|
61
|
+
return;
|
|
62
|
+
case "run.resume":
|
|
63
|
+
this.held = false;
|
|
64
|
+
this.events.emit("resume", event);
|
|
65
|
+
return;
|
|
66
|
+
case "run.cancel":
|
|
67
|
+
this.ended = true;
|
|
68
|
+
this.held = false;
|
|
69
|
+
this.events.emit("cancel", event);
|
|
70
|
+
return;
|
|
71
|
+
case "message.new":
|
|
72
|
+
this.events.emit("message", event);
|
|
73
|
+
return;
|
|
74
|
+
default:
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/** Resolve once the run is not paused. A stopped run resolves too: check `over` after. */
|
|
79
|
+
async whenRunning() {
|
|
80
|
+
while (this.held && !this.ended) {
|
|
81
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
status(input) {
|
|
85
|
+
const status = typeof input === "string" ? { verbPhrase: input } : input;
|
|
86
|
+
return this.wire.send("run.status", {
|
|
87
|
+
phase: status.phase ?? phaseOf(status.verbPhrase),
|
|
88
|
+
verb_phrase: status.verbPhrase,
|
|
89
|
+
...(status.progress === undefined ? {} : { progress: status.progress }),
|
|
90
|
+
...(status.estimateSeconds === undefined ? {} : { estimate_seconds: status.estimateSeconds }),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/** The steps still to come, replacing the ones not yet done. */
|
|
94
|
+
plan(steps, reason) {
|
|
95
|
+
return this.wire.send("run.plan", {
|
|
96
|
+
plan: steps.map((step) => ({ step_id: step.stepId, title: step.title })),
|
|
97
|
+
...(reason === undefined ? {} : { reason }),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
step(input) {
|
|
101
|
+
return this.wire.send("step.log", {
|
|
102
|
+
step_id: input.stepId ?? this.newStepId(),
|
|
103
|
+
status: input.status ?? "done",
|
|
104
|
+
...(input.title === undefined ? {} : { title: input.title }),
|
|
105
|
+
...(input.tool === undefined ? {} : { tool: input.tool }),
|
|
106
|
+
...(input.kind === undefined ? {} : { kind: input.kind }),
|
|
107
|
+
...(input.summary === undefined ? {} : { summary: input.summary }),
|
|
108
|
+
...(input.sources === undefined ? {} : { sources: input.sources }),
|
|
109
|
+
...(input.durationMs === undefined ? {} : { duration_ms: input.durationMs }),
|
|
110
|
+
...(input.error === undefined ? {} : { error: input.error }),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A step around a piece of work: `started` now, `done` with how long it took when the work
|
|
115
|
+
* resolves, `failed` with why when it throws, and the error thrown on. Give `tool` (or a title
|
|
116
|
+
* like `web_search · LEGO trucks`) and the thinking bubble says what is going on while it works.
|
|
117
|
+
*/
|
|
118
|
+
async track(step, work) {
|
|
119
|
+
const stepId = step.stepId ?? this.newStepId();
|
|
120
|
+
const begun = Date.now();
|
|
121
|
+
await this.step({ ...step, stepId, status: "started" });
|
|
122
|
+
try {
|
|
123
|
+
const value = await work();
|
|
124
|
+
await this.step({ ...step, stepId, status: "done", durationMs: Date.now() - begun });
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
const why = error instanceof Error ? error.message : String(error);
|
|
129
|
+
await this.step({
|
|
130
|
+
...step,
|
|
131
|
+
stepId,
|
|
132
|
+
status: "failed",
|
|
133
|
+
durationMs: Date.now() - begun,
|
|
134
|
+
error: (why === "" ? "It failed." : why).slice(0, 2000),
|
|
135
|
+
}).catch(() => undefined);
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
newStepId() {
|
|
140
|
+
return `step-${this.wire.newId("event").slice(-8).toLowerCase()}`;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Ask, and wait for the answer. Resolves when a person decides — or at once, when the
|
|
144
|
+
* policy engine decides for them — and survives a reconnect, since the decision is an
|
|
145
|
+
* event the resumed subscription replays.
|
|
146
|
+
*/
|
|
147
|
+
async approval(input) {
|
|
148
|
+
const approvalId = input.approvalId ?? this.wire.newId("approval");
|
|
149
|
+
const decided = this.wire.waitFor((event) => event["type"] === "approval.resolved" && event["approval_id"] === approvalId
|
|
150
|
+
? event
|
|
151
|
+
: undefined);
|
|
152
|
+
await this.wire.send("approval.request", {
|
|
153
|
+
approval_id: approvalId,
|
|
154
|
+
action: input.action,
|
|
155
|
+
risk: input.risk,
|
|
156
|
+
expires_in: input.expiresIn ?? 3600,
|
|
157
|
+
...givenFields(input),
|
|
158
|
+
});
|
|
159
|
+
const event = await decided;
|
|
160
|
+
return {
|
|
161
|
+
approvalId,
|
|
162
|
+
decision: event.decision,
|
|
163
|
+
allowed: event.decision === "approved" || event.decision === "edited",
|
|
164
|
+
scope: event.scope ?? "once",
|
|
165
|
+
input: event.decision === "edited" ? event.updated_input : input.action.input,
|
|
166
|
+
reason: event.reason,
|
|
167
|
+
by: event.resolved_by,
|
|
168
|
+
at: event.resolved_at,
|
|
169
|
+
event,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Route work to another harness, or to one of this harness's own spaces, as a lane of this
|
|
174
|
+
* run (M3.5). Resolves once Chips has acknowledged the task with where the lane is; the lane's
|
|
175
|
+
* `result` resolves when the specialist is done. A task Chips flattens — an unknown harness, a
|
|
176
|
+
* chain too deep, a loop — comes back as a lane whose `result` is `flattened`, so the lead
|
|
177
|
+
* can carry on without it.
|
|
178
|
+
*/
|
|
179
|
+
async task(input) {
|
|
180
|
+
const taskId = input.taskId ?? this.wire.newId("lane");
|
|
181
|
+
const lane = new Lane(taskId, this.wire.lanes);
|
|
182
|
+
const ack = await this.wire.send("task", {
|
|
183
|
+
task_id: taskId,
|
|
184
|
+
...(input.to === undefined ? {} : { to: input.to }),
|
|
185
|
+
...(input.child === undefined ? {} : { to: input.child.label, child: input.child }),
|
|
186
|
+
goal: input.goal,
|
|
187
|
+
on_behalf_of: input.onBehalfOf,
|
|
188
|
+
...(input.constraints === undefined ? {} : { constraints: input.constraints }),
|
|
189
|
+
...(input.deadline === undefined ? {} : { deadline: input.deadline }),
|
|
190
|
+
...(input.autonomy === undefined ? {} : { autonomy: input.autonomy }),
|
|
191
|
+
...(input.origin === undefined ? {} : { origin: input.origin }),
|
|
192
|
+
link_to: input.linkTo ?? this.spaceId,
|
|
193
|
+
...(input.home === undefined ? {} : { home: input.home }),
|
|
194
|
+
...(input.label === undefined ? {} : { label: input.label }),
|
|
195
|
+
});
|
|
196
|
+
lane.opened(ack.lane);
|
|
197
|
+
return lane;
|
|
198
|
+
}
|
|
199
|
+
/** What happened after a yes: the card changes from approved to sent, or to failed. */
|
|
200
|
+
executed(approvalId, outcome, detail) {
|
|
201
|
+
return this.wire.send("approval.executed", {
|
|
202
|
+
approval_id: approvalId,
|
|
203
|
+
outcome,
|
|
204
|
+
...(detail === undefined ? {} : { detail }),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/** One to four questions with options; resolves with the answers, or the default on a timeout. */
|
|
208
|
+
async question(input) {
|
|
209
|
+
const askId = input.askId ?? this.wire.newId("question");
|
|
210
|
+
const answered = this.wire.waitFor((event) => event["type"] === "question.answered" && event["ask_id"] === askId
|
|
211
|
+
? event
|
|
212
|
+
: undefined);
|
|
213
|
+
await this.wire.send("question.ask", {
|
|
214
|
+
ask_id: askId,
|
|
215
|
+
questions: input.questions.map((question, index) => ({
|
|
216
|
+
question_id: question.questionId ?? `q${index + 1}`,
|
|
217
|
+
prompt: question.prompt,
|
|
218
|
+
options: question.options,
|
|
219
|
+
...(question.multiSelect === undefined ? {} : { multi_select: question.multiSelect }),
|
|
220
|
+
...(question.allowFreeText === undefined
|
|
221
|
+
? {}
|
|
222
|
+
: { allow_free_text: question.allowFreeText }),
|
|
223
|
+
...(question.defaultValue === undefined ? {} : { default_value: question.defaultValue }),
|
|
224
|
+
})),
|
|
225
|
+
...(input.timeoutSeconds === undefined ? {} : { timeout_seconds: input.timeoutSeconds }),
|
|
226
|
+
...(input.onNoAnswer === undefined ? {} : { on_no_answer: input.onNoAnswer }),
|
|
227
|
+
});
|
|
228
|
+
const event = await answered;
|
|
229
|
+
const answers = {};
|
|
230
|
+
for (const answer of event.answers) {
|
|
231
|
+
answers[answer.question_id] = { values: answer.values, freeText: answer.free_text };
|
|
232
|
+
}
|
|
233
|
+
return { askId, answers, timedOut: event.timed_out === true, by: event.answered_by, event };
|
|
234
|
+
}
|
|
235
|
+
context(input) {
|
|
236
|
+
return this.wire.send("context.usage", {
|
|
237
|
+
used_tokens: input.usedTokens,
|
|
238
|
+
limit_tokens: input.limitTokens,
|
|
239
|
+
model: input.model,
|
|
240
|
+
...(input.compacted === undefined ? {} : { compacted: input.compacted }),
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
usage(input) {
|
|
244
|
+
return this.wire.send("usage", {
|
|
245
|
+
scope: input.scope ?? "run",
|
|
246
|
+
model: input.model,
|
|
247
|
+
...(input.inputTokens === undefined ? {} : { input_tokens: input.inputTokens }),
|
|
248
|
+
...(input.cacheReadTokens === undefined ? {} : { cache_read_tokens: input.cacheReadTokens }),
|
|
249
|
+
...(input.cacheWriteTokens === undefined
|
|
250
|
+
? {}
|
|
251
|
+
: { cache_write_tokens: input.cacheWriteTokens }),
|
|
252
|
+
...(input.outputTokens === undefined ? {} : { output_tokens: input.outputTokens }),
|
|
253
|
+
...cost(input.costUsd),
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* That this turn heard a message said in the room while it worked (ADR 0106): one that
|
|
258
|
+
* `message.overheard` named this run for in `working_turns`, handed to the turn at a step. The
|
|
259
|
+
* room shows its agent heard it while working. Say it once the turn has the words, never before.
|
|
260
|
+
*/
|
|
261
|
+
heard(messageId) {
|
|
262
|
+
return this.wire.send("message.heard", { message_id: messageId });
|
|
263
|
+
}
|
|
264
|
+
checkpoint(label, next, compacted) {
|
|
265
|
+
return this.wire.send("checkpoint", {
|
|
266
|
+
label,
|
|
267
|
+
...(next === undefined ? {} : { next }),
|
|
268
|
+
...(compacted === undefined ? {} : { compacted }),
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
complete(input) {
|
|
272
|
+
this.ended = true;
|
|
273
|
+
return this.wire.send("run.completed", {
|
|
274
|
+
summary: input.summary,
|
|
275
|
+
...(input.changed === undefined ? {} : { changed: input.changed }),
|
|
276
|
+
...(input.followUps === undefined ? {} : { follow_ups: input.followUps }),
|
|
277
|
+
...cost(input.costUsd),
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
fail(input) {
|
|
281
|
+
this.ended = true;
|
|
282
|
+
return this.wire.send("run.failed", {
|
|
283
|
+
error: input.error,
|
|
284
|
+
...(input.leftUndone === undefined ? {} : { left_undone: input.leftUndone }),
|
|
285
|
+
...(input.retryable === undefined ? {} : { retryable: input.retryable }),
|
|
286
|
+
...cost(input.costUsd),
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/** `Reading PO #4471…` → `reading`: a machine-ish label from the first word. */
|
|
291
|
+
function phaseOf(verbPhrase) {
|
|
292
|
+
const word = verbPhrase.trim().split(/\s+/)[0] ?? "working";
|
|
293
|
+
return word.replace(/[^a-z0-9]/gi, "").toLowerCase() || "working";
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=run.js.map
|
package/dist/run.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,OAAO,EAAE,OAAO,EAAgB,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,IAAI,EAAiB,MAAM,WAAW,CAAC;AAwDhD,iGAAiG;AACjG,SAAS,WAAW,CAAC,KAAoB;IACvC,MAAM,MAAM,GAA4B;QACtC,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,OAAO,EAAE,KAAK,CAAC,MAAM;QACrB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC;IACF,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,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OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,IAAI,SAAS,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The files an answer sends to its room (ADR 0099). An agent names a file on a line of its own,
|
|
3
|
+
* `MEDIA:<path>`, a convention some harnesses' agents already keep; the bridge takes those lines
|
|
4
|
+
* out of the words and posts each file with them, so it reaches the people and agents in the room.
|
|
5
|
+
* A path alone reaches nobody: in the Tic Tac Toe runs of 17 October 2026 (finding TT-7) three
|
|
6
|
+
* harnesses' agents answered with a path on the Mac, a `127.0.0.1` link to a server they started,
|
|
7
|
+
* or a site they hosted, and one went looking through the Mac for a way in.
|
|
8
|
+
*
|
|
9
|
+
* Only a file inside one of the agent's own folders is sent: a line naming any other (`~/.ssh/…`,
|
|
10
|
+
* or a link out of the folder) is refused, and the post says so.
|
|
11
|
+
*/
|
|
12
|
+
import type { Uploaded, UploadInput } from "./files.js";
|
|
13
|
+
/**
|
|
14
|
+
* How a file reaches a room, said with every turn of an agent whose bridge sends its files. A turn
|
|
15
|
+
* that works on the room's project is told that only a file outside it needs sending: told that a
|
|
16
|
+
* file "reaches this room only when you send it", agents sent the project's files too, each a room
|
|
17
|
+
* file with versions of its own, even after the project's note said not to (Phase 8, AP-3, AP-9).
|
|
18
|
+
*/
|
|
19
|
+
export declare function sendingFiles(options?: {
|
|
20
|
+
readonly project?: boolean | undefined;
|
|
21
|
+
}): string;
|
|
22
|
+
/** How a file reaches a room that has no project to work on. */
|
|
23
|
+
export declare const SENDING_FILES: string;
|
|
24
|
+
/** The most files one post carries (`message.post`'s `upload_ids`). */
|
|
25
|
+
export declare const MOST_FILES = 20;
|
|
26
|
+
/** The most bytes a file may have; Chips judges the size again by what the file is. */
|
|
27
|
+
export declare const MOST_FILE_BYTES: number;
|
|
28
|
+
/** An answer's words with its `MEDIA:` lines taken out, and what those lines named, in order. */
|
|
29
|
+
export interface NamedFiles {
|
|
30
|
+
readonly words: string;
|
|
31
|
+
readonly named: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
/** The `MEDIA:` lines of an answer, taken out of its words. A line that only mentions one stays. */
|
|
34
|
+
export declare function filesNamedIn(answer: string): NamedFiles;
|
|
35
|
+
/** What one `MEDIA:` line turned out to be. */
|
|
36
|
+
export type Sendable = {
|
|
37
|
+
readonly kind: "file";
|
|
38
|
+
readonly filename: string;
|
|
39
|
+
readonly bytes: Uint8Array;
|
|
40
|
+
}
|
|
41
|
+
/** A web address, which goes back into the words rather than being fetched. */
|
|
42
|
+
| {
|
|
43
|
+
readonly kind: "link";
|
|
44
|
+
readonly url: string;
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: "refused";
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly why: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* A file a line named, read if it is inside one of `folders`. A relative path starts in the first
|
|
52
|
+
* of them, and `~/` at the home of the user the bridge runs as.
|
|
53
|
+
*/
|
|
54
|
+
export declare function readSendable(reference: string, folders: readonly string[]): Promise<Sendable>;
|
|
55
|
+
/** An answer as it is posted, its files sent. */
|
|
56
|
+
export interface SentAnswer {
|
|
57
|
+
/** The words without their `MEDIA:` lines, then a link a line gave, and why a file did not go. */
|
|
58
|
+
readonly text: string;
|
|
59
|
+
/** For the post's `uploadIds`. */
|
|
60
|
+
readonly uploadIds: readonly string[];
|
|
61
|
+
/** The files sent, by name. */
|
|
62
|
+
readonly sent: readonly string[];
|
|
63
|
+
/** The run's summary: the post's text, or what it sent when it has no words. */
|
|
64
|
+
readonly summary: string;
|
|
65
|
+
}
|
|
66
|
+
export interface SendOptions {
|
|
67
|
+
/** The agent's own folders. A file outside them is not sent. */
|
|
68
|
+
readonly folders: readonly string[];
|
|
69
|
+
/** `chips.upload`. */
|
|
70
|
+
readonly upload: (input: UploadInput) => Promise<Uploaded>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Take an answer's `MEDIA:` lines out of its words and send each file they name. Nothing is thrown
|
|
74
|
+
* for a file that cannot go: the post says why instead, so the room is never told of a file it
|
|
75
|
+
* did not get.
|
|
76
|
+
*/
|
|
77
|
+
export declare function sendAnswer(answer: string, options: SendOptions): Promise<SentAnswer>;
|
|
78
|
+
//# sourceMappingURL=sending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sending.d.ts","sourceRoot":"","sources":["../src/sending.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GAAG,MAAM,CAO7F;AAED,gEAAgE;AAChE,eAAO,MAAM,aAAa,QAAiB,CAAC;AAE5C,uEAAuE;AACvE,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,uFAAuF;AACvF,eAAO,MAAM,eAAe,QAAoB,CAAC;AAEjD,iGAAiG;AACjG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,oGAAoG;AACpG,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAevD;AAED,+CAA+C;AAC/C,MAAM,MAAM,QAAQ,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE;AAClF,+EAA+E;GAC7E;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAiC9E;;;GAGG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,SAAS,MAAM,EAAE,GACzB,OAAO,CAAC,QAAQ,CAAC,CAgBnB;AAED,iDAAiD;AACjD,MAAM,WAAW,UAAU;IACzB,kGAAkG;IAClG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,sBAAsB;IACtB,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC5D;AAsBD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAgB1F"}
|
package/dist/sending.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The files an answer sends to its room (ADR 0099). An agent names a file on a line of its own,
|
|
3
|
+
* `MEDIA:<path>`, a convention some harnesses' agents already keep; the bridge takes those lines
|
|
4
|
+
* out of the words and posts each file with them, so it reaches the people and agents in the room.
|
|
5
|
+
* A path alone reaches nobody: in the Tic Tac Toe runs of 17 October 2026 (finding TT-7) three
|
|
6
|
+
* harnesses' agents answered with a path on the Mac, a `127.0.0.1` link to a server they started,
|
|
7
|
+
* or a site they hosted, and one went looking through the Mac for a way in.
|
|
8
|
+
*
|
|
9
|
+
* Only a file inside one of the agent's own folders is sent: a line naming any other (`~/.ssh/…`,
|
|
10
|
+
* or a link out of the folder) is refused, and the post says so.
|
|
11
|
+
*/
|
|
12
|
+
import { readFile, realpath, stat } from "node:fs/promises";
|
|
13
|
+
import { homedir } from "node:os";
|
|
14
|
+
import { basename, isAbsolute, resolve, sep } from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
/**
|
|
17
|
+
* How a file reaches a room, said with every turn of an agent whose bridge sends its files. A turn
|
|
18
|
+
* that works on the room's project is told that only a file outside it needs sending: told that a
|
|
19
|
+
* file "reaches this room only when you send it", agents sent the project's files too, each a room
|
|
20
|
+
* file with versions of its own, even after the project's note said not to (Phase 8, AP-3, AP-9).
|
|
21
|
+
*/
|
|
22
|
+
export function sendingFiles(options = {}) {
|
|
23
|
+
const which = options.project === true ? "A file that isn't in the space's project" : "A file";
|
|
24
|
+
return (`${which} reaches this space only when you send it: put MEDIA:<path> on a line of its own in ` +
|
|
25
|
+
"your answer, one line for each file, from your own folder. A path, or a link to this machine, " +
|
|
26
|
+
"reaches nobody: the people and agents here cannot open your folder.");
|
|
27
|
+
}
|
|
28
|
+
/** How a file reaches a room that has no project to work on. */
|
|
29
|
+
export const SENDING_FILES = sendingFiles();
|
|
30
|
+
/** The most files one post carries (`message.post`'s `upload_ids`). */
|
|
31
|
+
export const MOST_FILES = 20;
|
|
32
|
+
/** The most bytes a file may have; Chips judges the size again by what the file is. */
|
|
33
|
+
export const MOST_FILE_BYTES = 100 * 1024 * 1024;
|
|
34
|
+
/** The `MEDIA:` lines of an answer, taken out of its words. A line that only mentions one stays. */
|
|
35
|
+
export function filesNamedIn(answer) {
|
|
36
|
+
const named = [];
|
|
37
|
+
const kept = answer.split("\n").filter((line) => {
|
|
38
|
+
const media = /^\s*MEDIA:\s*(\S.*?)\s*$/.exec(line);
|
|
39
|
+
if (media?.[1] === undefined)
|
|
40
|
+
return true;
|
|
41
|
+
if (!named.includes(media[1]))
|
|
42
|
+
named.push(media[1]);
|
|
43
|
+
return false;
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
words: kept
|
|
47
|
+
.join("\n")
|
|
48
|
+
.replace(/\n{3,}/g, "\n\n")
|
|
49
|
+
.trim(),
|
|
50
|
+
named,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** Whether `path` is `folder` or inside it, both as the disk resolves them. */
|
|
54
|
+
function inside(path, folder) {
|
|
55
|
+
return path === folder || path.startsWith(folder.endsWith(sep) ? folder : folder + sep);
|
|
56
|
+
}
|
|
57
|
+
/** Where a line points on this disk, or what it is instead: a web address, or nothing a file has. */
|
|
58
|
+
function pathOf(said) {
|
|
59
|
+
if (/^https?:\/\//i.test(said))
|
|
60
|
+
return { kind: "link", url: said };
|
|
61
|
+
if (/^file:/i.test(said)) {
|
|
62
|
+
try {
|
|
63
|
+
return fileURLToPath(said);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return { kind: "refused", name: said, why: "its address is not a file's" };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return said === "~" || said.startsWith("~/") ? homedir() + said.slice(1) : said;
|
|
70
|
+
}
|
|
71
|
+
/** Whether a file the disk resolved may go: inside a folder, a file, not empty, not too big. */
|
|
72
|
+
async function refusalOf(real, folders) {
|
|
73
|
+
const roots = await Promise.all(folders.map((folder) => realpath(folder).catch(() => undefined)));
|
|
74
|
+
if (!roots.some((root) => root !== undefined && inside(real, root))) {
|
|
75
|
+
return "it is outside the agent's folder";
|
|
76
|
+
}
|
|
77
|
+
const info = await stat(real);
|
|
78
|
+
if (!info.isFile())
|
|
79
|
+
return "it is not a file";
|
|
80
|
+
if (info.size === 0)
|
|
81
|
+
return "it is empty";
|
|
82
|
+
if (info.size > MOST_FILE_BYTES)
|
|
83
|
+
return `it is larger than ${MOST_FILE_BYTES / 1024 / 1024} MB`;
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A file a line named, read if it is inside one of `folders`. A relative path starts in the first
|
|
88
|
+
* of them, and `~/` at the home of the user the bridge runs as.
|
|
89
|
+
*/
|
|
90
|
+
export async function readSendable(reference, folders) {
|
|
91
|
+
const said = reference.trim().replace(/^<(.*)>$/, "$1");
|
|
92
|
+
const path = pathOf(said);
|
|
93
|
+
if (typeof path !== "string")
|
|
94
|
+
return path;
|
|
95
|
+
const name = basename(path) || said;
|
|
96
|
+
const first = folders[0];
|
|
97
|
+
if (first === undefined) {
|
|
98
|
+
return { kind: "refused", name, why: "this agent has no folder its files are sent from" };
|
|
99
|
+
}
|
|
100
|
+
const real = await realpath(isAbsolute(path) ? path : resolve(first, path)).catch(() => undefined);
|
|
101
|
+
if (real === undefined)
|
|
102
|
+
return { kind: "refused", name, why: "it is not there" };
|
|
103
|
+
const why = await refusalOf(real, folders);
|
|
104
|
+
if (why !== undefined)
|
|
105
|
+
return { kind: "refused", name, why };
|
|
106
|
+
return { kind: "file", filename: basename(real), bytes: new Uint8Array(await readFile(real)) };
|
|
107
|
+
}
|
|
108
|
+
/** One named file sent, or a note in its place: a link, or why it did not go. */
|
|
109
|
+
async function sendOne(reference, options, room) {
|
|
110
|
+
const file = await readSendable(reference, options.folders);
|
|
111
|
+
if (file.kind === "link")
|
|
112
|
+
return { note: file.url };
|
|
113
|
+
if (file.kind === "refused")
|
|
114
|
+
return { note: `(${file.name} was not attached: ${file.why}.)` };
|
|
115
|
+
if (!room) {
|
|
116
|
+
return { note: `(${file.filename} was not attached: a message takes ${MOST_FILES} files.)` };
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
return { sent: await options.upload({ bytes: file.bytes, filename: file.filename }) };
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
const why = error instanceof Error ? error.message : String(error);
|
|
123
|
+
return { note: `(${file.filename} was not attached: Chips refused it: ${why})` };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Take an answer's `MEDIA:` lines out of its words and send each file they name. Nothing is thrown
|
|
128
|
+
* for a file that cannot go: the post says why instead, so the room is never told of a file it
|
|
129
|
+
* did not get.
|
|
130
|
+
*/
|
|
131
|
+
export async function sendAnswer(answer, options) {
|
|
132
|
+
const { words, named } = filesNamedIn(answer);
|
|
133
|
+
const uploadIds = [];
|
|
134
|
+
const sent = [];
|
|
135
|
+
const notes = [];
|
|
136
|
+
for (const reference of named) {
|
|
137
|
+
const one = await sendOne(reference, options, uploadIds.length < MOST_FILES);
|
|
138
|
+
if (one.sent !== undefined) {
|
|
139
|
+
uploadIds.push(one.sent.attachmentId);
|
|
140
|
+
sent.push(one.sent.filename);
|
|
141
|
+
}
|
|
142
|
+
if (one.note !== undefined)
|
|
143
|
+
notes.push(one.note);
|
|
144
|
+
}
|
|
145
|
+
const text = [words, ...notes].filter((part) => part !== "").join("\n\n");
|
|
146
|
+
const summary = text !== "" ? text : sent.length > 0 ? `Sent ${sent.join(", ")}.` : "";
|
|
147
|
+
return { text, uploadIds, sent, summary };
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=sending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sending.js","sourceRoot":"","sources":["../src/sending.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,UAAsD,EAAE;IACnF,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,KAAK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