pinecall 0.4.0 → 0.6.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/README.md +14 -6
- package/dist/cli/agent-files.d.ts +6 -0
- package/dist/cli/agent-files.d.ts.map +1 -0
- package/dist/cli/agent-files.js +40 -0
- package/dist/cli/agent-files.js.map +1 -0
- package/dist/cli/agent-lines.d.ts +23 -0
- package/dist/cli/agent-lines.d.ts.map +1 -0
- package/dist/cli/agent-lines.js +109 -0
- package/dist/cli/agent-lines.js.map +1 -0
- package/dist/cli/agent-processes.d.ts +13 -0
- package/dist/cli/agent-processes.d.ts.map +1 -0
- package/dist/cli/agent-processes.js +34 -0
- package/dist/cli/agent-processes.js.map +1 -0
- package/dist/cli/agent-versions.d.ts +12 -0
- package/dist/cli/agent-versions.d.ts.map +1 -0
- package/dist/cli/agent-versions.js +70 -0
- package/dist/cli/agent-versions.js.map +1 -0
- package/dist/cli/agent.d.ts +77 -0
- package/dist/cli/agent.d.ts.map +1 -0
- package/dist/cli/agent.js +186 -0
- package/dist/cli/agent.js.map +1 -0
- package/dist/cli/chat.d.ts +2 -2
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +12 -24
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/client-for.d.ts +6 -0
- package/dist/cli/client-for.d.ts.map +1 -0
- package/dist/cli/client-for.js +7 -0
- package/dist/cli/client-for.js.map +1 -0
- package/dist/cli/connected.d.ts +4 -4
- package/dist/cli/connected.d.ts.map +1 -1
- package/dist/cli/connected.js +2 -2
- package/dist/cli/connected.js.map +1 -1
- package/dist/cli/dotenv.d.ts +24 -0
- package/dist/cli/dotenv.d.ts.map +1 -0
- package/dist/cli/dotenv.js +69 -0
- package/dist/cli/dotenv.js.map +1 -0
- package/dist/cli/env.d.ts +21 -37
- package/dist/cli/env.d.ts.map +1 -1
- package/dist/cli/env.js +35 -68
- package/dist/cli/env.js.map +1 -1
- package/dist/cli/eval.d.ts +2 -1
- package/dist/cli/eval.d.ts.map +1 -1
- package/dist/cli/eval.js +5 -4
- package/dist/cli/eval.js.map +1 -1
- package/dist/cli/groups.d.ts.map +1 -1
- package/dist/cli/groups.js +0 -1
- package/dist/cli/groups.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +25 -30
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/lexicon.d.ts +14 -0
- package/dist/cli/lexicon.d.ts.map +1 -0
- package/dist/cli/lexicon.js +123 -0
- package/dist/cli/lexicon.js.map +1 -0
- package/dist/cli/line.js +6 -6
- package/dist/cli/line.js.map +1 -1
- package/dist/cli/linking.d.ts +13 -0
- package/dist/cli/linking.d.ts.map +1 -0
- package/dist/cli/linking.js +103 -0
- package/dist/cli/linking.js.map +1 -0
- package/dist/cli/load.js +1 -1
- package/dist/cli/load.js.map +1 -1
- package/dist/cli/login.d.ts +5 -11
- package/dist/cli/login.d.ts.map +1 -1
- package/dist/cli/login.js +31 -140
- package/dist/cli/login.js.map +1 -1
- package/dist/cli/memory-policy.d.ts +9 -0
- package/dist/cli/memory-policy.d.ts.map +1 -0
- package/dist/cli/memory-policy.js +79 -0
- package/dist/cli/memory-policy.js.map +1 -0
- package/dist/cli/memory.d.ts.map +1 -1
- package/dist/cli/memory.js +9 -1
- package/dist/cli/memory.js.map +1 -1
- package/dist/cli/pipeline.d.ts +2 -0
- package/dist/cli/pipeline.d.ts.map +1 -1
- package/dist/cli/pipeline.js +18 -76
- package/dist/cli/pipeline.js.map +1 -1
- package/dist/cli/serve/server.d.ts +1 -1
- package/dist/cli/serve/server.d.ts.map +1 -1
- package/dist/cli/serve/server.js +3 -2
- package/dist/cli/serve/server.js.map +1 -1
- package/dist/cli/serve/sidecar.js +1 -1
- package/dist/cli/serve/sidecar.js.map +1 -1
- package/dist/cli/serve.d.ts +1 -1
- package/dist/cli/serve.d.ts.map +1 -1
- package/dist/cli/serve.js +5 -5
- package/dist/cli/serve.js.map +1 -1
- package/dist/cli/signed-in.d.ts +36 -0
- package/dist/cli/signed-in.d.ts.map +1 -0
- package/dist/cli/signed-in.js +60 -0
- package/dist/cli/signed-in.js.map +1 -0
- package/dist/cli/simulate.d.ts.map +1 -1
- package/dist/cli/simulate.js +7 -6
- package/dist/cli/simulate.js.map +1 -1
- package/dist/cli/{run-console.d.ts → start-console.d.ts} +2 -2
- package/dist/cli/start-console.d.ts.map +1 -0
- package/dist/cli/{run-console.js → start-console.js} +3 -3
- package/dist/cli/start-console.js.map +1 -0
- package/dist/cli/{run-screens.d.ts → start-screens.d.ts} +2 -2
- package/dist/cli/start-screens.d.ts.map +1 -0
- package/dist/cli/{run-screens.js → start-screens.js} +24 -5
- package/dist/cli/start-screens.js.map +1 -0
- package/dist/cli/{run.d.ts → start.d.ts} +3 -3
- package/dist/cli/start.d.ts.map +1 -0
- package/dist/cli/{run.js → start.js} +31 -35
- package/dist/cli/start.js.map +1 -0
- package/dist/cli/supervise.d.ts +1 -1
- package/dist/cli/supervise.d.ts.map +1 -1
- package/dist/cli/supervise.js +1 -1
- package/dist/cli/supervise.js.map +1 -1
- package/dist/cli/testing/gateway.d.ts +3 -0
- package/dist/cli/testing/gateway.d.ts.map +1 -1
- package/dist/cli/testing/gateway.js +2 -4
- package/dist/cli/testing/gateway.js.map +1 -1
- package/dist/cli/tuned.d.ts +8 -0
- package/dist/cli/tuned.d.ts.map +1 -0
- package/dist/cli/tuned.js +66 -0
- package/dist/cli/tuned.js.map +1 -0
- package/dist/cli/ui/chatting.d.ts +1 -1
- package/dist/cli/ui/chatting.d.ts.map +1 -1
- package/dist/cli/ui/chatting.js +11 -10
- package/dist/cli/ui/chatting.js.map +1 -1
- package/dist/cli/ui/console/assets/index-DmN15Axn.css +1 -0
- package/dist/cli/ui/console/assets/index-aGyMCQUH.js +106 -0
- package/dist/cli/ui/console/index.html +2 -2
- package/dist/cli/ui/doors.d.ts +2 -2
- package/dist/cli/ui/doors.d.ts.map +1 -1
- package/dist/cli/ui/doors.js +2 -2
- package/dist/cli/ui/doors.js.map +1 -1
- package/dist/cli/ui/drifting.d.ts +1 -1
- package/dist/cli/ui/drifting.js +1 -1
- package/dist/cli/ui/knowing.d.ts +1 -1
- package/dist/cli/ui/knowing.js +3 -3
- package/dist/cli/ui/knowing.js.map +1 -1
- package/dist/cli/ui/promoting.d.ts +1 -1
- package/dist/cli/ui/promoting.js +1 -1
- package/dist/cli/ui/remembering.d.ts +1 -1
- package/dist/cli/ui/remembering.js +3 -3
- package/dist/cli/ui/remembering.js.map +1 -1
- package/dist/cli/ui/reproducing.d.ts +1 -1
- package/dist/cli/ui/reproducing.js +1 -1
- package/dist/cli/ui/simulating.d.ts +1 -1
- package/dist/cli/ui/simulating.js +4 -4
- package/dist/cli/ui/simulating.js.map +1 -1
- package/dist/cli/ui/testing.d.ts +1 -1
- package/dist/cli/ui/testing.js +3 -3
- package/dist/cli/ui/testing.js.map +1 -1
- package/dist/cli/whoami.d.ts +6 -2
- package/dist/cli/whoami.d.ts.map +1 -1
- package/dist/cli/whoami.js +6 -5
- package/dist/cli/whoami.js.map +1 -1
- package/dist/cli/world.d.ts +14 -24
- package/dist/cli/world.d.ts.map +1 -1
- package/dist/cli/world.js +21 -36
- package/dist/cli/world.js.map +1 -1
- package/dist/client/agent.d.ts +2 -1
- package/dist/client/agent.d.ts.map +1 -1
- package/dist/client/agent.js +3 -2
- package/dist/client/agent.js.map +1 -1
- package/dist/client/client.d.ts +17 -2
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +44 -2
- package/dist/client/client.js.map +1 -1
- package/dist/client/connection.d.ts +3 -0
- package/dist/client/connection.d.ts.map +1 -1
- package/dist/client/connection.js +2 -1
- package/dist/client/connection.js.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/observe.d.ts +3 -0
- package/dist/client/observe.d.ts.map +1 -1
- package/dist/client/observe.js +2 -1
- package/dist/client/observe.js.map +1 -1
- package/dist/client/signed.d.ts +15 -0
- package/dist/client/signed.d.ts.map +1 -0
- package/dist/client/signed.js +19 -0
- package/dist/client/signed.js.map +1 -0
- package/dist/client/testing/gateway.d.ts +5 -0
- package/dist/client/testing/gateway.d.ts.map +1 -1
- package/dist/client/testing/gateway.js +10 -0
- package/dist/client/testing/gateway.js.map +1 -1
- package/dist/views/render.d.ts +1 -1
- package/dist/views/render.js +1 -1
- package/package.json +2 -2
- package/dist/cli/config.d.ts +0 -16
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js +0 -125
- package/dist/cli/config.js.map +0 -1
- package/dist/cli/credentials.d.ts +0 -41
- package/dist/cli/credentials.d.ts.map +0 -1
- package/dist/cli/credentials.js +0 -98
- package/dist/cli/credentials.js.map +0 -1
- package/dist/cli/gateway.d.ts +0 -12
- package/dist/cli/gateway.d.ts.map +0 -1
- package/dist/cli/gateway.js +0 -67
- package/dist/cli/gateway.js.map +0 -1
- package/dist/cli/keys.d.ts +0 -28
- package/dist/cli/keys.d.ts.map +0 -1
- package/dist/cli/keys.js +0 -137
- package/dist/cli/keys.js.map +0 -1
- package/dist/cli/profiles.d.ts +0 -122
- package/dist/cli/profiles.d.ts.map +0 -1
- package/dist/cli/profiles.js +0 -312
- package/dist/cli/profiles.js.map +0 -1
- package/dist/cli/run-console.d.ts.map +0 -1
- package/dist/cli/run-console.js.map +0 -1
- package/dist/cli/run-screens.d.ts.map +0 -1
- package/dist/cli/run-screens.js.map +0 -1
- package/dist/cli/run.d.ts.map +0 -1
- package/dist/cli/run.js.map +0 -1
- package/dist/cli/ui/console/assets/index-DhcpHPdk.js +0 -102
- package/dist/cli/ui/console/assets/index-iylvEP0_.css +0 -1
package/README.md
CHANGED
|
@@ -57,22 +57,29 @@ on a laptop in one sitting. To read this code or run the two examples, clone ins
|
|
|
57
57
|
```
|
|
58
58
|
pnpm install nothing to build: the checkout runs from its sources
|
|
59
59
|
cd examples/clinica-norte
|
|
60
|
+
pnpm exec pinecall link sign in through a browser, pick the org: your key, in ./.env
|
|
60
61
|
pnpm exec pinecall chat the agent in this terminal, and a prompt against it
|
|
61
62
|
pnpm exec pinecall prompt --state test/prompts/states.json the exact prompt a state produces
|
|
62
|
-
pnpm exec pinecall
|
|
63
|
-
pnpm exec pinecall
|
|
63
|
+
pnpm exec pinecall start the app: the process you deploy
|
|
64
|
+
pnpm exec pinecall start --serve the same, and its console on http://localhost:4100
|
|
64
65
|
pnpm exec pinecall serve that console alone: your sandbox, on this machine
|
|
65
66
|
pnpm exec pinecall knowledge push ./knowledge/docs to the gateway, under the agent's name
|
|
66
67
|
pnpm exec pinecall test ring 1: the goldens, through the app in this process
|
|
67
68
|
```
|
|
68
69
|
|
|
69
70
|
Two consoles, one per world. What you are running is in the sandbox and is watched on your own
|
|
70
|
-
machine — `pinecall serve` forwards every request to the gateway with the
|
|
71
|
+
machine — `pinecall serve` forwards every request to the gateway with the project's key, so there
|
|
71
72
|
is nothing to sign in to. Production is watched on the gateway's own page, which shows production
|
|
72
73
|
and nothing else. [docs/the-cli.md](docs/the-cli.md#serve).
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
Every verb reads `PINECALL_KEY` (and `PINECALL_URL`, when the gateway is not the cloud) from the
|
|
76
|
+
environment, else from the project's `.env`, which `pinecall link` wrote; each is the sandbox until
|
|
77
|
+
`--prod` says production, for a person whose org lets them act there. On a server the agent runs
|
|
78
|
+
on a server's token from the console's Tokens screen, as `pinecall start --prod` or mounted inside
|
|
79
|
+
your own Node app — [docs/production.md](docs/production.md).
|
|
80
|
+
|
|
81
|
+
A tenant that installed `pinecall` from npm has it on the PATH and writes `pinecall start`. A
|
|
82
|
+
repository of several agents keeps each in `agents/<name>.tsx`, and one `pinecall start` at its root
|
|
76
83
|
holds them all — [docs/writing-an-agent.md](docs/writing-an-agent.md#several-agents-in-one-project).
|
|
77
84
|
|
|
78
85
|
Working on the framework itself:
|
|
@@ -131,7 +138,8 @@ means editing a list on purpose, which is the point.
|
|
|
131
138
|
| [docs/testing-an-agent.md](docs/testing-an-agent.md) | the five rings: unit tests, goldens, personas, one call replayed, the score every call gets |
|
|
132
139
|
| [docs/testing-memory-and-knowledge.md](docs/testing-memory-and-knowledge.md) | memory's own goldens, the index's, and why a call has no retrieval score |
|
|
133
140
|
| [docs/the-cli.md](docs/the-cli.md) | every verb, what it needs, and where its key comes from — one agent, or a project of several |
|
|
134
|
-
| [docs/worlds-and-teams.md](docs/worlds-and-teams.md) |
|
|
141
|
+
| [docs/worlds-and-teams.md](docs/worlds-and-teams.md) | one key per person, the production switch, the two worlds, a team from the invitation to the rollback |
|
|
142
|
+
| [docs/production.md](docs/production.md) | running the agent on your own server: the server's token, the two ways, the release push, changes with `--prod` |
|
|
135
143
|
| [CHANGELOG.md](CHANGELOG.md) · [CLAUDE.md](CLAUDE.md) | what changed · the working agreement |
|
|
136
144
|
|
|
137
145
|
## The wire
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** `pinecall agent pull | push`: a corner's settings as a file, for whoever keeps them in git and CI. */
|
|
2
|
+
import type { Typed } from "./agent.js";
|
|
3
|
+
import { type Door } from "./testing/gateway.js";
|
|
4
|
+
/** The two file verbs, dispatched by `pinecall agent`. */
|
|
5
|
+
export declare function filesRun(door: Door, agent: string, verb: "pull" | "push", rest: string[], values: Typed, out: NodeJS.WritableStream, err: NodeJS.WritableStream): Promise<number>;
|
|
6
|
+
//# sourceMappingURL=agent-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-files.d.ts","sourceRoot":"","sources":["../../src/cli/agent-files.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAOzG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAS,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAWxD,0DAA0D;AAC1D,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,KAAK,EACb,GAAG,EAAE,MAAM,CAAC,cAAc,EAC1B,GAAG,EAAE,MAAM,CAAC,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** `pinecall agent pull | push`: a corner's settings as a file, for whoever keeps them in git and CI. */
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { readSettings, settingsPath } from "./agent-lines.js";
|
|
4
|
+
import { asked } from "./testing/gateway.js";
|
|
5
|
+
/** The two file verbs, dispatched by `pinecall agent`. */
|
|
6
|
+
export async function filesRun(door, agent, verb, rest, values, out, err) {
|
|
7
|
+
if (verb === "pull")
|
|
8
|
+
return pull(door, agent, values.team === true, out, err);
|
|
9
|
+
return push(door, agent, rest[0], values.team === true, out, err);
|
|
10
|
+
}
|
|
11
|
+
// The team's corner unless --team is absent AND the key has one of its own with a row: a machine
|
|
12
|
+
// key pulls the org's own, which is what a CI job keeps in the repository.
|
|
13
|
+
async function pull(door, agent, team, out, err) {
|
|
14
|
+
const answer = await readSettings(door, agent);
|
|
15
|
+
const row = team ? answer.team : (answer.yours ?? answer.team);
|
|
16
|
+
if (row === null) {
|
|
17
|
+
err.write(`nothing set for ${agent} in ${team ? "the team's" : "your"} corner of ${answer.world}\n`);
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
const pulled = { agent, world: answer.world, holder: row.holder, version: row.version, config: row.config };
|
|
21
|
+
out.write(`${JSON.stringify(pulled, null, 2)}\n`);
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
// A push carries no if_version: CI is applying a file, and what stands is what the file says.
|
|
25
|
+
async function push(door, agent, file, team, out, err) {
|
|
26
|
+
if (file === undefined) {
|
|
27
|
+
err.write("push takes the file `pinecall agent pull` wrote\n");
|
|
28
|
+
return 2;
|
|
29
|
+
}
|
|
30
|
+
const read = JSON.parse(await readFile(file, "utf8"));
|
|
31
|
+
const config = read.config ?? read;
|
|
32
|
+
const answer = await asked(door, settingsPath(agent), {
|
|
33
|
+
method: "PUT",
|
|
34
|
+
body: { config, if_version: null, note: `pushed from ${file}`, team },
|
|
35
|
+
});
|
|
36
|
+
const row = team ? answer.team : (answer.yours ?? answer.team);
|
|
37
|
+
out.write(`${agent} · ${answer.world} · ${team ? "the team's corner" : "your corner"} v${row?.version ?? "?"} from ${file}\n`);
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=agent-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-files.js","sourceRoot":"","sources":["../../src/cli/agent-files.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAEzG,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,KAAK,EAAa,MAAM,sBAAsB,CAAC;AAWxD,0DAA0D;AAC1D,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAU,EACV,KAAa,EACb,IAAqB,EACrB,IAAc,EACd,MAAa,EACb,GAA0B,EAC1B,GAA0B;IAE1B,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9E,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACpE,CAAC;AAED,iGAAiG;AACjG,2EAA2E;AAC3E,KAAK,UAAU,IAAI,CAAC,IAAU,EAAE,KAAa,EAAE,IAAa,EAAE,GAA0B,EAAE,GAA0B;IAClH,MAAM,MAAM,GAAG,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C,KAAK,CAAC,EAAE;QAClE,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,IAAI,EAAE,EAAE,IAAI,EAAE;KACtE,CAAC,CAAC;IACH,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,MAAM,MAAM,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,KAAK,GAAG,EAAE,OAAO,IAAI,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC;IAC/H,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** How `pinecall agent` says the three corners on one page, and the door it reads them from. */
|
|
2
|
+
import type { TuningAnswer, TuningBody, TuningRow } from "@pinecall/protocol";
|
|
3
|
+
import { type Door } from "./testing/gateway.js";
|
|
4
|
+
/** The settings door of one agent, spelled once for every verb that knocks at it. */
|
|
5
|
+
export declare function settingsPath(agent: string): string;
|
|
6
|
+
/** The three corners as this key sees them: its own, the team's, production's. */
|
|
7
|
+
export declare function readSettings(door: Door, agent: string): Promise<TuningAnswer>;
|
|
8
|
+
/** The fields on the page, in the order a person reads them, under the names a person types. */
|
|
9
|
+
export declare const FIELDS: readonly ["voice", "tts", "tts-model", "stt", "llm", "greeting", "hangup", "turn", "memory", "knowledge"];
|
|
10
|
+
export type Field = (typeof FIELDS)[number];
|
|
11
|
+
/** The name a person types, as the wire spells it. */
|
|
12
|
+
export declare const WIRE: Record<Field, keyof TuningBody>;
|
|
13
|
+
/** One field of one config, as a cell of the page; undefined when the config does not set it. */
|
|
14
|
+
export declare function shown(config: TuningBody, field: Field): string | undefined;
|
|
15
|
+
/** One kept version on one line: the number, who, when, and why. */
|
|
16
|
+
export declare function versionLine(row: TuningRow): string;
|
|
17
|
+
/**
|
|
18
|
+
* The page: the agent and the world, the three corners as columns, a row per field, and under
|
|
19
|
+
* them which version each corner is at. A corner that set nothing reads as what it falls back
|
|
20
|
+
* to — `(team's)` in your column — because that is what a session built there runs.
|
|
21
|
+
*/
|
|
22
|
+
export declare function linesOf(agent: string, answer: TuningAnswer): string[];
|
|
23
|
+
//# sourceMappingURL=agent-lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-lines.d.ts","sourceRoot":"","sources":["../../src/cli/agent-lines.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,EAAS,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAExD,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,kFAAkF;AAClF,wBAAsB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEnF;AAED,gGAAgG;AAChG,eAAO,MAAM,MAAM,YAAI,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC;AAChI,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5C,sDAAsD;AACtD,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,UAAU,CAWhD,CAAC;AAOF,iGAAiG;AACjG,wBAAgB,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAiC1E;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAIlD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,CAqBrE"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/** How `pinecall agent` says the three corners on one page, and the door it reads them from. */
|
|
2
|
+
import { dayAndTime } from "./knowledge.js";
|
|
3
|
+
import { asked } from "./testing/gateway.js";
|
|
4
|
+
/** The settings door of one agent, spelled once for every verb that knocks at it. */
|
|
5
|
+
export function settingsPath(agent) {
|
|
6
|
+
return `/v1/agents/${encodeURIComponent(agent)}/settings`;
|
|
7
|
+
}
|
|
8
|
+
/** The three corners as this key sees them: its own, the team's, production's. */
|
|
9
|
+
export async function readSettings(door, agent) {
|
|
10
|
+
return await asked(door, settingsPath(agent));
|
|
11
|
+
}
|
|
12
|
+
/** The fields on the page, in the order a person reads them, under the names a person types. */
|
|
13
|
+
export const FIELDS = ["voice", "tts", "tts-model", "stt", "llm", "greeting", "hangup", "turn", "memory", "knowledge"];
|
|
14
|
+
/** The name a person types, as the wire spells it. */
|
|
15
|
+
export const WIRE = {
|
|
16
|
+
voice: "voice",
|
|
17
|
+
tts: "tts",
|
|
18
|
+
"tts-model": "tts_model",
|
|
19
|
+
stt: "stt",
|
|
20
|
+
llm: "llm",
|
|
21
|
+
greeting: "greeting",
|
|
22
|
+
hangup: "hangup",
|
|
23
|
+
turn: "turn",
|
|
24
|
+
memory: "memory",
|
|
25
|
+
knowledge: "knowledge",
|
|
26
|
+
};
|
|
27
|
+
// A cell is one line, however the field is shaped: the words of an opening in quotes, a turn's
|
|
28
|
+
// two numbers, a memory policy as two counts, the bases by name. Long words are cut, because a
|
|
29
|
+
// page of three columns has to stay a page.
|
|
30
|
+
const A_CELL = 40;
|
|
31
|
+
/** One field of one config, as a cell of the page; undefined when the config does not set it. */
|
|
32
|
+
export function shown(config, field) {
|
|
33
|
+
// The wire leaves a field out or sends null for "not set": both read as nothing here.
|
|
34
|
+
if (field === "greeting") {
|
|
35
|
+
const greeting = config.greeting ?? undefined;
|
|
36
|
+
if (greeting === undefined)
|
|
37
|
+
return undefined;
|
|
38
|
+
const say = greeting.say ?? undefined;
|
|
39
|
+
return say !== undefined ? `"${say}"` : `reply: ${greeting.reply ?? ""}`;
|
|
40
|
+
}
|
|
41
|
+
if (field === "hangup") {
|
|
42
|
+
const hangup = config.hangup ?? undefined;
|
|
43
|
+
if (hangup === undefined)
|
|
44
|
+
return undefined;
|
|
45
|
+
return hangup.when === "" || hangup.when === null || hangup.when === undefined ? "may hang up" : `when ${hangup.when}`;
|
|
46
|
+
}
|
|
47
|
+
if (field === "turn") {
|
|
48
|
+
const turn = config.turn ?? undefined;
|
|
49
|
+
if (turn === undefined)
|
|
50
|
+
return undefined;
|
|
51
|
+
const said = [];
|
|
52
|
+
if (turn.endpointing_ms !== undefined && turn.endpointing_ms !== null)
|
|
53
|
+
said.push(`endpointing ${turn.endpointing_ms} ms`);
|
|
54
|
+
if (turn.min_interruption_words !== undefined && turn.min_interruption_words !== null)
|
|
55
|
+
said.push(`interrupt at ${turn.min_interruption_words} words`);
|
|
56
|
+
return said.join(" · ");
|
|
57
|
+
}
|
|
58
|
+
if (field === "memory") {
|
|
59
|
+
const memory = config.memory ?? undefined;
|
|
60
|
+
if (memory === undefined)
|
|
61
|
+
return undefined;
|
|
62
|
+
return `remember ${memory.remember?.length ?? 0} · forget ${memory.forget?.length ?? 0}`;
|
|
63
|
+
}
|
|
64
|
+
if (field === "knowledge") {
|
|
65
|
+
const bases = config.knowledge ?? undefined;
|
|
66
|
+
if (bases === undefined || bases.length === 0)
|
|
67
|
+
return undefined;
|
|
68
|
+
return bases.map((one) => `${one.base}${one.k === undefined || one.k === null ? "" : ` (k ${one.k})`}`).join(" · ");
|
|
69
|
+
}
|
|
70
|
+
const value = config[WIRE[field]];
|
|
71
|
+
return typeof value === "string" ? value : undefined;
|
|
72
|
+
}
|
|
73
|
+
/** One kept version on one line: the number, who, when, and why. */
|
|
74
|
+
export function versionLine(row) {
|
|
75
|
+
const said = [`v${row.version}`, row.author, dayAndTime(row.set_at)];
|
|
76
|
+
if (row.note !== null)
|
|
77
|
+
said.push(`"${row.note}"`);
|
|
78
|
+
return said.join(" · ");
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The page: the agent and the world, the three corners as columns, a row per field, and under
|
|
82
|
+
* them which version each corner is at. A corner that set nothing reads as what it falls back
|
|
83
|
+
* to — `(team's)` in your column — because that is what a session built there runs.
|
|
84
|
+
*/
|
|
85
|
+
export function linesOf(agent, answer) {
|
|
86
|
+
const corners = [
|
|
87
|
+
{ name: "yours", row: answer.yours, fallsTo: "(team's)" },
|
|
88
|
+
{ name: "team", row: answer.team, fallsTo: "—" },
|
|
89
|
+
{ name: "production", row: answer.production, fallsTo: "—" },
|
|
90
|
+
];
|
|
91
|
+
const cell = (corner, field) => {
|
|
92
|
+
if (corner.row === null)
|
|
93
|
+
return corner.fallsTo;
|
|
94
|
+
const value = shown(corner.row.config, field);
|
|
95
|
+
if (value === undefined)
|
|
96
|
+
return "—";
|
|
97
|
+
return value.length > A_CELL ? `${value.slice(0, A_CELL - 1)}…` : value;
|
|
98
|
+
};
|
|
99
|
+
const widths = corners.map((corner) => Math.max(corner.name.length, ...FIELDS.map((field) => cell(corner, field).length)) + 2);
|
|
100
|
+
const lines = [`${agent} · ${answer.world}`, ""];
|
|
101
|
+
lines.push(` ${"".padEnd(14)}${corners.map((corner, at) => corner.name.padEnd(widths[at])).join("")}`.trimEnd());
|
|
102
|
+
for (const field of FIELDS) {
|
|
103
|
+
lines.push(` ${field.replace("-", " ").padEnd(14)}${corners.map((corner, at) => cell(corner, field).padEnd(widths[at])).join("")}`.trimEnd());
|
|
104
|
+
}
|
|
105
|
+
lines.push("");
|
|
106
|
+
lines.push(` ${corners.map((corner) => `${corner.name}: ${corner.row === null ? "nothing set" : versionLine(corner.row)}`).join(" · ")}`);
|
|
107
|
+
return lines;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=agent-lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-lines.js","sourceRoot":"","sources":["../../src/cli/agent-lines.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAIhG,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAa,MAAM,sBAAsB,CAAC;AAExD,qFAAqF;AACrF,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,cAAc,kBAAkB,CAAC,KAAK,CAAC,WAAW,CAAC;AAC5D,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAU,EAAE,KAAa;IAC1D,OAAO,MAAM,KAAK,CAAe,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,gGAAgG;AAChG,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC;AAGhI,sDAAsD;AACtD,MAAM,CAAC,MAAM,IAAI,GAAoC;IACnD,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,WAAW,EAAE,WAAW;IACxB,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,+FAA+F;AAC/F,+FAA+F;AAC/F,4CAA4C;AAC5C,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,iGAAiG;AACjG,MAAM,UAAU,KAAK,CAAC,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IAC3I,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** `pinecall agent list` and `agent stop`: which processes hold the org's agents, where they run, and stopping one. */
|
|
2
|
+
import type { AppProcess } from "@pinecall/protocol";
|
|
3
|
+
import { type Door } from "./testing/gateway.js";
|
|
4
|
+
/** Every app connected in the key's world: one line each, the agents it holds and where it runs. */
|
|
5
|
+
export declare function listed(door: Door, out: NodeJS.WritableStream): Promise<number>;
|
|
6
|
+
/**
|
|
7
|
+
* One app stopped: its socket is closed with the stop code, and a pinecall that hears it exits
|
|
8
|
+
* instead of dialling back. A supervisor that restarts whatever exits starts it again.
|
|
9
|
+
*/
|
|
10
|
+
export declare function stopped(door: Door, app: string | undefined, out: NodeJS.WritableStream, err: NodeJS.WritableStream): Promise<number>;
|
|
11
|
+
/** The line: which app, its agents, whose corner, the machine and address, the SDK, since when. */
|
|
12
|
+
export declare function lineOf(app: AppProcess): string;
|
|
13
|
+
//# sourceMappingURL=agent-processes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-processes.d.ts","sourceRoot":"","sources":["../../src/cli/agent-processes.ts"],"names":[],"mappings":"AAAA,uHAAuH;AAEvH,OAAO,KAAK,EAAW,UAAU,EAAc,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAS,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAExD,oGAAoG;AACpG,wBAAsB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAQpF;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ1I;AAED,mGAAmG;AACnG,wBAAgB,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAK9C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** `pinecall agent list` and `agent stop`: which processes hold the org's agents, where they run, and stopping one. */
|
|
2
|
+
import { asked } from "./testing/gateway.js";
|
|
3
|
+
/** Every app connected in the key's world: one line each, the agents it holds and where it runs. */
|
|
4
|
+
export async function listed(door, out) {
|
|
5
|
+
const { apps } = await asked(door, "/v1/apps");
|
|
6
|
+
if (apps.length === 0) {
|
|
7
|
+
out.write("no app is connected here: `pinecall start` holds a project's agents\n");
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
for (const app of apps)
|
|
11
|
+
out.write(`${lineOf(app)}\n`);
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One app stopped: its socket is closed with the stop code, and a pinecall that hears it exits
|
|
16
|
+
* instead of dialling back. A supervisor that restarts whatever exits starts it again.
|
|
17
|
+
*/
|
|
18
|
+
export async function stopped(door, app, out, err) {
|
|
19
|
+
if (app === undefined) {
|
|
20
|
+
err.write("usage: pinecall agent stop <app> — the app is the first column of `pinecall agent list`\n");
|
|
21
|
+
return 2;
|
|
22
|
+
}
|
|
23
|
+
const answer = await asked(door, `/v1/apps/${encodeURIComponent(app)}/stop`, { method: "POST" });
|
|
24
|
+
out.write(`stopped ${answer.app}: its agents are free — a supervisor that restarts it (systemd, pm2) starts it again\n`);
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
/** The line: which app, its agents, whose corner, the machine and address, the SDK, since when. */
|
|
28
|
+
export function lineOf(app) {
|
|
29
|
+
const whose = app.holder === null ? "the org's" : (app.holder.name ?? app.holder.holder ?? "");
|
|
30
|
+
const where = `${app.host ?? "an unnamed host"}${app.address === null ? "" : ` (${app.address})`}`;
|
|
31
|
+
const since = new Date(app.connected_at * 1000).toISOString().slice(0, 16).replace("T", " ");
|
|
32
|
+
return `${app.app} ${app.agents.join(", ") || "no agent yet"} ${whose} · ${where} · ${app.sdk ?? "an unknown sdk"} · since ${since}`;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=agent-processes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-processes.js","sourceRoot":"","sources":["../../src/cli/agent-processes.ts"],"names":[],"mappings":"AAAA,uHAAuH;AAIvH,OAAO,EAAE,KAAK,EAAa,MAAM,sBAAsB,CAAC;AAExD,oGAAoG;AACpG,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAU,EAAE,GAA0B;IACjE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,CAAU,IAAI,EAAE,UAAU,CAAC,CAAC;IACxD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,GAAG,CAAC,KAAK,CAAC,uEAAuE,CAAC,CAAC;QACnF,OAAO,CAAC,CAAC;IACX,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,GAAG,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAU,EAAE,GAAuB,EAAE,GAA0B,EAAE,GAA0B;IACvH,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,GAAG,CAAC,KAAK,CAAC,2FAA2F,CAAC,CAAC;QACvG,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAa,IAAI,EAAE,YAAY,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7G,GAAG,CAAC,KAAK,CAAC,WAAW,MAAM,CAAC,GAAG,wFAAwF,CAAC,CAAC;IACzH,OAAO,CAAC,CAAC;AACX,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,MAAM,CAAC,GAAe;IACpC,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IAC/F,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,IAAI,IAAI,iBAAiB,GAAG,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC;IACnG,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7F,OAAO,GAAG,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,cAAc,KAAK,KAAK,MAAM,KAAK,MAAM,GAAG,CAAC,GAAG,IAAI,gBAAgB,YAAY,KAAK,EAAE,CAAC;AACzI,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** `pinecall agent history | diff | rollback`: the versions a corner kept, and one of them back. */
|
|
2
|
+
import type { TuningBody, TuningRow } from "@pinecall/protocol";
|
|
3
|
+
import { type Field } from "./agent-lines.js";
|
|
4
|
+
import type { Typed } from "./agent.js";
|
|
5
|
+
import { type Door } from "./testing/gateway.js";
|
|
6
|
+
/** The three version verbs, dispatched by `pinecall agent`. */
|
|
7
|
+
export declare function versionsRun(door: Door, agent: string, verb: "history" | "diff" | "rollback", rest: string[], values: Typed, out: NodeJS.WritableStream, err: NodeJS.WritableStream): Promise<number>;
|
|
8
|
+
/** The fields set differently between two configs, each as `field before → after`. */
|
|
9
|
+
export declare function changes(before: TuningBody, after: TuningBody, lead: string, joined?: string): string;
|
|
10
|
+
/** Whether a kept row sets this field at all, for the pages that draw a row. */
|
|
11
|
+
export declare function sets(row: TuningRow, field: Field): boolean;
|
|
12
|
+
//# sourceMappingURL=agent-versions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-versions.d.ts","sourceRoot":"","sources":["../../src/cli/agent-versions.ts"],"names":[],"mappings":"AAAA,oGAAoG;AAEpG,OAAO,KAAK,EAAgB,UAAU,EAA6B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEzG,OAAO,EAAqD,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAS,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAExD,+DAA+D;AAC/D,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,EACrC,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,KAAK,EACb,GAAG,EAAE,MAAM,CAAC,cAAc,EAC1B,GAAG,EAAE,MAAM,CAAC,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC,CAIjB;AA+CD,sFAAsF;AACtF,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAQ,GAAG,MAAM,CASnG;AAED,gFAAgF;AAChF,wBAAgB,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAE1D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** `pinecall agent history | diff | rollback`: the versions a corner kept, and one of them back. */
|
|
2
|
+
import { FIELDS, linesOf, settingsPath, shown, versionLine } from "./agent-lines.js";
|
|
3
|
+
import { asked } from "./testing/gateway.js";
|
|
4
|
+
/** The three version verbs, dispatched by `pinecall agent`. */
|
|
5
|
+
export async function versionsRun(door, agent, verb, rest, values, out, err) {
|
|
6
|
+
if (verb === "history")
|
|
7
|
+
return history(door, agent, values.team === true, out);
|
|
8
|
+
if (verb === "diff")
|
|
9
|
+
return diff(door, agent, values.against, out, err);
|
|
10
|
+
return rollback(door, agent, rest[0], values.team === true, out, err);
|
|
11
|
+
}
|
|
12
|
+
async function history(door, agent, team, out) {
|
|
13
|
+
const kept = await asked(door, `${settingsPath(agent)}/history?team=${team}`);
|
|
14
|
+
out.write(`${agent} · ${kept.world} · ${kept.holder === "" ? "the org's own corner" : `corner ${kept.holder}`}\n`);
|
|
15
|
+
if (kept.rows.length === 0) {
|
|
16
|
+
out.write(" nothing set yet\n");
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
// Each version against the one before it, so a line says what that save changed and not the
|
|
20
|
+
// whole set again; the oldest is against nothing, and reads as what it set.
|
|
21
|
+
kept.rows.forEach((row, at) => {
|
|
22
|
+
const older = kept.rows[at + 1] ?? null;
|
|
23
|
+
out.write(` ${versionLine(row)}${changes(older?.config ?? {}, row.config, " ")}\n`);
|
|
24
|
+
});
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
async function diff(door, agent, against, out, err) {
|
|
28
|
+
const world = against ?? "production";
|
|
29
|
+
if (world !== "team" && world !== "production") {
|
|
30
|
+
err.write("--against takes team or production\n");
|
|
31
|
+
return 2;
|
|
32
|
+
}
|
|
33
|
+
const said = await asked(door, `${settingsPath(agent)}/diff?against=${world}`);
|
|
34
|
+
const ours = said.ours === null ? "nothing set" : `${said.ours.holder === "" ? "team" : "yours"} v${said.ours.version}`;
|
|
35
|
+
const theirs = said.theirs === null ? "nothing set" : `v${said.theirs.version}`;
|
|
36
|
+
out.write(`${agent} · ${ours} vs ${world} ${theirs}\n`);
|
|
37
|
+
if (said.changed.length === 0) {
|
|
38
|
+
out.write(" the same\n");
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
out.write(`${changes(said.theirs?.config ?? {}, said.ours?.config ?? {}, " ", "\n")}\n`);
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
async function rollback(door, agent, version, team, out, err) {
|
|
45
|
+
const wanted = Number(version);
|
|
46
|
+
if (version === undefined || !Number.isInteger(wanted) || wanted < 1) {
|
|
47
|
+
err.write("rollback takes the version to bring back: `pinecall agent history` lists them\n");
|
|
48
|
+
return 2;
|
|
49
|
+
}
|
|
50
|
+
const answer = await asked(door, `${settingsPath(agent)}/rollback`, { method: "POST", body: { version: wanted, team } });
|
|
51
|
+
out.write(`${linesOf(agent, answer).join("\n")}\n`);
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
/** The fields set differently between two configs, each as `field before → after`. */
|
|
55
|
+
export function changes(before, after, lead, joined = " · ") {
|
|
56
|
+
const said = [];
|
|
57
|
+
for (const field of FIELDS) {
|
|
58
|
+
const was = shown(before, field);
|
|
59
|
+
const is = shown(after, field);
|
|
60
|
+
if (was === is)
|
|
61
|
+
continue;
|
|
62
|
+
said.push(`${field.replace("-", " ")} ${was ?? "—"} → ${is ?? "—"}`);
|
|
63
|
+
}
|
|
64
|
+
return said.length === 0 ? "" : `${lead}${said.join(joined === "\n" ? `\n${lead}` : joined)}`;
|
|
65
|
+
}
|
|
66
|
+
/** Whether a kept row sets this field at all, for the pages that draw a row. */
|
|
67
|
+
export function sets(row, field) {
|
|
68
|
+
return shown(row.config, field) !== undefined;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=agent-versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-versions.js","sourceRoot":"","sources":["../../src/cli/agent-versions.ts"],"names":[],"mappings":"AAAA,oGAAoG;AAIpG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAc,MAAM,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;IAC1B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACjC,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC/B,IAAI,GAAG,KAAK,EAAE;YAAE,SAAS;QACzB,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;AAChG,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,IAAI,CAAC,GAAc,EAAE,KAAY;IAC/C,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** `pinecall agent`: what the org set over the class — yours, the team's, production's — setting it, and the processes that hold it. */
|
|
2
|
+
import { parseArgs } from "node:util";
|
|
3
|
+
import type { TuningBody } from "@pinecall/protocol";
|
|
4
|
+
import type { Group } from "./groups.js";
|
|
5
|
+
export declare const group: Group;
|
|
6
|
+
/** What the verb can be told besides the argv: where to print, and which environment. Tests only. */
|
|
7
|
+
export interface Setting {
|
|
8
|
+
out?: NodeJS.WritableStream;
|
|
9
|
+
err?: NodeJS.WritableStream;
|
|
10
|
+
env?: NodeJS.ProcessEnv;
|
|
11
|
+
}
|
|
12
|
+
/** Every flag the sub-verbs take, declared once: parseArgs is strict, and one table is one seam. */
|
|
13
|
+
export declare const OPTIONS: {
|
|
14
|
+
readonly agent: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
};
|
|
17
|
+
readonly json: {
|
|
18
|
+
readonly type: "boolean";
|
|
19
|
+
readonly default: false;
|
|
20
|
+
};
|
|
21
|
+
readonly team: {
|
|
22
|
+
readonly type: "boolean";
|
|
23
|
+
readonly default: false;
|
|
24
|
+
};
|
|
25
|
+
readonly note: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
};
|
|
28
|
+
readonly voice: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
};
|
|
31
|
+
readonly tts: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
};
|
|
34
|
+
readonly "tts-model": {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
};
|
|
37
|
+
readonly stt: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
};
|
|
40
|
+
readonly llm: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
};
|
|
43
|
+
readonly greeting: {
|
|
44
|
+
readonly type: "string";
|
|
45
|
+
};
|
|
46
|
+
readonly reply: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
};
|
|
49
|
+
readonly hangup: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
};
|
|
52
|
+
readonly "endpointing-ms": {
|
|
53
|
+
readonly type: "string";
|
|
54
|
+
};
|
|
55
|
+
readonly "min-interruption-words": {
|
|
56
|
+
readonly type: "string";
|
|
57
|
+
};
|
|
58
|
+
readonly remember: {
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
readonly multiple: true;
|
|
61
|
+
};
|
|
62
|
+
readonly forget: {
|
|
63
|
+
readonly type: "string";
|
|
64
|
+
readonly multiple: true;
|
|
65
|
+
};
|
|
66
|
+
readonly against: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export type Typed = ReturnType<typeof parseArgs<{
|
|
71
|
+
options: typeof OPTIONS;
|
|
72
|
+
allowPositionals: true;
|
|
73
|
+
}>>["values"];
|
|
74
|
+
export declare function run(argv: string[], how?: Setting): Promise<number>;
|
|
75
|
+
/** What this command line set, under the wire's names, over what the corner's row already says. */
|
|
76
|
+
export declare function typed(values: Typed, standing: TuningBody): Partial<TuningBody>;
|
|
77
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/cli/agent.ts"],"names":[],"mappings":"AAAA,wIAAwI;AAExI,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAgBzC,eAAO,MAAM,KAAK,EAAE,KA8BnB,CAAC;AAEF,qGAAqG;AACrG,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAED,oGAAoG;AACpG,eAAO,MAAM,OAAO;aAClB,KAAK;iBAAI,IAAI,EAAE,QAAQ;;aACvB,IAAI;iBAAI,IAAI,EAAE,SAAS;iBAAE,OAAO;;aAChC,IAAI;iBAAI,IAAI,EAAE,SAAS;iBAAE,OAAO;;aAChC,IAAI;iBAAI,IAAI,EAAE,QAAQ;;aACtB,KAAK;iBAAI,IAAI,EAAE,QAAQ;;aACvB,GAAG;iBAAI,IAAI,EAAE,QAAQ;;aACrB,WAAW;iBAAI,IAAI,EAAE,QAAQ;;aAC7B,GAAG;iBAAI,IAAI,EAAE,QAAQ;;aACrB,GAAG;iBAAI,IAAI,EAAE,QAAQ;;aACrB,QAAQ;iBAAI,IAAI,EAAE,QAAQ;;aAC1B,KAAK;iBAAI,IAAI,EAAE,QAA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