@nextclaw/x-harness 0.2.0 → 0.2.2

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
@@ -53,4 +53,4 @@ npm run check
53
53
 
54
54
  Bootstrap installs the shared Qingtian AI development system and enables the staged Git hook. Its managed local files are excluded from Git and npm. Business owners use TypeScript classes with explicit constructor dependencies, private instance state and named methods. Pure functions and self-contained browser programs remain serializable. The file limit is 1000 lines; each hand-written source function has at most 150 own logic lines; runtime dependency cycles are rejected. Check/build/prepack/release and the staged hook reuse these rules.
55
55
 
56
- The private parent content repository mounts this repository at packages/x-harness as a pinned Git submodule. Account ledgers, browser evidence, publishing contracts and content-specific context adapters remain in the parent. They are not dependencies of this project.
56
+ The private parent content repository consumes the published npm package. These are two independent Git repositories; the parent development workflow can maintain this checkout directly. Account ledgers, browser evidence, publishing contracts and content-specific context adapters remain in the parent. They are not dependencies of this project.
package/SOURCE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Corresponding source
2
2
 
3
- Version 0.2.0, commit 269a29c44c871bac51265653a4e559ffacbf2d84.
3
+ Version 0.2.2, commit 2aaac6a777b93bca44fce2ccaa5baae01113ee13.
4
4
 
5
- Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/269a29c44c871bac51265653a4e559ffacbf2d84
5
+ Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/2aaac6a777b93bca44fce2ccaa5baae01113ee13
6
6
 
7
7
  Clone this revision, run npm ci, npm run bootstrap and npm run release:build.
8
8
 
@@ -83,7 +83,7 @@ export class GrowthPolicy {
83
83
  hour: "2-digit",
84
84
  hourCycle: "h23",
85
85
  }).format(now));
