@paigy/harness 0.2.5 → 0.2.8
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/dist/cli.js +33 -4
- package/dist/main.js +33 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -29763,7 +29763,12 @@ var IntentSchema = external_exports.object({
|
|
|
29763
29763
|
* "after lunch") against the agent machine's clock — the user's — and attaches
|
|
29764
29764
|
* the seconds, ready to pass straight to schedule_callback. Absent when the
|
|
29765
29765
|
* detail didn't parse (the agent interprets it) or the kind isn't defer. */
|
|
29766
|
-
dueInSeconds: external_exports.number().int().positive().optional()
|
|
29766
|
+
dueInSeconds: external_exports.number().int().positive().optional(),
|
|
29767
|
+
/** Feedback only (#812): WHICH failure the complaint names — typed by the mapper that
|
|
29768
|
+
* already read the utterance, so `feedback_from_call.kind` stops defaulting to
|
|
29769
|
+
* 'other' on every row. A table that records that something was wrong and nothing
|
|
29770
|
+
* about what cannot answer "is the bot looping less this week?". */
|
|
29771
|
+
fault: external_exports.enum(["loop", "unanswered", "overridden", "misheard", "slow", "other"]).optional()
|
|
29767
29772
|
});
|
|
29768
29773
|
var AwaitItemSchema = external_exports.discriminatedUnion("type", [
|
|
29769
29774
|
external_exports.object({
|
|
@@ -29933,6 +29938,11 @@ var AgendaTurnSchema = external_exports.object({
|
|
|
29933
29938
|
claimId: external_exports.string().optional(),
|
|
29934
29939
|
/** The claim's voice key (#462) — the OUTBOUND identity, audible who-is-asking. */
|
|
29935
29940
|
voice: external_exports.string().optional(),
|
|
29941
|
+
/** The claim's AGENT NAME (#838) — the spoken identity. A voice alone doesn't say
|
|
29942
|
+
* whose request this is: an item that folded in from another agent arrived as a bare
|
|
29943
|
+
* non-sequitur ("First real production sign-in is yours to make whenever you want.")
|
|
29944
|
+
* and the owner answered "What?". The bot names the agent before its first turn. */
|
|
29945
|
+
agent: external_exports.string().optional(),
|
|
29936
29946
|
select: SelectShapeSchema.optional(),
|
|
29937
29947
|
options: external_exports.array(OptionSchema.omit({ id: true })).optional(),
|
|
29938
29948
|
/** The seat was satisfied by the call's own ACCOUNT (replan-design.md, user_info): the
|
|
@@ -31117,7 +31127,12 @@ var IntentSchema2 = external_exports.object({
|
|
|
31117
31127
|
* "after lunch") against the agent machine's clock — the user's — and attaches
|
|
31118
31128
|
* the seconds, ready to pass straight to schedule_callback. Absent when the
|
|
31119
31129
|
* detail didn't parse (the agent interprets it) or the kind isn't defer. */
|
|
31120
|
-
dueInSeconds: external_exports.number().int().positive().optional()
|
|
31130
|
+
dueInSeconds: external_exports.number().int().positive().optional(),
|
|
31131
|
+
/** Feedback only (#812): WHICH failure the complaint names — typed by the mapper that
|
|
31132
|
+
* already read the utterance, so `feedback_from_call.kind` stops defaulting to
|
|
31133
|
+
* 'other' on every row. A table that records that something was wrong and nothing
|
|
31134
|
+
* about what cannot answer "is the bot looping less this week?". */
|
|
31135
|
+
fault: external_exports.enum(["loop", "unanswered", "overridden", "misheard", "slow", "other"]).optional()
|
|
31121
31136
|
});
|
|
31122
31137
|
var AwaitItemSchema2 = external_exports.discriminatedUnion("type", [
|
|
31123
31138
|
external_exports.object({
|
|
@@ -31287,6 +31302,11 @@ var AgendaTurnSchema2 = external_exports.object({
|
|
|
31287
31302
|
claimId: external_exports.string().optional(),
|
|
31288
31303
|
/** The claim's voice key (#462) — the OUTBOUND identity, audible who-is-asking. */
|
|
31289
31304
|
voice: external_exports.string().optional(),
|
|
31305
|
+
/** The claim's AGENT NAME (#838) — the spoken identity. A voice alone doesn't say
|
|
31306
|
+
* whose request this is: an item that folded in from another agent arrived as a bare
|
|
31307
|
+
* non-sequitur ("First real production sign-in is yours to make whenever you want.")
|
|
31308
|
+
* and the owner answered "What?". The bot names the agent before its first turn. */
|
|
31309
|
+
agent: external_exports.string().optional(),
|
|
31290
31310
|
select: SelectShapeSchema2.optional(),
|
|
31291
31311
|
options: external_exports.array(OptionSchema2.omit({ id: true })).optional(),
|
|
31292
31312
|
/** The seat was satisfied by the call's own ACCOUNT (replan-design.md, user_info): the
|
|
@@ -31755,7 +31775,8 @@ async function drainInput(state, deps = {}) {
|
|
|
31755
31775
|
return [];
|
|
31756
31776
|
}
|
|
31757
31777
|
const ours = (parentId) => state.exclusive || parentId === state.parentId;
|
|
31758
|
-
const
|
|
31778
|
+
const opening = !!state.exclusive && !state.parentId;
|
|
31779
|
+
const claimable = (notificationId) => opening || state.resting === true || !state.sharedWithAgent || (state.mine?.has(notificationId) ?? false);
|
|
31759
31780
|
const mine = [
|
|
31760
31781
|
...work.replies.filter((r) => ours(r.parentId) && claimable(r.notificationId)).map((r) => ({ notificationId: r.notificationId, parentId: r.parentId, answer: r.answer })),
|
|
31761
31782
|
...work.requests.filter((r) => ours(r.parentId) && claimable(r.notificationId)).map((r) => ({ notificationId: r.notificationId, parentId: r.parentId, answer: { kind: "text", text: r.text } }))
|
|
@@ -31788,7 +31809,10 @@ async function pump(session, state, deps = {}) {
|
|
|
31788
31809
|
continue;
|
|
31789
31810
|
}
|
|
31790
31811
|
const words = spokenText(item.answer);
|
|
31791
|
-
if (words)
|
|
31812
|
+
if (words) {
|
|
31813
|
+
state.resting = false;
|
|
31814
|
+
session.send(words);
|
|
31815
|
+
}
|
|
31792
31816
|
}
|
|
31793
31817
|
const keepGoing = await deps.onIdle?.() ?? false;
|
|
31794
31818
|
if (!keepGoing) return;
|
|
@@ -32304,6 +32328,7 @@ function runHarness(opts) {
|
|
|
32304
32328
|
state.parentId ??= parentId;
|
|
32305
32329
|
if (event.kind === "turn") opts.log(`${event.role}: ${event.text.split("\n")[0] ?? ""}`);
|
|
32306
32330
|
if (event.kind === "idle") {
|
|
32331
|
+
state.resting = true;
|
|
32307
32332
|
if (endsWithQuestion(event.result)) {
|
|
32308
32333
|
const local = await opts.localAsk?.question?.(event.result ?? "") ?? null;
|
|
32309
32334
|
if (local?.trim() && session && running) {
|
|
@@ -32406,6 +32431,10 @@ function startHost(opts) {
|
|
|
32406
32431
|
log
|
|
32407
32432
|
});
|
|
32408
32433
|
runs.set(spec.sessionId, { run, label });
|
|
32434
|
+
try {
|
|
32435
|
+
saveToken({ access_token: spec.token, name: label, device: null }, `session:${spec.sessionId.slice(0, 8)}`);
|
|
32436
|
+
} catch {
|
|
32437
|
+
}
|
|
32409
32438
|
opts.log(`\u25B6 phone-launched ${label} (${spec.harness}) in ${spec.workspace}`);
|
|
32410
32439
|
}
|
|
32411
32440
|
}
|
package/dist/main.js
CHANGED
|
@@ -11175,7 +11175,12 @@ var IntentSchema = external_exports.object({
|
|
|
11175
11175
|
* "after lunch") against the agent machine's clock — the user's — and attaches
|
|
11176
11176
|
* the seconds, ready to pass straight to schedule_callback. Absent when the
|
|
11177
11177
|
* detail didn't parse (the agent interprets it) or the kind isn't defer. */
|
|
11178
|
-
dueInSeconds: external_exports.number().int().positive().optional()
|
|
11178
|
+
dueInSeconds: external_exports.number().int().positive().optional(),
|
|
11179
|
+
/** Feedback only (#812): WHICH failure the complaint names — typed by the mapper that
|
|
11180
|
+
* already read the utterance, so `feedback_from_call.kind` stops defaulting to
|
|
11181
|
+
* 'other' on every row. A table that records that something was wrong and nothing
|
|
11182
|
+
* about what cannot answer "is the bot looping less this week?". */
|
|
11183
|
+
fault: external_exports.enum(["loop", "unanswered", "overridden", "misheard", "slow", "other"]).optional()
|
|
11179
11184
|
});
|
|
11180
11185
|
var AwaitItemSchema = external_exports.discriminatedUnion("type", [
|
|
11181
11186
|
external_exports.object({
|
|
@@ -11345,6 +11350,11 @@ var AgendaTurnSchema = external_exports.object({
|
|
|
11345
11350
|
claimId: external_exports.string().optional(),
|
|
11346
11351
|
/** The claim's voice key (#462) — the OUTBOUND identity, audible who-is-asking. */
|
|
11347
11352
|
voice: external_exports.string().optional(),
|
|
11353
|
+
/** The claim's AGENT NAME (#838) — the spoken identity. A voice alone doesn't say
|
|
11354
|
+
* whose request this is: an item that folded in from another agent arrived as a bare
|
|
11355
|
+
* non-sequitur ("First real production sign-in is yours to make whenever you want.")
|
|
11356
|
+
* and the owner answered "What?". The bot names the agent before its first turn. */
|
|
11357
|
+
agent: external_exports.string().optional(),
|
|
11348
11358
|
select: SelectShapeSchema.optional(),
|
|
11349
11359
|
options: external_exports.array(OptionSchema.omit({ id: true })).optional(),
|
|
11350
11360
|
/** The seat was satisfied by the call's own ACCOUNT (replan-design.md, user_info): the
|
|
@@ -12909,7 +12919,12 @@ var IntentSchema2 = external_exports.object({
|
|
|
12909
12919
|
* "after lunch") against the agent machine's clock — the user's — and attaches
|
|
12910
12920
|
* the seconds, ready to pass straight to schedule_callback. Absent when the
|
|
12911
12921
|
* detail didn't parse (the agent interprets it) or the kind isn't defer. */
|
|
12912
|
-
dueInSeconds: external_exports.number().int().positive().optional()
|
|
12922
|
+
dueInSeconds: external_exports.number().int().positive().optional(),
|
|
12923
|
+
/** Feedback only (#812): WHICH failure the complaint names — typed by the mapper that
|
|
12924
|
+
* already read the utterance, so `feedback_from_call.kind` stops defaulting to
|
|
12925
|
+
* 'other' on every row. A table that records that something was wrong and nothing
|
|
12926
|
+
* about what cannot answer "is the bot looping less this week?". */
|
|
12927
|
+
fault: external_exports.enum(["loop", "unanswered", "overridden", "misheard", "slow", "other"]).optional()
|
|
12913
12928
|
});
|
|
12914
12929
|
var AwaitItemSchema2 = external_exports.discriminatedUnion("type", [
|
|
12915
12930
|
external_exports.object({
|
|
@@ -13079,6 +13094,11 @@ var AgendaTurnSchema2 = external_exports.object({
|
|
|
13079
13094
|
claimId: external_exports.string().optional(),
|
|
13080
13095
|
/** The claim's voice key (#462) — the OUTBOUND identity, audible who-is-asking. */
|
|
13081
13096
|
voice: external_exports.string().optional(),
|
|
13097
|
+
/** The claim's AGENT NAME (#838) — the spoken identity. A voice alone doesn't say
|
|
13098
|
+
* whose request this is: an item that folded in from another agent arrived as a bare
|
|
13099
|
+
* non-sequitur ("First real production sign-in is yours to make whenever you want.")
|
|
13100
|
+
* and the owner answered "What?". The bot names the agent before its first turn. */
|
|
13101
|
+
agent: external_exports.string().optional(),
|
|
13082
13102
|
select: SelectShapeSchema2.optional(),
|
|
13083
13103
|
options: external_exports.array(OptionSchema2.omit({ id: true })).optional(),
|
|
13084
13104
|
/** The seat was satisfied by the call's own ACCOUNT (replan-design.md, user_info): the
|
|
@@ -13547,7 +13567,8 @@ async function drainInput(state, deps = {}) {
|
|
|
13547
13567
|
return [];
|
|
13548
13568
|
}
|
|
13549
13569
|
const ours = (parentId) => state.exclusive || parentId === state.parentId;
|
|
13550
|
-
const
|
|
13570
|
+
const opening = !!state.exclusive && !state.parentId;
|
|
13571
|
+
const claimable = (notificationId) => opening || state.resting === true || !state.sharedWithAgent || (state.mine?.has(notificationId) ?? false);
|
|
13551
13572
|
const mine = [
|
|
13552
13573
|
...work.replies.filter((r) => ours(r.parentId) && claimable(r.notificationId)).map((r) => ({ notificationId: r.notificationId, parentId: r.parentId, answer: r.answer })),
|
|
13553
13574
|
...work.requests.filter((r) => ours(r.parentId) && claimable(r.notificationId)).map((r) => ({ notificationId: r.notificationId, parentId: r.parentId, answer: { kind: "text", text: r.text } }))
|
|
@@ -13580,7 +13601,10 @@ async function pump(session, state, deps = {}) {
|
|
|
13580
13601
|
continue;
|
|
13581
13602
|
}
|
|
13582
13603
|
const words = spokenText(item.answer);
|
|
13583
|
-
if (words)
|
|
13604
|
+
if (words) {
|
|
13605
|
+
state.resting = false;
|
|
13606
|
+
session.send(words);
|
|
13607
|
+
}
|
|
13584
13608
|
}
|
|
13585
13609
|
const keepGoing = await deps.onIdle?.() ?? false;
|
|
13586
13610
|
if (!keepGoing) return;
|
|
@@ -13801,6 +13825,7 @@ function runHarness(opts) {
|
|
|
13801
13825
|
state.parentId ??= parentId;
|
|
13802
13826
|
if (event.kind === "turn") opts.log(`${event.role}: ${event.text.split("\n")[0] ?? ""}`);
|
|
13803
13827
|
if (event.kind === "idle") {
|
|
13828
|
+
state.resting = true;
|
|
13804
13829
|
if (endsWithQuestion(event.result)) {
|
|
13805
13830
|
const local = await opts.localAsk?.question?.(event.result ?? "") ?? null;
|
|
13806
13831
|
if (local?.trim() && session && running) {
|
|
@@ -13877,6 +13902,10 @@ function startHost(opts) {
|
|
|
13877
13902
|
log: log2
|
|
13878
13903
|
});
|
|
13879
13904
|
runs.set(spec.sessionId, { run, label });
|
|
13905
|
+
try {
|
|
13906
|
+
saveToken({ access_token: spec.token, name: label, device: null }, `session:${spec.sessionId.slice(0, 8)}`);
|
|
13907
|
+
} catch {
|
|
13908
|
+
}
|
|
13880
13909
|
opts.log(`\u25B6 phone-launched ${label} (${spec.harness}) in ${spec.workspace}`);
|
|
13881
13910
|
}
|
|
13882
13911
|
}
|