@tryvira/opencode 0.1.93 → 0.1.95

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 CHANGED
@@ -1,4 +1,4 @@
1
- # `@tryvira/opencode` 0.1.93
1
+ # `@tryvira/opencode` 0.1.95
2
2
 
3
3
  OpenCode V2 server plugin for Vira host lifecycle governance. The package default
4
4
  exports the V2 setup surface plus a compatibility `server()` transport required
@@ -7,16 +7,16 @@ exported separately as `v1Fallback` and is not the old unconditional-deny path.
7
7
 
8
8
  ### OpenCode 2.4.x plugin inventory
9
9
 
10
- Install with `opencode plugin add @tryvira/opencode@0.1.93`. If
11
- `opencode plugin check` reports `Server / vira 0.1.93 (current)` and
12
- `opencode debug config` contains the package but the first
13
- `opencode plugin list` says `No plugins found`, the plugin is configured and
14
- OpenCode has hit its cold-location activation race. Run the list command again
15
- after activation or use `opencode --standalone plugin list` for an isolated
16
- check. Do not remove and reinstall the Vira package solely because the first
17
- inventory read is empty. The package exports both `./server` and `./tui`; an
18
- empty first inventory read is a host listing defect, not missing Vira manifest
19
- metadata.
10
+ Install with `opencode plugin add @tryvira/opencode@0.1.95`. The
11
+ authoritative fresh-install check is `opencode plugin check` plus
12
+ `opencode debug config` (the latter must contain
13
+ `@tryvira/opencode@0.1.95`). OpenCode 2.4.x can still report `No plugins found`
14
+ from `plugin list` immediately after an install because its background plugin
15
+ inventory is populated asynchronously; this is a host inventory race, not
16
+ missing Vira metadata. Do not remove and reinstall the package. Re-run
17
+ `opencode plugin check` after the host is warm, and use
18
+ `opencode --standalone debug config` when validating an isolated config. The
19
+ package exports both `./server` and `./tui`.
20
20
 
21
21
  It resolves Vira behavior on every `context` hook, observes tool results, and in `enforce` mode blocks tool execution unless a host action authorizer returns an exact Vira `ALLOW` receipt. OpenCode V2 does not expose a supported response-before-display hook, so post-model verification is reported as unsupported rather than claimed as enforced.
22
22
 
@@ -76,3 +76,7 @@ Server-owned COMPOUND/HYBRID execution remains fenced from native model and tool
76
76
  ### OpenCode V2: explicit read-only result viewer
77
77
 
78
78
  The `./tui` export registers `/vira-result <host-task-run-host-turn:…>` and a Vira palette command. Run it in the original session using the reference in the server handoff error. The TUI process must have the configured Vira API URL, owner API key, organization/project/environment/department and AI System ID (same plugin options or environment variables as the server). It verifies the exact session, scope, persisted result, child evidence and current checkpoint before opening a local dialog. It never invokes the model, creates a synthetic message or approves an action. Long output is paged. This is an explicit TUI viewer, not automatic V2 transcript insertion. Build the package before using the new export.
79
+
80
+ ### Commercial wallet readback
81
+
82
+ With an authorized organization-scope owner or Billing Admin identity, the MCP tool `get_ai_credit_wallet` accepts `includeCommercial: true` to request approved agreement summaries. The plugin also exports `readOpenCodeCommercialWallet(client, true)` for explicit host-side reads. Neither runs automatically in model hooks. Department machine keys are not granted organization-wide finance authority. This does not add a native OpenCode financial panel or enable payment collection.
package/dist/index.js CHANGED
@@ -154,8 +154,8 @@ var ViraClient = class {
154
154
  if (!actorId.trim()) throw new Error("SDK_ACTOR_ID_REQUIRED");
155
155
  return this.request({ method: "POST", path: `/v1/organization/billing-admins/${encodeURIComponent(actorId)}`, body: { status } }, { idempotencyKey: options.idempotencyKey ?? `sdk:billing-admin:${globalThis.crypto.randomUUID()}`, enforcing: true });
156
156
  }
157
- getAICreditWallet() {
158
- return this.request({ method: "GET", path: "/v1/billing/credits" });
157
+ getAICreditWallet(input2 = {}) {
158
+ return this.request({ method: "GET", path: "/v1/billing/credits", ...input2.includeCommercial === true ? { query: { includeCommercial: "true" } } : {} });
159
159
  }
160
160
  listAICreditBudgets() {
161
161
  return this.request({ method: "GET", path: "/v1/billing/credits/budgets" });
package/dist/server.js CHANGED
@@ -154,8 +154,8 @@ var ViraClient = class {
154
154
  if (!actorId.trim()) throw new Error("SDK_ACTOR_ID_REQUIRED");
155
155
  return this.request({ method: "POST", path: `/v1/organization/billing-admins/${encodeURIComponent(actorId)}`, body: { status } }, { idempotencyKey: options.idempotencyKey ?? `sdk:billing-admin:${globalThis.crypto.randomUUID()}`, enforcing: true });
156
156
  }
157
- getAICreditWallet() {
158
- return this.request({ method: "GET", path: "/v1/billing/credits" });
157
+ getAICreditWallet(input2 = {}) {
158
+ return this.request({ method: "GET", path: "/v1/billing/credits", ...input2.includeCommercial === true ? { query: { includeCommercial: "true" } } : {} });
159
159
  }
160
160
  listAICreditBudgets() {
161
161
  return this.request({ method: "GET", path: "/v1/billing/credits/budgets" });
package/dist/tui.js CHANGED
@@ -124,8 +124,8 @@ var ViraClient = class {
124
124
  if (!actorId.trim()) throw new Error("SDK_ACTOR_ID_REQUIRED");
125
125
  return this.request({ method: "POST", path: `/v1/organization/billing-admins/${encodeURIComponent(actorId)}`, body: { status } }, { idempotencyKey: options.idempotencyKey ?? `sdk:billing-admin:${globalThis.crypto.randomUUID()}`, enforcing: true });
126
126
  }
127
- getAICreditWallet() {
128
- return this.request({ method: "GET", path: "/v1/billing/credits" });
127
+ getAICreditWallet(input = {}) {
128
+ return this.request({ method: "GET", path: "/v1/billing/credits", ...input.includeCommercial === true ? { query: { includeCommercial: "true" } } : {} });
129
129
  }
130
130
  listAICreditBudgets() {
131
131
  return this.request({ method: "GET", path: "/v1/billing/credits/budgets" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvira/opencode",
3
- "version": "0.1.93",
3
+ "version": "0.1.95",
4
4
  "description": "OpenCode host lifecycle integration for Vira",
5
5
  "keywords": [
6
6
  "opencode",