@foldspace_npm/harness 0.1.2 → 0.1.3

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,6 +1,7 @@
1
1
  # @foldspace_npm/harness
2
2
 
3
- Build, inject and verify Foldspace agent experiences against a live app.
3
+ Build the portable `dist/index.js` action artifact and verify it against a live
4
+ app.
4
5
 
5
6
  **This package is the part that is the same in both architectures.** Everything
6
7
  else about how a builder runs differs between them; this does not.
@@ -13,7 +14,7 @@ else about how a builder runs differs between them; this does not.
13
14
  |---|---|---|
14
15
  | Who runs the agent | Claude Code on the builder's desktop | Claude Agent SDK in GCP |
15
16
  | Whose browser | an isolated Chrome the harness launches | the user's **own** Chrome |
16
- | How code reaches the page | CDP injection | Web Store extension injects a `<script src>` from the CDN |
17
+ | How code reaches the page | harness CDP preparation | builder extension loads the cloud artifact |
17
18
  | Prerequisites | Claude Code, a client repo, Node, an isolated Chrome profile | the extension installed |
18
19
  | Session and cookies | in a profile the harness creates | the user's own, untouched |
19
20
  | Code and history | a git repo on the builder's machine | a workspace in the hosted environment |
@@ -50,13 +51,36 @@ exact failure this package was created to end. And the verb interface only stays
50
51
  honest while both implementations sit behind it; separate them and "the same
51
52
  action runs in both modes" quietly stops being true.
52
53
 
53
- A hosted container installs this and never calls `inject`. That is kilobytes of
54
- dead weight, against a contract that cannot drift.
54
+ A hosted environment uses the same action source and build contract, but local
55
+ `inject` and `attach` remain CDP-only commands. The harness does not generate a
56
+ customer application extension.
55
57
 
56
58
  ---
57
59
 
58
60
  ## Use
59
61
 
62
+ ### Discover the CLI
63
+
64
+ Human-readable help is grouped by workflow:
65
+
66
+ ```bash
67
+ foldspace help
68
+ foldspace help attach
69
+ ```
70
+
71
+ Coding agents can inspect the same versioned command and capability contract:
72
+
73
+ ```bash
74
+ foldspace help --json
75
+ foldspace help attach --json
76
+ ```
77
+
78
+ The installed `harness` binary is an alias for `foldspace`.
79
+
80
+ The JSON describes current options, prerequisites, side effects, risks,
81
+ capabilities, and next steps. It does not claim that future hosted-environment
82
+ capability enforcement is already implemented.
83
+
60
84
  ### Create a project
61
85
 
62
86
  Create a configured actions project from the template bundled with the installed
@@ -104,6 +128,35 @@ npm run attach
104
128
  The generated npm scripts intentionally remain the normal project interface;
105
129
  `foldspace init` is the one-time project creation command.
106
130
 
131
+ ### Choose an attach mode
132
+
133
+ - **Swap (default):** the page already uses the configured product and agent.
134
+ - **Bootstrap (`--bootstrap`):** the page has no Foldspace SDK.
135
+ - **Replace (`--replace`):** the page embeds a different product or agent, or
136
+ has an SDK without the configured agent.
137
+
138
+ Use `foldspace help attach` for mode requirements, effects, and safety options.
139
+
140
+ ### Verify actions through the agent
141
+
142
+ `foldspace attach` does not invoke action handlers directly. It loads the local
143
+ artifact, verifies that its action names exactly match the configured SDK agent,
144
+ and then observes action callbacks while you exercise the normal agent
145
+ experience.
146
+
147
+ Action output identifies SDK callbacks and local `execute`/`render` phases:
148
+
149
+ ```text
150
+ [actions] sdk:action show_account_360 executed
151
+ [actions] local-handler:execute show_account_360 succeeded 412ms
152
+ [actions] local-handler:render show_account_360 succeeded 18ms
153
+ ```
154
+
155
+ Only action names, parameter keys, statuses, and durations are recorded; handler
156
+ parameter values, results, and error messages are not. On detach, repeated page
157
+ failures and bounded action observations are summarized. The observer and
158
+ diagnostics are injected by the harness, so `dist/index.js` is not rewritten.
159
+
107
160
  ### Add the harness to an existing project
108
161
 
109
162
  ```bash
@@ -120,18 +173,14 @@ npm i -D @foldspace_npm/harness
120
173
  } }
121
174
  ```
122
175
 
123
- | Command | A | B |
124
- |---|:--:|:--:|
125
- | `foldspace init` | ✅ | ✅ |
126
- | `foldspace build` | ✅ | ✅ |
127
- | `foldspace deploy` | ✅ | ✅ — it *is* the delivery mechanism |
128
- | `foldspace inject` | ✅ | — no browser to launch |
129
- | `foldspace attach` | ✅ | replaced by the extension bridge |
130
-
131
176
  Every command resolves the **consuming** repo — `process.cwd()`, or
132
177
  `FOLDSPACE_PROJECT_DIR` so a hosted builder can point it at a workspace it
133
178
  controls. Config comes from the consumer's `foldspace.dev.json`.
134
179
 
180
+ `foldspace deploy` is an explicit remote publication step that reads product
181
+ and agent identity from the selected target in `foldspace.dev.json`. It requires
182
+ local cloud credentials and is separate from local verification.
183
+
135
184
  ---
136
185
 
137
186
  ## Why this package exists at all