@ai-outfitter/outfitter 1.7.0 → 1.8.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.
Files changed (74) hide show
  1. package/code/pi-extension/src/outfitter-extension.js +7 -1
  2. package/code/pi-extension/src/outfitter-runtime-extension.js +8 -17
  3. package/dist/agents/AgentLaunch.d.ts +1 -0
  4. package/dist/agents/AgentLaunch.js +4 -3
  5. package/dist/agents/AgentLaunch.js.map +1 -1
  6. package/dist/cli/TerminalLoading.d.ts +2 -0
  7. package/dist/cli/TerminalLoading.js +28 -0
  8. package/dist/cli/TerminalLoading.js.map +1 -0
  9. package/dist/cli/commands/PiRuntimeLaunch.d.ts +0 -1
  10. package/dist/cli/commands/PiRuntimeLaunch.js +1 -3
  11. package/dist/cli/commands/PiRuntimeLaunch.js.map +1 -1
  12. package/dist/cli/commands/RunAgentCommand.d.ts +6 -0
  13. package/dist/cli/commands/RunAgentCommand.js +60 -21
  14. package/dist/cli/commands/RunAgentCommand.js.map +1 -1
  15. package/dist/cli/commands/SetupCommand.d.ts +4 -0
  16. package/dist/cli/commands/SetupCommand.js +16 -7
  17. package/dist/cli/commands/SetupCommand.js.map +1 -1
  18. package/dist/cli.d.ts +12 -1
  19. package/dist/cli.js +92 -1
  20. package/dist/cli.js.map +1 -1
  21. package/dist/extensions/PiExtensionCache.d.ts +3 -0
  22. package/dist/extensions/PiExtensionCache.js +4 -3
  23. package/dist/extensions/PiExtensionCache.js.map +1 -1
  24. package/dist/paths/OutfitterCache.d.ts +2 -0
  25. package/dist/paths/OutfitterCache.js +8 -0
  26. package/dist/paths/OutfitterCache.js.map +1 -1
  27. package/dist/projection/Materialize.d.ts +2 -0
  28. package/dist/projection/Materialize.js +29 -1
  29. package/dist/projection/Materialize.js.map +1 -1
  30. package/dist/projection/ProjectHarness.js +12 -9
  31. package/dist/projection/ProjectHarness.js.map +1 -1
  32. package/dist/resolver/ResolverContext.d.ts +2 -0
  33. package/dist/resolver/ResolverContext.js +1 -0
  34. package/dist/resolver/ResolverContext.js.map +1 -1
  35. package/dist/schemas/settings.schema.json +11 -0
  36. package/dist/settings/Settings.d.ts +4 -0
  37. package/dist/settings/Settings.js.map +1 -1
  38. package/dist/settings/SettingsLoader.js +4 -1
  39. package/dist/settings/SettingsLoader.js.map +1 -1
  40. package/dist/settings/SettingsMerger.js +3 -0
  41. package/dist/settings/SettingsMerger.js.map +1 -1
  42. package/dist/setup/DefaultCatalog.d.ts +1 -1
  43. package/dist/setup/DefaultCatalog.js +1 -1
  44. package/dist/setup/Setup.d.ts +1 -0
  45. package/dist/setup/Setup.js +16 -5
  46. package/dist/setup/Setup.js.map +1 -1
  47. package/dist/telemetry/CiEnvironment.d.ts +6 -0
  48. package/dist/telemetry/CiEnvironment.js +4 -0
  49. package/dist/telemetry/CiEnvironment.js.map +1 -0
  50. package/dist/telemetry/TelemetryConsent.d.ts +8 -0
  51. package/dist/telemetry/TelemetryConsent.js +39 -0
  52. package/dist/telemetry/TelemetryConsent.js.map +1 -0
  53. package/dist/telemetry/TelemetryConstants.d.ts +4 -0
  54. package/dist/telemetry/TelemetryConstants.js +5 -0
  55. package/dist/telemetry/TelemetryConstants.js.map +1 -0
  56. package/dist/telemetry/TelemetryContext.d.ts +15 -0
  57. package/dist/telemetry/TelemetryContext.js +13 -0
  58. package/dist/telemetry/TelemetryContext.js.map +1 -0
  59. package/dist/telemetry/TelemetryService.d.ts +57 -0
  60. package/dist/telemetry/TelemetryService.js +157 -0
  61. package/dist/telemetry/TelemetryService.js.map +1 -0
  62. package/dist/telemetry/TelemetryState.d.ts +11 -0
  63. package/dist/telemetry/TelemetryState.js +51 -0
  64. package/dist/telemetry/TelemetryState.js.map +1 -0
  65. package/dist/version/OutfitterVersion.js +6 -3
  66. package/dist/version/OutfitterVersion.js.map +1 -1
  67. package/docs/documentation/README.md +4 -1
  68. package/docs/documentation/channels.md +112 -0
  69. package/docs/documentation/cli.md +13 -0
  70. package/docs/documentation/settings.md +5 -0
  71. package/docs/documentation/support-matrix.md +3 -2
  72. package/docs/documentation/telemetry.md +70 -0
  73. package/package.json +5 -3
  74. package/src/schemas/settings.schema.json +11 -0
