@sjawhar/pi-envoy 16.31.0 → 16.32.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/dist/envoy.js CHANGED
@@ -42650,7 +42650,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
42650
42650
 
42651
42651
  // package.json
42652
42652
  var name = "@sjawhar/pi-envoy";
42653
- var version2 = "16.31.0";
42653
+ var version2 = "16.32.0";
42654
42654
  var package_default = {
42655
42655
  name,
42656
42656
  version: version2,
@@ -42680,7 +42680,7 @@ var package_default = {
42680
42680
  prepack: "../../scripts/pi-plugin-prepack.sh",
42681
42681
  postpack: "rm -rf dist/skills",
42682
42682
  typecheck: "bunx tsc --noEmit",
42683
- test: "bun test --path-ignore-patterns=extensions/card-delivery-omp.test.ts && bun test ./extensions/card-delivery-omp.test.ts",
42683
+ test: "bun test",
42684
42684
  lint: "bunx biome lint extensions/ src/"
42685
42685
  },
42686
42686
  devDependencies: {
@@ -42688,6 +42688,7 @@ var package_default = {
42688
42688
  "@legion/contracts": "workspace:*",
42689
42689
  "@legion/envoy-client": "workspace:*",
42690
42690
  "@legion/pi-shared": "workspace:*",
42691
+ "@legion/test-fixtures": "workspace:*",
42691
42692
  "@oh-my-pi/pi-tui": "^18.6.0",
42692
42693
  "@oh-my-pi/pi-utils": "^18.6.0",
42693
42694
  "@toon-format/toon": "^4.1.1",
@@ -47967,6 +47968,14 @@ function liveSessionSettings(live) {
47967
47968
  };
47968
47969
  }
47969
47970
  var codec2 = import_nats2.StringCodec();
47971
+ var NATS_CONNECT = Symbol.for("legion.pi-envoy.nats-connect");
47972
+ var natsConnectStore = globalThis;
47973
+ function setNatsConnectForTests(dial) {
47974
+ natsConnectStore[NATS_CONNECT] = dial;
47975
+ }
47976
+ function resetNatsConnectForTests() {
47977
+ delete natsConnectStore[NATS_CONNECT];
47978
+ }
47970
47979
  var NATS_RETRY_INTERVAL_MS = 15000;
47971
47980
  var DELIVERY_PICTURES_TIMEOUT_MS = 20000;
47972
47981
  var WHOLE_BODY_TIMEOUT_MS = 1e4;
@@ -48348,7 +48357,7 @@ function envoyExtension(pi) {
48348
48357
  };
48349
48358
  const dialNats = async () => {
48350
48359
  const { natsUrls, natsSeed } = requireInbound();
48351
- return import_nats2.connect(natsConnectionOptions({
48360
+ return (natsConnectStore[NATS_CONNECT] ?? import_nats2.connect)(natsConnectionOptions({
48352
48361
  servers: natsUrls,
48353
48362
  name: `omp-${sessionID || "unknown"}`,
48354
48363
  seed: natsSeed
@@ -50396,5 +50405,7 @@ function topicsFor(parameters, fallback = []) {
50396
50405
  return expandSubscriptionTopics(value);
50397
50406
  }
50398
50407
  export {
50399
- envoyExtension as default
50408
+ envoyExtension as default,
50409
+ resetNatsConnectForTests,
50410
+ setNatsConnectForTests
50400
50411
  };
@@ -19,7 +19,10 @@ agent-secrets NAME... [--reason TEXT] [--wait DURATION] [--ttl DURATION] -- <com
19
19
  a secret behind the airlock, as a placeholder standing for it (below). Nothing runs unless
20
20
  every name is granted: a denial of one name denies the whole request, so the command never starts
21
21
  with some of its secrets missing (`cmdExec`, `packages/envoy/cmd/agent-secrets/main.go`).
22
- - `--reason` is what a person reads if the request waits for a decision. Write one.
22
+ - `--reason` is necessary wherever a person approves: a request that names a secret someone must
23
+ decide, and carries none, is denied whole. Say what the credential is for, in a sentence the
24
+ approver can decide on. A request every name of which is granted at once reaches nobody and
25
+ needs none.
23
26
  - `agent-secrets --help` holds the rest: the flags that narrow a GitHub App token
24
27
  (`--github-owner`, `--github-repo`, `--github-read-only`), and how long a grant lasts.
25
28
  - A narrowing and the airlock do not go together. Ask for a narrowing in a run whose grant holds
@@ -110,7 +113,7 @@ Your transcript keeps everything a command prints.
110
113
  reads the placeholder's shape and not the value's:
111
114
 
112
115
  ```sh
113
- agent-secrets NAME -- sh -c 'echo "${#NAME}"; case "$NAME" in ghp_*) echo prefix-ok;; *) echo prefix-no;; esac'
116
+ agent-secrets NAME --reason 'check the shape of this credential' -- sh -c 'echo "${#NAME}"; case "$NAME" in ghp_*) echo prefix-ok;; *) echo prefix-no;; esac'
114
117
  ```
115
118
 
116
119
  - Compare two values only as equal or not equal. Never print, slice or diff their characters.
@@ -138,7 +141,10 @@ Without the grant line the status is the client's own:
138
141
  `AGENT_SECRETS_URL`, no `--`, no `NAME`, or a flag value the client refuses.
139
142
  - **75** — the request still waits for a person. The message names who decides it, where, and the
140
143
  `agent-secrets status <request_id>` that reads it.
141
- - **77** — the request was denied.
144
+ - **77** — the request was denied. The approver denied it, the policy refused a name (a
145
+ service's secret, or one whose requesters list does not name this session), or the request
146
+ named a secret a person must approve and carried no reason, which the detail reads
147
+ `<NAME>: a reason is necessary; ask again with --reason`.
142
148
 
143
149
  The other statuses come from forms this skill does not use: 76 from `agent-secrets renew`, a
144
150
  refusal that is permanent; 126 and 127 from `agent-secrets register --exec`, whose command could not
@@ -36,7 +36,8 @@ For each spec, ask, comment and message:
36
36
 
37
37
  - Write in `skill://asd-ste100`'s strict mode.
38
38
  - Write about the current design, never the person or how people reached it, and never quote or upload their words.
39
- - Link each source where the person wrote it, each id whole. With no link, state the design.
39
+ - Link each source where the person wrote it. With no link, state the design.
40
+ - Treat a person's stated preference or past answer as evidence of their taste, never as a ruling that settles the question: an answer given once is not a standing rule. A commit attributed to a person is not their decision, because agents commit the work.
40
41
  - In a spec, cite code by file and symbol, never a line number: it goes stale at the next edit.
41
42
  - A sentence citing a gate passing (test, review, check) also says what the pass does not show: "Tests pass: a wrong verdict, not a missing one."
42
43
  - Keep only text a reader needs to understand, decide, build or check, and say what each issue you name does for them (`skill://plain-words`).
@@ -46,7 +47,6 @@ For each spec, ask, comment and message:
46
47
 
47
48
  - Name the concrete case and its numbers, then the choice in those terms, never "Which option?".
48
49
  - A choice inside what the person asked for, one their messages favour, routine cleanup, sequencing, naming, a choice between equivalent options, and a fix you can make are yours.
49
- - Ask only for the person's authority, taste or risk appetite, when options differ on what they care about.
50
50
  - Ask with an [ask block](skill://dispatch/SKILL.md#asks-and-ask-blocks): 2 to 4 options, answerable on a phone, and name nothing the reader cannot see from it ("the message above").
51
51
  - For each technical term you coined in this session, count by exact match the files holding it, in the repositories the work touches and in Dispatch; a single-digit count means expand the term or drop it, because a coinage reads as familiar to you. A count misses a coinage of common words, so read the draft for those too.
52
52
  - Measure each claim the ask rests on, its premise and each option's precondition. Where you cannot, mark the claim unverified and name the missing measurement; call an option unavailable only where a precondition demonstrably fails. A premise can go stale within the hour; no unmeasured number goes in one.
@@ -70,7 +70,7 @@ Choices—answered asks included—earn `decisions.md` `##` sections only if a d
70
70
 
71
71
  ## Old specs
72
72
 
73
- Rewrite a spec outside the outline whole in one version, its ask blocks moved with `doc-edit`'s `move`; restate each retelling, quotation or unlinked attribution as design, or cut it.
73
+ Rewrite a spec outside the outline whole in one version, its ask blocks moved with `doc-edit`'s `move`.
74
74
 
75
75
  ## Approval
76
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-envoy",
3
- "version": "16.31.0",
3
+ "version": "16.32.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {
@@ -27,7 +27,7 @@
27
27
  "prepack": "../../scripts/pi-plugin-prepack.sh",
28
28
  "postpack": "rm -rf dist/skills",
29
29
  "typecheck": "bunx tsc --noEmit",
30
- "test": "bun test --path-ignore-patterns=extensions/card-delivery-omp.test.ts && bun test ./extensions/card-delivery-omp.test.ts",
30
+ "test": "bun test",
31
31
  "lint": "bunx biome lint extensions/ src/"
32
32
  },
33
33
  "devDependencies": {
@@ -35,6 +35,7 @@
35
35
  "@legion/contracts": "0.10.0",
36
36
  "@legion/envoy-client": "0.1.0",
37
37
  "@legion/pi-shared": "0.1.0",
38
+ "@legion/test-fixtures": "0.1.0",
38
39
  "@oh-my-pi/pi-tui": "^18.6.0",
39
40
  "@oh-my-pi/pi-utils": "^18.6.0",
40
41
  "@toon-format/toon": "^4.1.1",