triss-coworker 0.20.0 → 0.22.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/CHANGELOG.md +151 -1
- package/README.md +59 -0
- package/bin/triss.js +32 -0
- package/docs/coder-agent-plan.md +617 -0
- package/docs/configuration.md +28 -0
- package/docs/crush-glm-integration.md +294 -0
- package/docs/mcp.md +27 -0
- package/package.json +1 -1
- package/src/commands/coder.js +1365 -0
- package/src/commands/config.js +22 -12
- package/src/commands/status.js +29 -1
- package/src/git.js +21 -0
- package/src/mcp/handlers.js +75 -0
- package/src/mcp/tools.js +53 -0
- package/src/secrets.js +7 -0
- package/src/usage.js +20 -5
- package/templates/claude-full.md +59 -0
- package/templates/claude.md +5 -0
- package/templates/codex-full.md +27 -0
- package/templates/codex.md +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,12 +7,100 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.22.0] — 2026-07-04
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `triss coder init` now auto-detects which Z.AI endpoint a
|
|
15
|
+
`ZHIPU_API_KEY` actually authenticates against (`zai-coding-plan`
|
|
16
|
+
subscription vs. pay-as-you-go `zai`) and writes the matching provider
|
|
17
|
+
prefix into `opencode.json` — the previous hardcoded `zai-coding-plan`
|
|
18
|
+
default was derived from a single account and silently mismatched keys
|
|
19
|
+
targeting the other plan, which makes opencode retry a failing model
|
|
20
|
+
call forever. If `opencode.json` already exists, `init` still runs
|
|
21
|
+
detection and warns (without touching the file) on a mismatched prefix.
|
|
22
|
+
- Interactive GLM model picker in `init`: when writing a new
|
|
23
|
+
`opencode.json` from a TTY, choose the main model (`glm-5.2` default,
|
|
24
|
+
`glm-5-turbo`, `glm-4.7`) and the small/fast model instead of always
|
|
25
|
+
getting the hardcoded default. Non-interactive runs keep the silent
|
|
26
|
+
default; `TRISS_CODER_MODEL`/`TRISS_CODER_SMALL_MODEL` env overrides
|
|
27
|
+
still win over both the picker and the default.
|
|
28
|
+
|
|
29
|
+
## [0.21.0] — 2026-07-03
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- `triss coder` — delegate implementation tasks to a GLM coding agent via
|
|
34
|
+
the `opencode` engine (`opencode-ai`, pinned):
|
|
35
|
+
- `triss coder init` scaffolds `opencode.json` (deny-first `bash`
|
|
36
|
+
allowlist, `webfetch`/`websearch` denied; the engine subprocess gets a
|
|
37
|
+
minimal allowlisted env) plus `coder`/`researcher` agent templates
|
|
38
|
+
under `.opencode/` (researcher additionally denies `edit`/`bash`), and
|
|
39
|
+
guides installing the pinned engine.
|
|
40
|
+
- `triss coder run [prompt]` spawns the engine and prints a single JSON
|
|
41
|
+
envelope on stdout (`{engine, engine_version, session_id, exit_reason,
|
|
42
|
+
final_text, files_changed, diff_stat, worktree, usage, warnings}`).
|
|
43
|
+
Supports `--session <slug>` (a local slug mapped to opencode's real
|
|
44
|
+
session id in `.triss/sessions.json`, so callers never need to know
|
|
45
|
+
the real id), `--continue`, `--agent`, `--model`, `--isolate`
|
|
46
|
+
(disposable `.triss/wt/<slug>` git worktree on a `coder/<slug>`
|
|
47
|
+
branch, with content-based integrity checks on seeded
|
|
48
|
+
`opencode.json`/`.opencode/` so an agent-edited policy file always
|
|
49
|
+
stays visible in the diff instead of being silently excluded), `--cwd`,
|
|
50
|
+
and `--timeout` (default 900s, SIGTERM→SIGKILL on expiry). POSIX only
|
|
51
|
+
for now.
|
|
52
|
+
- `triss coder clean [--all]` removes disposable worktrees (and their
|
|
53
|
+
branch, when safely mergeable) created by `--isolate`.
|
|
54
|
+
- `triss status` gained a coder readiness block (engine version vs. the
|
|
55
|
+
pinned version, opencode.json presence, live worktree count).
|
|
56
|
+
- New MCP tools `triss_coder_run` and `triss_coder_status`, gated on
|
|
57
|
+
`ZHIPU_API_KEY` like the CLI; `triss_coder_run` defaults to a 300s
|
|
58
|
+
timeout (vs. 900s on the CLI) since MCP hosts commonly time out long
|
|
59
|
+
tool calls.
|
|
60
|
+
- New env vars: `ZHIPU_API_KEY` (required), `TRISS_CODER_MODEL`,
|
|
61
|
+
`TRISS_CODER_SMALL_MODEL`, `TRISS_CODER_OPENCODE_VERSION`.
|
|
62
|
+
|
|
63
|
+
## [0.20.1] — 2026-07-03
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- `deepseek-v4-pro` default prices in cost estimation updated to the
|
|
68
|
+
current DeepSeek list price ($0.435 / $0.87 per 1M tokens, cache hit
|
|
69
|
+
$0.003625) — previous defaults overstated `triss usage` costs ~4×.
|
|
70
|
+
Flash prices were already correct.
|
|
71
|
+
- `npm audit` clean again: bumped transitive `hono`, `qs`, and
|
|
72
|
+
`brace-expansion` (HTTP-transport deps of the MCP SDK; Triss uses
|
|
73
|
+
stdio, so the advisories were not exploitable here).
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
|
|
77
|
+
- Compliance-ready security documentation: SECURITY.md now covers the
|
|
78
|
+
no-telemetry guarantee, usage-log contents and retention, data
|
|
79
|
+
residency / GDPR guidance, and the supply-chain posture; README gained
|
|
80
|
+
a "Security & privacy" summary section for vendor reviews.
|
|
81
|
+
|
|
82
|
+
## [0.20.0] — 2026-06-17
|
|
83
|
+
|
|
10
84
|
### Added
|
|
11
85
|
|
|
12
86
|
- New `triss jira whoami` command and `triss_jira_whoami` MCP tool. Both
|
|
13
87
|
call `GET /rest/api/3/myself` and print the authenticated account —
|
|
14
88
|
most usefully the `accountId`, which is the value `--assignee` (and the
|
|
15
89
|
`assignee` field on create/update) expects.
|
|
90
|
+
- Official pnpm / yarn install support: README documents install + dlx
|
|
91
|
+
usage for both, `packageManager` is pinned in `package.json`, and CI
|
|
92
|
+
gained a job that packs the tarball and installs it via pnpm in a
|
|
93
|
+
fresh project to catch lifecycle-script / peerDeps regressions.
|
|
94
|
+
|
|
95
|
+
### Changed
|
|
96
|
+
|
|
97
|
+
- The npm publish workflow now runs lint before publishing, matching the
|
|
98
|
+
test workflow.
|
|
99
|
+
|
|
100
|
+
## [0.19.0] — 2026-05-15
|
|
101
|
+
|
|
102
|
+
### Added
|
|
103
|
+
|
|
16
104
|
- Per-invocation `call_id` (UUIDv4) on every usage record. Each CLI
|
|
17
105
|
subcommand and MCP tool call is wrapped in an `AsyncLocalStorage`
|
|
18
106
|
context so consumers of `~/.cache/triss/usage.jsonl` (e.g.
|
|
@@ -21,6 +109,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
21
109
|
process carries it as `parent_call_id`, letting a host (Claude Code,
|
|
22
110
|
CI job, wrapper script) attribute several Triss calls to one outer
|
|
23
111
|
session.
|
|
112
|
+
- CODE_OF_CONDUCT.md (Contributor Covenant v2.1) with a private
|
|
113
|
+
security-advisory contact path.
|
|
114
|
+
|
|
115
|
+
### Changed
|
|
116
|
+
|
|
117
|
+
- README cost section now uses a full week of captured DeepSeek usage
|
|
118
|
+
data (May 6–13, 2026) instead of a single-benchmark estimate.
|
|
119
|
+
- CLAUDE.md / AGENTS.md are explicitly labelled as contributor-only
|
|
120
|
+
agent rules; removed an outdated internal test plan and fixed the
|
|
121
|
+
wizard target name (`deepseek` → `worker`) in docs/configuration.md.
|
|
122
|
+
|
|
123
|
+
## [0.18.0] — 2026-05-10
|
|
124
|
+
|
|
125
|
+
### Added
|
|
126
|
+
|
|
127
|
+
- Linear planning ("gantt") toolkit: `triss_linear_milestone_list` /
|
|
128
|
+
`milestone-list`, `triss_linear_milestone_create` / `milestone-create`,
|
|
129
|
+
`triss_linear_label_list` / `label-list`, and `triss_linear_bulk_update`
|
|
130
|
+
/ `bulk-update --ids`.
|
|
131
|
+
- `triss_linear_create` / `update` / `bulk_update` now accept `due_date`
|
|
132
|
+
(TimelessDate), `milestone` (UUID), `labels` (UUIDs or names), and
|
|
133
|
+
`assignee` by UUID / email / displayName.
|
|
134
|
+
- Live-schema integration test (`test/linear-integration.test.js`,
|
|
135
|
+
skipped without `LINEAR_API_KEY`) that introspects the real Linear
|
|
136
|
+
schema and asserts every field Triss reads or writes exists.
|
|
137
|
+
|
|
138
|
+
### Fixed
|
|
139
|
+
|
|
140
|
+
- Removed `start_date` from every layer (MCP tools, CLI flags, agent
|
|
141
|
+
instructions): Linear's `IssueCreateInput` / `IssueUpdateInput` do not
|
|
142
|
+
expose `startDate`, so the field could never work; docs now point at
|
|
143
|
+
project milestones for explicit anchors.
|
|
144
|
+
- Explicit label-clearing semantics: `labels: []` (or `--labels ''`)
|
|
145
|
+
clears all labels, while omitting the field leaves them untouched.
|
|
146
|
+
|
|
147
|
+
## [0.17.0] — 2026-05-10
|
|
148
|
+
|
|
149
|
+
### Added
|
|
150
|
+
|
|
151
|
+
- Linear project and initiative support: list and create projects, list
|
|
152
|
+
initiatives (with the two-step `initiativeToProjectCreate` link), and
|
|
153
|
+
set `dueDate` on issues.
|
|
154
|
+
|
|
155
|
+
## [0.16.1] — 2026-05-08
|
|
156
|
+
|
|
157
|
+
### Fixed
|
|
158
|
+
|
|
159
|
+
- Project-root detection now strips the `.claude/worktrees/<id>/...`
|
|
160
|
+
suffix, so the safety helpers and `.triss.env` lookup work inside
|
|
161
|
+
Claude Code temporary worktrees.
|
|
24
162
|
|
|
25
163
|
## [0.16.0] — 2026-05-08
|
|
26
164
|
|
|
@@ -381,7 +519,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
381
519
|
|
|
382
520
|
- Initial release of `triss-coworker`.
|
|
383
521
|
|
|
384
|
-
[Unreleased]: https://github.com/ayleen/triss-coworker/compare/v0.
|
|
522
|
+
[Unreleased]: https://github.com/ayleen/triss-coworker/compare/v0.22.0...HEAD
|
|
523
|
+
[0.22.0]: https://github.com/ayleen/triss-coworker/compare/v0.21.0...v0.22.0
|
|
524
|
+
[0.21.0]: https://github.com/ayleen/triss-coworker/compare/v0.20.1...v0.21.0
|
|
525
|
+
[0.20.1]: https://github.com/ayleen/triss-coworker/compare/v0.20.0...v0.20.1
|
|
526
|
+
[0.20.0]: https://github.com/ayleen/triss-coworker/compare/v0.19.0...v0.20.0
|
|
527
|
+
[0.19.0]: https://github.com/ayleen/triss-coworker/compare/v0.18.0...v0.19.0
|
|
528
|
+
[0.18.0]: https://github.com/ayleen/triss-coworker/compare/v0.17.0...v0.18.0
|
|
529
|
+
[0.17.0]: https://github.com/ayleen/triss-coworker/compare/v0.16.1...v0.17.0
|
|
530
|
+
[0.16.1]: https://github.com/ayleen/triss-coworker/compare/v0.16.0...v0.16.1
|
|
531
|
+
[0.16.0]: https://github.com/ayleen/triss-coworker/compare/v0.15.2...v0.16.0
|
|
532
|
+
[0.15.2]: https://github.com/ayleen/triss-coworker/compare/v0.15.1...v0.15.2
|
|
533
|
+
[0.15.1]: https://github.com/ayleen/triss-coworker/compare/v0.15.0...v0.15.1
|
|
534
|
+
[0.15.0]: https://github.com/ayleen/triss-coworker/compare/v0.14.0...v0.15.0
|
|
385
535
|
[0.14.0]: https://github.com/ayleen/triss-coworker/compare/v0.13.1...v0.14.0
|
|
386
536
|
[0.13.1]: https://github.com/ayleen/triss-coworker/compare/v0.13.0...v0.13.1
|
|
387
537
|
[0.13.0]: https://github.com/ayleen/triss-coworker/releases/tag/v0.13.0
|
package/README.md
CHANGED
|
@@ -39,6 +39,7 @@ tokens of tracker chatter into its own context. Adding a new provider
|
|
|
39
39
|
- [Models](#models)
|
|
40
40
|
- [Environment reference](#environment-reference)
|
|
41
41
|
- [Cost in practice](#cost-in-practice)
|
|
42
|
+
- [Security & privacy](#security--privacy)
|
|
42
43
|
- [Roadmap](#roadmap)
|
|
43
44
|
- [Contributing and security](#contributing-and-security)
|
|
44
45
|
- [Changelog](#changelog)
|
|
@@ -235,6 +236,10 @@ The exposed tool set is **filtered by configured credentials**:
|
|
|
235
236
|
- **`triss_linear_*`** when `LINEAR_API_KEY` is set.
|
|
236
237
|
- **`triss_github_*`** when `GITHUB_TOKEN` is set (or `gh` CLI logged in).
|
|
237
238
|
- **`triss_gitlab_*`** when `GITLAB_TOKEN` is set.
|
|
239
|
+
- **`triss_coder_run` + `triss_coder_status`** when `ZHIPU_API_KEY` is set
|
|
240
|
+
(setup: `triss coder init`). `triss_coder_run`'s timeout defaults to
|
|
241
|
+
300s over MCP, not the CLI's 900s — long tasks should go through
|
|
242
|
+
`triss coder run` on the CLI instead.
|
|
238
243
|
|
|
239
244
|
Add credentials later → restart session → new tools appear automatically.
|
|
240
245
|
|
|
@@ -262,6 +267,9 @@ and writing**.
|
|
|
262
267
|
| `triss review` | Code review on current branch or a PR (diff + linked ticket) | The agent reading the whole diff |
|
|
263
268
|
| `triss commit-msg` | Generates a commit message from staged diff | Hand-writing or copy-pasting from web LLMs |
|
|
264
269
|
| `triss usage` | Cumulative cost / token usage with per-project breakdown | Squinting at stderr after each call |
|
|
270
|
+
| `triss coder init` | Sets up a GLM coding agent (opencode engine): key, `opencode.json`, agent templates | Manually installing/configuring opencode |
|
|
271
|
+
| `triss coder run` | Spawns the GLM coding agent and prints one JSON envelope (`--isolate` for a disposable worktree). **POSIX only** (macOS/Linux) — refuses to run on Windows. | Manually driving `opencode run` and parsing its ndjson stream |
|
|
272
|
+
| `triss coder clean` | Removes finished `.triss/wt` isolation worktrees (`--all` forces all) | Manually finding and deleting stale git worktrees |
|
|
265
273
|
| `triss init` | Drops a tiny (~15 line) delegation block into `CLAUDE.md` / `AGENTS.md` | Hand-writing routing rules |
|
|
266
274
|
| `triss agent-help` | Prints the full delegation cookbook on demand (the nano block points here) | A 200-line CLAUDE.md that always loads |
|
|
267
275
|
| `triss status` | Shows current model + key + .env sources | — |
|
|
@@ -418,6 +426,30 @@ forms, and SVG; `<main>` / `<article>` are preferred when present;
|
|
|
418
426
|
non-HTML responses (JSON, plain text) are returned verbatim. 30-second
|
|
419
427
|
default timeout, configurable via `--timeout <ms>`.
|
|
420
428
|
|
|
429
|
+
### `triss coder`
|
|
430
|
+
|
|
431
|
+
Delegates an implementation task to a GLM coding agent (the `opencode`
|
|
432
|
+
engine) instead of the primary model writing the code itself.
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
triss coder init # once: key, opencode.json, agent templates
|
|
436
|
+
triss coder run "add input validation to /signup" --isolate
|
|
437
|
+
triss coder clean # remove finished isolation worktrees
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
`triss coder init` probes which Z.AI plan your key actually works with
|
|
441
|
+
(subscription vs. pay-as-you-go) and writes the matching model prefix, and
|
|
442
|
+
lets you pick the GLM model interactively instead of always defaulting to
|
|
443
|
+
`glm-5.2`.
|
|
444
|
+
|
|
445
|
+
Prints one JSON envelope to stdout — `files_changed`, `diff_stat`, and
|
|
446
|
+
`worktree` tell you what to review; `--isolate` runs the agent in a
|
|
447
|
+
disposable `.triss/wt/<slug>` git worktree so it never touches your
|
|
448
|
+
working tree directly. `--session <slug>` continues the same opencode
|
|
449
|
+
conversation across calls. **POSIX only** (macOS/Linux) for now. See
|
|
450
|
+
`docs/configuration.md` for the coder env vars and `docs/mcp.md` for the
|
|
451
|
+
MCP tool equivalents.
|
|
452
|
+
|
|
421
453
|
## Integrations
|
|
422
454
|
|
|
423
455
|
External-service plugins live under `src/integrations/<name>/`. They are
|
|
@@ -575,6 +607,33 @@ Real savings depend on which operations you delegate (bulk reads win
|
|
|
575
607
|
the most; tiny lookups break even); see `templates/claude.md` for the
|
|
576
608
|
rules of thumb.
|
|
577
609
|
|
|
610
|
+
## Security & privacy
|
|
611
|
+
|
|
612
|
+
The short version for a vendor security review — full details in
|
|
613
|
+
[SECURITY.md](SECURITY.md):
|
|
614
|
+
|
|
615
|
+
- **Local-first.** Triss is a CLI/MCP server on your machine, not a hosted
|
|
616
|
+
service. It stores nothing server-side and has **no telemetry** — zero
|
|
617
|
+
data goes to the Triss developers.
|
|
618
|
+
- **Two outbound flows, both yours to configure.** Prompts and selected
|
|
619
|
+
context go to the model endpoint you set (`TRISS_WORKER_BASE_URL`,
|
|
620
|
+
DeepSeek by default); tracker commands talk to the Jira/Linear/GitHub/…
|
|
621
|
+
instances you configured. Nothing else leaves the machine.
|
|
622
|
+
- **Data residency is a config option.** Need an EU processor, a DPA, or
|
|
623
|
+
zero retention? Point the worker at Azure OpenAI, Bedrock, Mistral, or a
|
|
624
|
+
self-hosted model — see [provider recipes](#provider-recipes).
|
|
625
|
+
- **Usage log is metadata-only.** `~/.cache/triss/usage.jsonl` records
|
|
626
|
+
tokens and cost, never prompt or file content. `TRISS_USAGE_LOG=0`
|
|
627
|
+
disables it.
|
|
628
|
+
- **Guardrails.** SSRF guard on all agent-controlled fetches, path sandbox
|
|
629
|
+
in MCP mode, response-size caps, secret masking in output. Residual risks
|
|
630
|
+
are documented, not hidden.
|
|
631
|
+
- **Auditable supply chain.** Plain ESM, no build step, seven direct
|
|
632
|
+
dependencies, committed lockfile, `npm audit` kept clean.
|
|
633
|
+
|
|
634
|
+
Report vulnerabilities via GitHub Security Advisories
|
|
635
|
+
([SECURITY.md](SECURITY.md#reporting-vulnerabilities)).
|
|
636
|
+
|
|
578
637
|
## Roadmap
|
|
579
638
|
|
|
580
639
|
**Shipped** — see the Tools table for usage:
|
package/bin/triss.js
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
runEdit,
|
|
39
39
|
runUnset,
|
|
40
40
|
} from '../src/commands/config.js';
|
|
41
|
+
import { runCoderInit, runCoderRun, runCoderClean } from '../src/commands/coder.js';
|
|
41
42
|
import { loadIntegrations } from '../src/integrations/_registry.js';
|
|
42
43
|
import { withCall } from '../src/call-context.js';
|
|
43
44
|
|
|
@@ -220,6 +221,37 @@ config
|
|
|
220
221
|
.option('-l, --local', 'project file')
|
|
221
222
|
.action(wrap(runUnset));
|
|
222
223
|
|
|
224
|
+
const coder = program
|
|
225
|
+
.command('coder')
|
|
226
|
+
.description('Run a GLM coding agent (opencode engine)');
|
|
227
|
+
|
|
228
|
+
coder
|
|
229
|
+
.command('init')
|
|
230
|
+
.description('Install/configure the opencode engine, Z.AI key, permission policy, and agent templates')
|
|
231
|
+
.option('-g, --global', 'save to the global scope (~/.config/triss/.env, ~/.config/opencode/)')
|
|
232
|
+
.option('-l, --local', 'save to the project scope (./.triss.env, ./opencode.json)')
|
|
233
|
+
.action(wrap(runCoderInit));
|
|
234
|
+
|
|
235
|
+
coder
|
|
236
|
+
.command('run [prompt]')
|
|
237
|
+
.description('Spawn a GLM coding agent (opencode engine) and print a JSON envelope to stdout')
|
|
238
|
+
.option('--session <id>', 'triss-side session slug, mapped to a real opencode session id in .triss/sessions.json')
|
|
239
|
+
.option('--continue', 'continue the most recent opencode session (maps to opencode --continue)')
|
|
240
|
+
.option('--agent <name>', 'opencode agent template to use', 'coder')
|
|
241
|
+
.option('--model <p/m>', 'override the model for this run only')
|
|
242
|
+
.option('--isolate', 'run in a disposable git worktree under .triss/wt/<slug>')
|
|
243
|
+
.option('--cwd <path>', 'working directory (ignored with --isolate)')
|
|
244
|
+
.option('--timeout <sec>', 'kill the engine after this many seconds', (v) => parseInt(v, 10), 900)
|
|
245
|
+
.option('--stdin', 'read the prompt from piped stdin instead of the [prompt] argument')
|
|
246
|
+
.option('--json', 'no-op — the envelope is always JSON; kept for symmetry with other commands')
|
|
247
|
+
.action((prompt, opts) => wrap(runCoderRun)(prompt, opts));
|
|
248
|
+
|
|
249
|
+
coder
|
|
250
|
+
.command('clean')
|
|
251
|
+
.description('Remove finished .triss/wt isolation worktrees (branches with no diff vs the default branch)')
|
|
252
|
+
.option('--all', 'force-remove every worktree under .triss/wt, regardless of diff state')
|
|
253
|
+
.action(wrap(runCoderClean));
|
|
254
|
+
|
|
223
255
|
function wrap(fn) {
|
|
224
256
|
return async (...args) => {
|
|
225
257
|
try {
|