@@ -0,0 +1,112 @@
1
+ # Channels
2
+
3
+ A **channel** is an external source of work an agent watches — a mailbox, Signal,
4
+ GitHub notifications, or a chat service. The
5
+ [`ai-outfitter/channels`](https://github.com/ai-outfitter/channels) Pi extension
6
+ owns those transports as source modules under `extensions/sources/`. A source
7
+ opens its push connection, daemon, or polling loop and sends an **idle-gated
8
+ wake** only when it detects matching work. Multiple sources can run at once and
9
+ feed one notification queue.
10
+
11
+ Every wake is a trusted, body-free signal. Sources that support exact-item
12
+ actions put only an opaque locator in the wake; the agent passes that locator
13
+ unchanged to `channel_read`, which returns the message inside explicit
14
+ untrusted-content markers. It replies through `channel_respond`. Signal-only
15
+ sources instead wake the agent to use that channel's existing client workflow.
16
+ In neither case does an external message enter the session as an instruction.
17
+
18
+ The extension and the response instructions have separate jobs:
19
+
20
+ - `git:github.com/ai-outfitter/channels` supplies event delivery and the common
21
+ channel tools;
22
+ - skills and runbooks in the Channels repository teach the agent how to handle
23
+ each source.
24
+
25
+ Those channel skills are not published by the `community-profiles` catalog. For
26
+ example, Channels currently carries its Slack workflow at
27
+ [`dev/slack-responder/SKILL.md`](https://github.com/ai-outfitter/channels/blob/main/dev/slack-responder/SKILL.md)
28
+ and its operational guides under
29
+ [`docs/runbooks/`](https://github.com/ai-outfitter/channels/tree/main/docs/runbooks).
30
+
31
+ ## Add channels to an agent
32
+
33
+ Add the Channels extension source to the agent's [loadout](./agents.md):
34
+
35
+ ```markdown
36
+ ---
37
+ name: email-assistant
38
+ extensions: [git:github.com/ai-outfitter/channels]
39
+ model: your-model
40
+ ---
41
+ ```
42
+
43
+ Then follow the source-specific skill or runbook in the Channels repository and
44
+ provide that source's credentials. Do not add `mail`, `signal-responder`, or
45
+ `slack-responder` on the assumption that they are community-catalog skill IDs.
46
+ If you want to use the repository's development Slack skill, bring that skill
47
+ into a catalog you control and select its resulting local ID.
48
+
49
+ Because an [agent _is_ the profile](./profiles.md), a multi-channel agent still
50
+ loads the extension only once:
51
+
52
+ ```markdown
53
+ ---
54
+ name: personal-assistant
55
+ extensions: [git:github.com/ai-outfitter/channels]
56
+ ---
57
+ ```
58
+
59
+ All configured sources feed a single notification queue. Each wake names the
60
+ sources with activity and, when available, includes opaque locators for the
61
+ agent to pass to the common channel tools.
62
+
63
+ ## Select which channels run
64
+
65
+ `OUTFITTER_CHANNELS` chooses the active channels; unset means **auto-detect** —
66
+ every channel whose credentials are present starts. So composing a channel into an
67
+ agent is really just supplying its credentials.
68
+
69
+ | `OUTFITTER_CHANNELS` | Behavior |
70
+ | -------------------- | -------------------------- |
71
+ | unset | Auto-detect by credentials |
72
+ | `jmap,signal` | Exactly those channels |
73
+ | `off` / `none` | Disabled |
74
+
75
+ ## Credentials per channel
76
+
77
+ Each source reads its configuration from environment variables. Supply them the
78
+ Outfitter way for where the agent runs:
79
+
80
+ - **Local runs** — export them in the shell before `outfitter run` (see the
81
+ [channels README](https://github.com/ai-outfitter/channels) for the bare-pi
82
+ flow).
83
+ - **In-cluster** — project them as env from Secrets via the Kubernetes operator;
84
+ the operator exposes referenced Secrets without inspecting them, and the keys
85
+ inside are each channel's contract.
86
+
87
+ | Source | Delivery | Variables |
88
+ | ------------------------ | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
89
+ | `jmap` (email over JMAP) | JMAP state-change wake | `XIN_BASE_URL`, `XIN_BASIC_USER`, `XIN_BASIC_PASS` |
90
+ | `signal` | `signal-cli` wake | `SIGNAL_NUMBER`, `SIGNAL_CLI_CONFIG` |
91
+ | `slack` | Socket Mode wake plus `channel_read` / `channel_respond` | `SLACK_APP_TOKEN`, `SLACK_BOT_TOKEN`, optional `SLACK_CHANNEL_IDS` |
92
+ | `github` | filtered notification wake | `GITHUB_NOTIFY_TOKEN` (or `GITHUB_TOKEN`), optional `GITHUB_NOTIFY_FILTERS`, `GITHUB_NOTIFY_POLL_MS` |
93
+
94
+ This is only a quick orientation; the Channels README is the source of truth for
95
+ the complete source list, credentials, prerequisites, and behavior. For a
96
+ concrete email deployment, see its
97
+ [Google Workspace agent-mailbox runbook](https://github.com/ai-outfitter/channels/blob/main/docs/runbooks/agent-mailbox-google-workspace.md).
98
+
99
+ ## Running resident
100
+
101
+ A channel watcher opens push connections for the life of a session, so it needs a
102
+ long-running agent — an interactive session, `--mode rpc`, or an always-on
103
+ in-cluster deployment. Session switches reopen the connections; one-shot print runs
104
+ are not suitable.
105
+
106
+ ## See also
107
+
108
+ - [`ai-outfitter/channels`](https://github.com/ai-outfitter/channels) — the
109
+ extension source, channel source modules, skills, runbooks, and setup.
110
+ - [Skills](./skills.md) — how to bring a repository-owned channel skill into a
111
+ catalog and select it in a loadout.
112
+ - [Agents](./agents.md) / [Profiles](./profiles.md) — loadout and composition.
@@ -7,6 +7,8 @@ Global options:
7
7
  | `-V, --version` | Print the Outfitter version. |
8
8
  | `-h, --help` | Show help for a command. |
9
9
 
10
+ See [Telemetry](./telemetry.md) for the pseudonymous analytics event contract and opt-out controls.
11
+
10
12
  ## `outfitter run [agent] [args...]`
11
13
 
12
14
  Resolve, compose, and launch an agent. `run` is the default command, so plain `outfitter` and `outfitter run` are equivalent.
@@ -15,8 +17,12 @@ Resolve, compose, and launch an agent. `run` is the default command, so plain `o
15
17
  | --------------------- | -------------------------------------------------------------------------------- |
16
18
  | `[agent]` | Agent slug to run. Defaults to the settings `default_agent`. |
17
19
  | `--harness <harness>` | Harness to launch in: `pi`, `claude`, or `codex`. Defaults to `default_harness`. |
20
+ | `--log-level <level>` | Use `info` for quiet loading or `debug` for installer output. |
18
21
  | `--strict` | Fail instead of warning when the adapter cannot project part of the composition. |
19
22
 
23
+ Set `OUTFITTER_LOG_LEVEL=debug` to enable debug startup output without passing the option. The
24
+ `setup` command also accepts `--log-level` for its automatic profile launch.
25
+
20
26
  Any other arguments and unrecognized options are passed through to the launched harness:
21
27
 
22
28
  ```bash
@@ -25,6 +31,13 @@ outfitter run engineer --harness codex -- exec "review this repo"
25
31
  outfitter run persona-reviewer -- --print "summarize this repo"
26
32
  ```
27
33
 
34
+ Because `run` is the default command, leading flags that Outfitter does not own are forwarded to the harness automatically. With a configured `default_agent`, the following forms pass flags directly to Pi:
35
+
36
+ ```bash
37
+ outfitter -r # equivalent to: outfitter run -- -r
38
+ outfitter --resume # equivalent to: outfitter run -- --resume
39
+ ```
40
+
28
41
  ## `outfitter setup [source]`
29
42
 
30
43
  Open the bundled Pi walkthrough using the original setup wording and sequence. Choose **Use the
@@ -40,6 +40,10 @@ remote_settings:
40
40
  ref: 9c47d1e2b8a05f36c4d7e90a12b3f8c5d6e71a04
41
41
 
42
42
  cache_directory: ./cache # optional; relative to this settings file
43
+
44
+ # Pseudonymous product analytics consent; defaults to true when absent.
45
+ telemetry:
46
+ enabled: false
43
47
  ```
44
48
 
45
49
  - `default_agent` / `default_harness` — which agent plain `outfitter` runs, and the harness it launches in.
@@ -48,6 +52,7 @@ cache_directory: ./cache # optional; relative to this settings file
48
52
  - `cache_directory` — the repository cache root used consistently by sync, remote settings, remote
49
53
  source resolution, and default-catalog setup. It defaults to `~/.agents/cache`; repositories live
50
54
  below its `repos/` directory.
55
+ - `telemetry.enabled` — the primary and sole persistent control for pseudonymous product analytics. Edit it directly to enable or disable telemetry. See [Telemetry](./telemetry.md) for consent precedence, automatic identifier cleanup, the event contract, and the current inert-build status.
51
56
 
52
57
  ## Precedence
53
58
 
@@ -23,7 +23,7 @@ Tasks and bake are not in this matrix — they are the subject of a [separate up
23
23
  | Knowledge (`knowledge/`) | Supported | Partial | Roadmap |
24
24
  | Model selection (`models.json`) | Supported | Partial | Partial |
25
25
  | MCP servers (`mcp.json`) | Supported | Supported | Partial |
26
- | Extensions (agent `extensions:` loadout) | Supported | Roadmap | Roadmap |
26
+ | Extensions (agent `extensions:` loadout) | Supported | Pi only | Pi only |
27
27
  | Plugins (agent `plugins:` loadout) | Supported | Roadmap | Roadmap |
28
28
  | Credentials and environment | Supported | Supported | Roadmap |
29
29
  | DeepWork job selection | Supported | Roadmap | Roadmap |
@@ -38,7 +38,8 @@ Tasks and bake are not in this matrix — they are the subject of a [separate up
38
38
 
39
39
  - **Launch mode** — Outfitter launches `codex` directly. Pass-through arguments choose the native mode: no subcommand keeps the interactive CLI shape, while `-- exec ...` selects non-interactive `codex exec`.
40
40
  - **Agent identity and appended prompts** — Codex has no native identity projection yet: launches drop the composed identity/system prompt and any `--append-prompt` documents, supplied documents produce a separate warning, and `--strict` aborts before execution.
41
- - **Model selection (Partial)** — an agent's model maps to `-m`. Provider maps have no projection element and produce no warning. Thinking, tools, skills, subagents, extensions, plugins, and prompt templates remain unsupported and warn when selected.
41
+ - **Model selection (Partial)** — an agent's model maps to `-m`. Provider maps have no projection element and produce no warning. Thinking, tools, skills, subagents, plugins, and prompt templates remain unsupported and warn when selected.
42
+ - **Extensions (Pi only)** — `extensions:` names pi extension packages, so a Codex or Claude Code launch installs none of them. This is a property of the element, not a gap a user can close, so it produces no warning and does not fail under `--strict`.
42
43
  - **MCP servers (Partial)** — selected stdio fields (`command`, `args`, `env`, `cwd`) and streamable HTTP fields (`url`, `headers`) become repeated TOML-valued `-c mcp_servers.<id>.<key>=...` overrides. Server ids must contain only letters, digits, `_`, or `-`; other ids cannot be expressed by Codex `-c` key paths and are skipped with a warning. Legacy SSE and other HTTP transport types are also skipped with a warning. User and project `config.toml` servers remain active because Codex has no strict MCP isolation mode, so every launch warns that projection is additive, even when no servers are selected.
43
44
  - **Stdio environment safety** — `${ENV_NAME}` becomes an `env_vars` reference only when the stdio `env` key is also `ENV_NAME`; a reference that would rename the variable is dropped with a warning. Literal values pass through `env` and are visible in process arguments.
44
45
  - **HTTP header safety** — `${ENV_NAME}` becomes an `env_http_headers` reference, while `Authorization: Bearer ${ENV_NAME}` becomes `bearer_token_env_var`. Other header values pass through `http_headers` and are visible in process arguments. Outfitter warns for every literal stdio environment or HTTP header entry exposed in argv, so use environment references for secrets.
@@ -0,0 +1,70 @@
1
+ # Telemetry
2
+
3
+ Outfitter includes opt-outable pseudonymous product analytics to measure command adoption and reliability. The shipped PostHog API key is currently empty, so no build produced from this repository sends telemetry. Provisioning a key is deferred maintainer work. The consent setting still defaults to enabled and can be changed at any time.
4
+
5
+ In a future build with a provisioned key, the first command that would send an event prints a one-time notice to stderr. The notice explains what is collected, what is excluded, and how to opt out. With the current empty key, telemetry is inert: it creates no client or state, sends no events, and prints no notice.
6
+
7
+ ## Event contract
8
+
9
+ Outfitter sends exactly two event types: `cli command started` and `cli command completed`.
10
+
11
+ Both events contain only these properties:
12
+
13
+ | Property | Values |
14
+ | ------------------------- | --------------------------------------------------------------------------------------------------------------------- |
15
+ | `command` | A registered top-level command (`run`, `setup`, `sync`, `list`, `validate`, or `dump`), or `unknown`. |
16
+ | `outfitter_version` | The installed Outfitter version. |
17
+ | `node_major` | The integer Node.js major version. |
18
+ | `os_family` | `aix`, `android`, `darwin`, `freebsd`, `linux`, `openbsd`, `sunos`, `win32`, or `unknown`. |
19
+ | `arch` | `arm`, `arm64`, `ia32`, `loong64`, `mips`, `mipsel`, `ppc`, `ppc64`, `riscv64`, `s390`, `s390x`, `x64`, or `unknown`. |
20
+ | `interactive` | `true` or `false`. |
21
+ | `harness` | `pi`, `claude`, `codex`, or `unknown`. |
22
+ | `strict` | `true` or `false`. |
23
+ | `is_ci` | `true` when a CI environment is detected; otherwise `false`. |
24
+ | `ci_name` | Lowercased `ci-info` vendor ID, `unknown` for unidentified CI, or `none` outside CI. |
25
+ | `$process_person_profile` | Always `false`; PostHog does not create or update a person profile. |
26
+
27
+ The completed event also contains:
28
+
29
+ | Property | Values |
30
+ | ---------------------- | ---------------------------------- |
31
+ | `outcome` | `success` or `error`. |
32
+ | `duration_bucket` | `<1s`, `1-5s`, `5-30s`, or `30s+`. |
33
+ | `exit_code_class` | `success` or `error`. |
34
+ | `warning_count_bucket` | `0`, `1-5`, `5+`, or `unknown`. |
35
+
36
+ The CLI boundary does not currently have a warning counter, so `warning_count_bucket` is always `unknown`. GeoIP enrichment is disabled on the PostHog client.
37
+
38
+ ## Data never collected
39
+
40
+ Beyond the low-cardinality `harness` and `strict` values listed above, Outfitter never sends command arguments, pass-through arguments, prompts or responses, paths, repository data, agent or profile names, settings, raw environment values, error text, stack traces, session identifiers, child-process output, hostnames, usernames, or hardware identifiers.
41
+
42
+ Outside CI, the pseudonymous installation identifier is a random UUID. It is created lazily on the first capture and stored with the one-time-notice flag at `$XDG_STATE_HOME/outfitter/telemetry.json`, or `~/.local/state/outfitter/telemetry.json` when `XDG_STATE_HOME` is unset or blank. It is deliberately kept outside `~/.agents` so it cannot be committed with shared configuration.
43
+
44
+ In CI, telemetry remains enabled according to the same consent rules and events are sent with `is_ci: true` and the detected `ci_name`. All runs from one CI vendor share a synthetic identifier such as `ci.github_actions`; unidentified CI uses `ci.unknown`. CI runs do not read or create `telemetry.json` and do not print the first-run notice. Set `CI=false` exactly to bypass CI detection and use the normal non-CI UUID identity and state behavior.
45
+
46
+ ## Where the data goes
47
+
48
+ When a maintainer provisions a PostHog key, events go to PostHog Cloud US at `https://us.i.posthog.com`. No retention period is stated here because this repository does not currently configure one.
49
+
50
+ ## Control telemetry
51
+
52
+ The source-of-truth setting is `telemetry.enabled` in `~/.agents/settings.yml`:
53
+
54
+ ```yaml
55
+ telemetry:
56
+ enabled: false
57
+ ```
58
+
59
+ Telemetry defaults to enabled when the setting is absent. Only user and user-local settings can enable it. A `false` value in user, user-local, project, or project-local settings disables it; remote or catalog settings cannot enable telemetry.
60
+
61
+ If an applicable settings file cannot be parsed or validated, telemetry fails closed and a non-CI invocation removes any stored installation identifier.
62
+
63
+ This settings entry is the sole persistent telemetry control. Edit the file directly to toggle it; Outfitter does not expose a telemetry command. When consent is disabled by this setting, invalid settings, or a process environment opt-out, Outfitter automatically deletes any stored pseudonymous installation identifier. If no identifier exists, cleanup remains inert and creates nothing.
64
+
65
+ These environment variables disable capture for the current process:
66
+
67
+ - `OUTFITTER_TELEMETRY=0`
68
+ - `DO_NOT_TRACK=1`
69
+
70
+ At exit, Outfitter gives queued analytics at most 1000 ms to shut down. Analytics failures or dropped networks never change command output, behavior, or exit status. They never delay exit beyond that budget.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-outfitter/outfitter",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Profile-oriented wrapper for launching pi, Claude Code, and future agent CLIs with reproducible configuration.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -36,15 +36,17 @@
36
36
  "test": "vitest --run",
37
37
  "coverage": "vitest --run --coverage",
38
38
  "check": "npm run lint:fix && npm run coverage",
39
- "check-ci": "prettier --check . && npm run lint && npm run coverage"
39
+ "check-ci": "prettier --check . --ignore-path ../../.prettierignore && npm run lint && npm run coverage"
40
40
  },
41
41
  "dependencies": {
42
42
  "@earendil-works/pi-coding-agent": "^0.80.3",
43
43
  "ajv": "^8.20.0",
44
44
  "chalk": "^5.6.2",
45
+ "ci-info": "^4.4.0",
45
46
  "commander": "^14.0.3",
46
47
  "cross-spawn": "^7.0.6",
47
48
  "liquidjs": "^10.27.0",
49
+ "posthog-node": "^5.49.1",
48
50
  "yaml": "^2.9.0"
49
51
  },
50
52
  "devDependencies": {
@@ -60,7 +62,7 @@
60
62
  "vitest": "^4.1.7"
61
63
  },
62
64
  "engines": {
63
- "node": ">=24.18.0 <25"
65
+ "node": ">=22.19.0"
64
66
  },
65
67
  "keywords": [
66
68
  "agent",
@@ -34,6 +34,17 @@
34
34
  },
35
35
  "additionalProperties": false
36
36
  },
37
+ "telemetry": {
38
+ "type": "object",
39
+ "description": "Controls pseudonymous Outfitter product analytics.",
40
+ "properties": {
41
+ "enabled": {
42
+ "type": "boolean",
43
+ "description": "Enable or disable pseudonymous Outfitter product analytics. Defaults to enabled."
44
+ }
45
+ },
46
+ "additionalProperties": false
47
+ },
37
48
  "sources": {
38
49
  "type": "array",
39
50
  "items": {