86
- if (hour < 7 || hour >= 22)
86
+ if ((hour < 7 || hour >= 22) && !this.authorizedWindow(state, "follow"))
87
87
  return {
88
88
  status: "needsDecision",
89
89
  reason: "outside-contract-write-window",
@@ -58,6 +58,7 @@ export class PlatformWriting {
58
58
  async handleFindSubmission(action) {
59
59
  if (action.kind === "follow") {
60
60
  let value = await this.#followStage(action, "verify-read", () => this.#readPerson(action));
61
+ const verificationAlerts = [...(value.alerts ?? [])];
61
62
  if (!value.needsStateCheck) {
62
63
  const absent = this.#browser.capabilities?.("refreshPerson") ?? [
63
64
  "refreshPerson",
@@ -77,6 +78,10 @@ export class PlatformWriting {
77
78
  }));
78
79
  value = await this.#followStage(action, "verify-after-refresh", () => this.#readPerson(action));
79
80
  }
81
+ value = {
82
+ ...value,
83
+ alerts: [...new Set([...verificationAlerts, ...(value.alerts ?? [])])],
84
+ };
80
85
  return {
81
86
  ...value,
82
87
  verified: !value.needsStateCheck &&
@@ -2,9 +2,9 @@ import { axParserCode } from "./readers-ax-program.js";
2
2
  import { readPosts, changes } from "./readers-posts.js";
3
3
  import { readProfile, screenCandidates } from "./readers-profile.js";
4
4
  import { readAX } from "./readers-ax-parser.js";
5
- import { createAXHarness } from "./readers-ax-host.js";
5
+ import { AXHarness, createAXHarness } from "./readers-ax-host.js";
6
6
  export function setupCode() {
7
- return `var xReadPosts = ${readPosts.toString()};\nvar xReadChanges = ${changes.toString()};\nvar xReadProfile = ${readProfile.toString()};\nvar xScreenCandidates = ${screenCandidates.toString()};\nvar xReadAX = ${axParserCode};\nvar xCreateAXHarness = (function(readAX) { return ${createAXHarness.toString()}; })(xReadAX);\nvar xAXSessions = {};\nvar xReadCache = {};\n`;
7
+ return `var xReadPosts = ${readPosts.toString()};\nvar xReadChanges = ${changes.toString()};\nvar xReadProfile = ${readProfile.toString()};\nvar xScreenCandidates = ${screenCandidates.toString()};\nvar xReadAX = ${axParserCode};\nvar xCreateAXHarness = (function(readAX) { const AXHarness = ${AXHarness.toString()}; return ${createAXHarness.toString()}; })(xReadAX);\nvar xAXSessions = {};\nvar xReadCache = {};\n`;
8
8
  }
9
9
  export function profileCode({ tab = "xtab", handle } = {}) {
10
10
  return profilesCode([{ tab, handle }]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/x-harness",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "Typed X task harness with compact business results and explicit diagnostics.",
6
6
  "main": "./dist/index.js",
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "269a29c44c871bac51265653a4e559ffacbf2d84"
45
+ "gitHead": "2aaac6a777b93bca44fce2ccaa5baae01113ee13"
46
46
  }
package/skill/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: x-harness
3
- version: 0.2.0
3
+ version: 0.2.1
4
4
  description: Use X through task APIs with compact receipts, complete target evidence and verified writes; requires compatible CUA and the user's X login.
5
5
  ---
6
6
 
@@ -13,7 +13,7 @@ Use the root business API. Load only the current task reference; reuse unchanged
13
13
  Read current host CUA documentation; bind a real logged-in `tab` or native `app`, exactly one. Preserve other tasks' tabs/editors.
14
14
 
15
15
  Installed module: `{{MODULE_URL}}`; CLI: `{{CLI_PATH}}`.
16
- In this repository use the absolute file URL of `<harness-repository>/dist/index.js` with original ledger/proof paths. Unresolved placeholders do not require reinstalling an existing repository runtime. Only absent runtime/workspace or an update needs [setup](references/setup.md).
16
+ In a development checkout use the absolute file URL of `<harness-repository>/dist/index.js` with existing ledger/proof paths. Keep an existing repository runtime when placeholders remain unresolved. Only absent runtime/workspace or an update needs [setup](references/setup.md).
17
17
 
18
18
  ```js
19
19
  var { createXGrowthHarness } = await import(moduleURL);
@@ -1,6 +1,6 @@
1
1
  # Recovery by signal
2
2
 
3
- Load on failure/unknown only. Keep operation/status/missing/code/proof/error; never infer success or repeat identical failures.
3
+ Load on failure/unknown only. Keep operation/status/missing/code/proof/error; do not infer success or repeat failures.
4
4
 
5
5
  | Signal | Next action and exit condition |
6
6
  | --- | --- |
@@ -16,10 +16,10 @@ Load on failure/unknown only. Keep operation/status/missing/code/proof/error; ne
16
16
 
17
17
  ## Host connection or native focus
18
18
 
19
- Failure to list/bind Chrome is a host-connection failure before reaching X, not proof of logged-out X. Per current host documentation rediscover the task tab once; validate navigation plus a necessary visible read. Native focus rejection instead needs latest AX URL/window confirmation and one supported focus correction. Do not repeat discovery or restart editors blindly.
19
+ Naming failure is not tab failure or X logout. Once, try a host-supported alternative: real Chrome → owned tab → root read. Preserve editors; no policy bypass/unchanged retries. Success proves current reading, not stable transport/writes. Reuse bindings; after real reset rediscover Chrome identity, not old numeric IDs. Native rejection needs fresh URL/window and one supported correction. App fallback keeps root calls; do not change network settings.
20
20
 
21
- Lost tab: reuse a live owned tab or create a task tab in the same actual browser; preserve other editors. Native fallback changes binding to app, not business calls; unsupported native tasks remain gaps. Network/TUN observations do not authorize setting changes.
21
+ `tab-busy`: inspect proof/claim. Age/null PID is not termination. Only evidenced own-runtime termination permits CAS release matching executor/runtime/token, preserving intent/unknown and others. Verify same ID, never resubmit. Do not reset a working runtime to diagnose another error.
22
22
 
23
23
  ## Repair boundary
24
24
 
25
- Normal use/known recovery need no source. Unresolved runtime defect/unsupported capability permits diagnostics: maintainers repair the owner, verify the failed boundary and return to root; consumers report gap/update/support, without private TS. Never scan adapters for arguments, add parsers, bypass refusal or resubmit unknown.
25
+ Source is only for unresolved defects/capability gaps: maintainers repair the owner, verify the failed boundary and return to root; consumers report gap/update/support, without source. Never scan adapters for arguments, add parsers, bypass refusal or resubmit unknown.