@nextclaw/x-harness 0.2.45 → 0.2.46

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/SOURCE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Corresponding source
2
2
 
3
- Version 0.2.45, commit 52258a7e88c8ebdab05e3981d37ec78becabffe6.
3
+ Version 0.2.46, commit c242fc8d8d9b935668cf4093bb4cb9bda14edf16.
4
4
 
5
- Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/52258a7e88c8ebdab05e3981d37ec78becabffe6
5
+ Complete source, build scripts and dependencies: https://github.com/Peiiii/x-harness/tree/c242fc8d8d9b935668cf4093bb4cb9bda14edf16
6
6
 
7
7
  Clone this revision, run npm ci, npm run bootstrap and npm run release:build.
8
8
 
@@ -9,6 +9,7 @@ export declare class PlatformWriting {
9
9
  constructor(dependencies: Pick<PlatformDependencies, "observed" | "browser" | "followStage" | "readPerson" | "open" | "clock" | "readPost">);
10
10
  private handleCompose;
11
11
  private handleFindSubmission;
12
+ private readCandidateDetail;
12
13
  private matchesQuote;
13
14
  private matchesContent;
14
15
  private readQuotedReceipt;
@@ -148,20 +148,7 @@ export class PlatformWriting {
148
148
  const url = xURL(new URL(candidate.primary, xURL(value.page).origin).href);
149
149
  if (url.pathname.toLowerCase() ===
150
150
  `/${action.accountHandle}/status/${candidate.id}`.toLowerCase()) {
151
- value = await this.#open({
152
- url: url.href,
153
- evidenceRef: {
154
- page: value.page,
155
- observedAt: value.observedAt,
156
- publicId: candidate.id,
157
- primary: candidate.primary,
158
- },
159
- }, {
160
- view: "posts",
161
- targetId: candidate.id,
162
- replyTargetId: action.postId,
163
- });
164
- value = await this.readLoadedReplyReceipt(value, candidate.id, matchesContent);
151
+ value = await this.readCandidateDetail(value, url.href, candidate, action.postId, matchesContent);
165
152
  matches = (value.posts ?? []).filter(matchesContent);
166
153
  }
167
154
  }
@@ -181,6 +168,31 @@ export class PlatformWriting {
181
168
  missing: matches.length === 1 ? [] : ["unique-public-submission-unconfirmed"],
182
169
  };
183
170
  }
171
+ async readCandidateDetail(value, url, candidate, parentId, matchesContent) {
172
+ try {
173
+ const opened = await this.#open({
174
+ url,
175
+ evidenceRef: {
176
+ page: value.page,
177
+ observedAt: value.observedAt,
178
+ publicId: candidate.id,
179
+ primary: candidate.primary,
180
+ },
181
+ }, {
182
+ view: "posts",
183
+ targetId: candidate.id,
184
+ replyTargetId: parentId,
185
+ });
186
+ return await this.readLoadedReplyReceipt(opened, candidate.id, matchesContent);
187
+ }
188
+ catch (error) {
189
+ // Preserve the fresh observed link for the root API’s existing read-only recovery.
190
+ // Missing parent evidence still fails the exact-parent gate below.
191
+ if (!/Timed out waiting for URL/.test(error instanceof Error ? error.message : ""))
192
+ throw error;
193
+ }
194
+ return value;
195
+ }
184
196
  matchesQuote(post, action) {
185
197
  return (post.quoteSource?.parentId === post.id &&
186
198
  post.quoteSource?.id === action.quoteTarget.postId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/x-harness",
3
- "version": "0.2.45",
3
+ "version": "0.2.46",
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": "52258a7e88c8ebdab05e3981d37ec78becabffe6"
45
+ "gitHead": "c242fc8d8d9b935668cf4093bb4cb9bda14edf16"
46
46
  }