@agentworkforce/cli 0.9.0 → 0.11.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 CHANGED
@@ -9,11 +9,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
+ - `agentworkforce agent` now records launch metadata for direct harness
13
+ launches; opt out with `--no-launch-metadata` or
14
+ `AGENTWORKFORCE_LAUNCH_METADATA=0`.
12
15
  - `agentworkforce create` now opens `persona-maker@best`, supports `--to` and
13
16
  `--save-default`, and passes `TARGET_DIR` / `CREATE_MODE` persona inputs.
14
17
  - Persona source config supports `defaultCreateTarget` for the implicit create target.
15
18
  - `--version`/`-v` now prints the CLI package version.
16
19
 
20
+ ## [0.11.0] - 2026-05-08
21
+
22
+ ### Released
23
+
24
+ - v0.11.0
25
+
26
+ ## [0.10.0] - 2026-05-08
27
+
28
+ ### Released
29
+
30
+ - v0.10.0
31
+
17
32
  ## [0.8.0] - 2026-05-07
18
33
 
19
34
  ### Added
package/README.md CHANGED
@@ -6,8 +6,8 @@ built-in one from `/personas/`, or an installed/local one that extends a lower
6
6
  source.
7
7
 
8
8
  ```
9
- agentworkforce create [--to <target>] [--save-default]
10
- agentworkforce agent <persona>[@<tier>]
9
+ agentworkforce create [--to <target>] [--save-default] [--install-in-repo] [--no-launch-metadata]
10
+ agentworkforce agent [--install-in-repo] [--no-launch-metadata] <persona>[@<tier>]
11
11
  agentworkforce list [flags]
12
12
  agentworkforce show <persona>[@<tier>]
13
13
  agentworkforce install [flags] <pkg|path>
@@ -68,7 +68,7 @@ Unknown persona prints the full catalog with each entry's origin.
68
68
  ## Create
69
69
 
70
70
  ```
71
- agentworkforce create [--to <target>] [--save-default] [--install-in-repo]
71
+ agentworkforce create [--to <target>] [--save-default] [--install-in-repo] [--no-launch-metadata]
72
72
  ```
73
73
 
74
74
  `create` is the persona-authoring entry point. It runs `persona-maker@best`
@@ -515,6 +515,10 @@ library has no `extends`.
515
515
  },
516
516
  "env": { … }, // union, local wins per key
517
517
  "mcpServers": { … }, // union by server name, local wins per key
518
+ "mount": { // Relayfile file scope; pattern arrays append
519
+ "ignoredPatterns": ["…"],
520
+ "readonlyPatterns": ["…"]
521
+ },
518
522
  "permissions": { // allow/deny union (dedup), mode replaces
519
523
  "allow": ["…"], "deny": ["…"], "mode": "default"
520
524
  },
@@ -617,6 +621,9 @@ Use this when you are not extending an existing persona:
617
621
  "deny": ["Bash(npm publish *)"],
618
622
  "mode": "default"
619
623
  },
624
+ "mount": {
625
+ "readonlyPatterns": ["*"]
626
+ },
620
627
  "tiers": {
621
628
  "best": {
622
629
  "harness": "codex",
@@ -729,12 +736,39 @@ either a literal string or an env reference. Two forms:
729
736
  Secrets therefore stay in your shell/keychain, not in files on disk — local
730
737
  persona JSON remains commit-safe as long as you only use references.
731
738
 
739
+ ## Relayfile mount rules
740
+
741
+ Interactive `claude` and `opencode` sessions run inside a Relayfile mount by
742
+ default. File visibility and writability are controlled by the persona's
743
+ `mount` block plus project-level dotfiles:
744
+
745
+ ```jsonc
746
+ {
747
+ "mount": {
748
+ "ignoredPatterns": ["secrets/**", ".env*"],
749
+ "readonlyPatterns": [
750
+ "*",
751
+ "!docs/",
752
+ "!docs/**"
753
+ ]
754
+ }
755
+ }
756
+ ```
757
+
758
+ - `ignoredPatterns` are omitted from the mount entirely.
759
+ - `readonlyPatterns` are copied into the mount but edits do not sync back.
760
+ - Patterns use gitignore semantics, so later `!` negations can reopen paths.
761
+ - Persona patterns append to inherited persona patterns. At launch, the CLI
762
+ also merges project-root `.agentignore`, `.agentreadonly`,
763
+ `.<personaId>.agentignore`, and `.<personaId>.agentreadonly`.
764
+
732
765
  ## Permissions
733
766
 
734
767
  A persona can declare which tool calls the harness should auto-approve, block,
735
768
  or gate via a permission mode. Skip the approval prompts for trusted tools
736
769
  (e.g. a persona's own MCP server); keep them on for anything you want to
737
- eyeball.
770
+ eyeball. File visibility and writability are not defined here; use Relayfile
771
+ mount rules (`.agentignore` / `.agentreadonly`) for that.
738
772
 
739
773
  ```jsonc
740
774
  {
@@ -747,9 +781,8 @@ eyeball.
747
781
  ```
748
782
 
749
783
  - **Tool patterns** are passed through verbatim; use the harness's native
750
- grammar. For Claude Code: `Bash(<pattern>)`, `Edit(<glob>)`,
751
- `mcp__<server>` (all tools from that server), `mcp__<server>__<tool>`
752
- (specific tool).
784
+ grammar. For Claude Code: `Bash(<pattern>)`, `mcp__<server>` (all tools
785
+ from that server), `mcp__<server>__<tool>` (specific tool).
753
786
  - **Harness support today:** only `claude` is wired (flags: `--allowedTools`,
754
787
  `--disallowedTools`, `--permission-mode`). codex and opencode emit a
755
788
  warning and fall back to their defaults when `permissions` is set.
@@ -827,7 +860,7 @@ persona session, add it to the persona's `mcpServers` block.
827
860
  ## Interactive
828
861
 
829
862
  ```sh
830
- agentworkforce agent [--install-in-repo] <persona>[@<tier>]
863
+ agentworkforce agent [--install-in-repo] [--no-launch-metadata] <persona>[@<tier>]
831
864
  ```
832
865
 
833
866
  By default, claude and opencode sessions run inside a sandbox mount — see
@@ -854,10 +887,34 @@ By default, claude and opencode sessions run inside a sandbox mount — see
854
887
  initial argument.
855
888
  5. Runs the skill cleanup command on exit, regardless of exit status. In
856
889
  stage-dir mode this is a single `rm -rf <stage-dir>`.
857
- 6. Propagates the harness's exit code.
890
+ 6. Records launch metadata for the session and refreshes harness session logs
891
+ while the child runs, then once more after exit. The harness is still
892
+ launched directly.
893
+ 7. Propagates the harness's exit code.
858
894
 
859
895
  Signals (SIGINT, SIGTERM) are forwarded to the child.
860
896
 
897
+ ### Launch Metadata
898
+
899
+ Persona launches record metadata by default when the installed backend supports
900
+ launcher metadata. AgentWorkforce records:
901
+ `agentworkforce=1`, `persona=<id>`, `personaTier=<tier>`,
902
+ `personaVersion=<sha256>`, and `personaSource=<cwd|user|dir:n|library>`.
903
+ `personaVersion` is the SHA-256 of the fully resolved persona spec after
904
+ cascade/extends merge and before prompt input substitution.
905
+
906
+ Opt out for one launch:
907
+
908
+ ```sh
909
+ agentworkforce agent --no-launch-metadata code-reviewer@best
910
+ ```
911
+
912
+ Opt out through the environment:
913
+
914
+ ```sh
915
+ AGENTWORKFORCE_LAUNCH_METADATA=0 agentworkforce agent code-reviewer@best
916
+ ```
917
+
861
918
  ## Skill staging
862
919
 
863
920
  By default, interactive `claude` sessions stage skills under the user's home
@@ -922,13 +979,23 @@ stage dir conflicts with something else (network filesystem, read-only
922
979
 
923
980
  By default, claude and opencode interactive sessions run inside a
924
981
  [`@relayfile/local-mount`](https://www.npmjs.com/package/@relayfile/local-mount)
925
- symlink mount that hides repo-level harness configuration from the session
926
- and routes skill-install writes into the sandbox so the model sees
927
- persona context + user-level context, and nothing the repo itself declares.
928
- Codex sessions never mount (no harness-side support).
982
+ mount that hides repo-level harness configuration from the session, applies
983
+ the persona `mount` block plus Relayfile `.agentignore` / `.agentreadonly`
984
+ rules, and routes skill-install writes into the sandbox — so the model sees
985
+ persona context + user-level context, and only the project files the mount
986
+ exposes. Codex sessions never mount (no harness-side support).
929
987
 
930
988
  `--install-in-repo` opts out and runs against the real cwd.
931
989
 
990
+ The CLI reads these files from the project root before creating the mount:
991
+
992
+ | File | Effect |
993
+ | --- | --- |
994
+ | `.agentignore` | Hide matching files for every persona. |
995
+ | `.agentreadonly` | Copy matching files into the mount as read-only and skip syncing their edits back. |
996
+ | `.<personaId>.agentignore` | Hide matching files only for that persona. |
997
+ | `.<personaId>.agentreadonly` | Make matching files read-only only for that persona. |
998
+
932
999
  **What's hidden (gitignore semantics, at any depth):**
933
1000
 
934
1001
  For claude:
package/dist/cli.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { type Harness } from '@agentworkforce/workload-router';
2
+ import { type Harness, type PersonaMount, type PersonaSelection, type SidecarMdMode } from '@agentworkforce/workload-router';
3
3
  export declare const CLI_VERSION: string;
4
4
  export declare const CREATE_SELECTOR = "persona-maker@best";
5
5
  /**
@@ -40,7 +40,7 @@ export declare function assertSafeRelativePath(relPath: string): void;
40
40
  * Applied by `@relayfile/local-mount` with gitignore semantics, so bare names
41
41
  * match at any depth in the project tree (e.g. `.claude` hides both
42
42
  * `./.claude/` and `./packages/foo/.claude/`). */
43
- export declare const CLEAN_IGNORED_PATTERNS: readonly ["CLAUDE.md", "CLAUDE.local.md", ".claude", ".mcp.json"];
43
+ export declare const CLEAN_IGNORED_PATTERNS: readonly ["CLAUDE.md", "CLAUDE.local.md", ".claude", ".mcp.json", "AGENTS.md"];
44
44
  /**
45
45
  * Skill-install artifacts that should never be copied into the mount nor
46
46
  * synced back to the real repo. Applied to non-claude interactive sessions
@@ -51,7 +51,18 @@ export declare const CLEAN_IGNORED_PATTERNS: readonly ["CLAUDE.md", "CLAUDE.loca
51
51
  * Claude sessions use `installRoot` for out-of-repo staging instead, so
52
52
  * these patterns don't apply there.
53
53
  */
54
- export declare const SKILL_INSTALL_IGNORED_PATTERNS: readonly [".agents", ".claude/skills", ".factory/skills", ".kiro/skills", "skills", ".opencode", ".skills", "prpm.lock", "skills-lock.json"];
54
+ export declare const SKILL_INSTALL_IGNORED_PATTERNS: readonly [".agents", ".claude/skills", ".factory/skills", ".kiro/skills", "skills", ".opencode", ".skills", "prpm.lock", "skills-lock.json", "AGENTS.md"];
55
+ export interface RelayfileMountPatterns {
56
+ ignoredPatterns: string[];
57
+ readonlyPatterns: string[];
58
+ }
59
+ export declare function buildRelayfileMountPatterns(input: {
60
+ projectDir: string;
61
+ personaId: string;
62
+ harness: Harness;
63
+ mount?: PersonaMount;
64
+ configFilePaths?: readonly string[];
65
+ }): RelayfileMountPatterns;
55
66
  /**
56
67
  * Build the block appended to `<mount>/.git/info/exclude` so untracked-and-
57
68
  * hidden files (e.g. `.claude/skills/` materialized by skill installs, or
@@ -78,6 +89,37 @@ export declare function buildMountGitExcludeBlock(patterns: readonly string[]):
78
89
  * writes here are sandboxed and never leak to the user's main checkout.
79
90
  */
80
91
  export declare function configureGitForMount(mountDir: string, patterns: readonly string[]): void;
92
+ /**
93
+ * Persona-supplied sidecar markdown materialized into a sandbox mount.
94
+ * Pure data carrier — `runInteractive` translates it into the on-disk
95
+ * write inside `onBeforeLaunch` (mount path) and warns/skips when the
96
+ * harness has no mount (codex / `--install-in-repo`).
97
+ */
98
+ export interface ResolvedSidecar {
99
+ /** Filename inside the mount: `CLAUDE.md` (claude) or `AGENTS.md` (opencode). */
100
+ mountFile: 'CLAUDE.md' | 'AGENTS.md';
101
+ /** Persona-author content. Already inlined for built-ins; read from disk for local. */
102
+ personaContent: string;
103
+ mode: SidecarMdMode;
104
+ }
105
+ /**
106
+ * Resolve the sidecar for a given selection + harness, returning the
107
+ * persona-author content the runtime should materialize into the mount.
108
+ * Returns `{}` when no sidecar applies (no path/content set, or harness
109
+ * doesn't support sidecar files at all). Read errors surface as a warning
110
+ * string so the caller can drop the sidecar gracefully rather than
111
+ * failing the whole session.
112
+ */
113
+ export declare function loadSidecarForSelection(selection: PersonaSelection): {
114
+ sidecar?: ResolvedSidecar;
115
+ warning?: string;
116
+ };
117
+ /**
118
+ * Compute the bytes to write into the mount for a sidecar. In `extend`
119
+ * mode, prepends the user's real-cwd file (if any) joined to the persona
120
+ * content with `\n\n---\n\n`. Pure — exposed for unit tests.
121
+ */
122
+ export declare function buildSidecarBody(sidecar: ResolvedSidecar, realCwdDir: string): string;
81
123
  /**
82
124
  * Decide whether to run the interactive session inside a
83
125
  * `@relayfile/local-mount` sandbox.
@@ -101,6 +143,7 @@ export declare function parseInstallArgs(args: readonly string[]): PersonaInstal
101
143
  export declare function main(): Promise<void>;
102
144
  export interface AgentFlags {
103
145
  installInRepo: boolean;
146
+ noLaunchMetadata: boolean;
104
147
  }
105
148
  export interface CreateFlags extends AgentFlags {
106
149
  to?: string;
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAgBA,OAAO,E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