@tetsuo-ai/marketplace-react 0.4.1 → 0.6.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 (84) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +97 -51
  3. package/dist/chunk-7NKRSPPN.js +227 -0
  4. package/dist/chunk-7NKRSPPN.js.map +1 -0
  5. package/dist/{chunk-JVXGNW3Q.js → chunk-CDDHUFMG.js} +6 -5
  6. package/dist/chunk-CDDHUFMG.js.map +1 -0
  7. package/dist/chunk-FIDFPM5A.cjs +40 -0
  8. package/dist/chunk-FIDFPM5A.cjs.map +1 -0
  9. package/dist/chunk-IJKWKY4H.cjs +1370 -0
  10. package/dist/chunk-IJKWKY4H.cjs.map +1 -0
  11. package/dist/chunk-JTSG5FGC.cjs +397 -0
  12. package/dist/chunk-JTSG5FGC.cjs.map +1 -0
  13. package/dist/chunk-ONC6L3IX.cjs +97 -0
  14. package/dist/chunk-ONC6L3IX.cjs.map +1 -0
  15. package/dist/chunk-R76EUYDI.cjs +233 -0
  16. package/dist/chunk-R76EUYDI.cjs.map +1 -0
  17. package/dist/{chunk-XLA7DARS.js → chunk-RG5JZ6JL.js} +159 -36
  18. package/dist/chunk-RG5JZ6JL.js.map +1 -0
  19. package/dist/components/index.cjs +158 -1594
  20. package/dist/components/index.cjs.map +1 -1
  21. package/dist/components/index.d.cts +2 -2
  22. package/dist/components/index.d.ts +2 -2
  23. package/dist/components/index.js +2 -2
  24. package/dist/hooks/index.cjs +656 -509
  25. package/dist/hooks/index.cjs.map +1 -1
  26. package/dist/hooks/index.d.cts +63 -29
  27. package/dist/hooks/index.d.ts +63 -29
  28. package/dist/hooks/index.js +619 -196
  29. package/dist/hooks/index.js.map +1 -1
  30. package/dist/{index-CmVz0OOm.d.ts → index-BAyr1ODZ.d.ts} +28 -3
  31. package/dist/{index-DAZzhuO4.d.cts → index-C20NVU7_.d.cts} +28 -3
  32. package/dist/index.cjs +284 -1833
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +7 -8
  35. package/dist/index.d.ts +7 -8
  36. package/dist/index.js +64 -4
  37. package/dist/index.js.map +1 -1
  38. package/dist/signers/index.cjs +22 -161
  39. package/dist/signers/index.cjs.map +1 -1
  40. package/dist/signers/index.d.cts +16 -11
  41. package/dist/signers/index.d.ts +16 -11
  42. package/dist/signers/index.js +1 -1
  43. package/dist/testing/index.d.cts +1 -1
  44. package/dist/testing/index.d.ts +1 -1
  45. package/dist/theme/agenc-tailwind-preset.cjs +134 -108
  46. package/dist/{types-jvISR6bc.d.cts → types-B10rndEI.d.cts} +16 -7
  47. package/dist/{types-jvISR6bc.d.ts → types-B10rndEI.d.ts} +16 -7
  48. package/dist/{useAgentTrackRecord-DPt3SfYz.d.cts → useAgentTrackRecord-Ch7gHTFj.d.cts} +1 -1
  49. package/dist/{useAgentTrackRecord-DPt3SfYz.d.ts → useAgentTrackRecord-Ch7gHTFj.d.ts} +1 -1
  50. package/package.json +7 -4
  51. package/src/components/HireCheckoutModal.tsx +5 -2
  52. package/src/hooks/index.ts +1 -0
  53. package/src/hooks/internal.ts +178 -24
  54. package/src/hooks/useAgentTrackRecord.ts +5 -2
  55. package/src/hooks/useCompletionBond.ts +56 -21
  56. package/src/hooks/useDispute.ts +46 -9
  57. package/src/hooks/useHire.ts +113 -23
  58. package/src/hooks/useHumanlessHireFlow.ts +335 -115
  59. package/src/hooks/useListing.ts +2 -2
  60. package/src/hooks/useListings.ts +2 -2
  61. package/src/hooks/useRateHire.ts +32 -5
  62. package/src/hooks/useReferrerEarnings.ts +4 -1
  63. package/src/hooks/useSubmissionReview.ts +95 -32
  64. package/src/hooks/useTaskActivation.ts +51 -9
  65. package/src/hooks/useTaskGuarantee.ts +4 -1
  66. package/src/hooks/useTaskLifecycle.ts +104 -24
  67. package/src/hooks/useTaskStatus.ts +121 -26
  68. package/src/hooks/useTaskWork.ts +76 -12
  69. package/src/hooks/useWalletSigner.ts +11 -16
  70. package/src/index.ts +3 -0
  71. package/src/provider/AgencProvider.tsx +95 -3
  72. package/src/provider/referrer.ts +1 -1
  73. package/src/signers/README.md +13 -7
  74. package/src/signers/index.ts +6 -1
  75. package/src/signers/strings.ts +13 -1
  76. package/src/signers/types.ts +16 -5
  77. package/src/signers/wallet-account.ts +115 -29
  78. package/src/signers/wallet-adapter.ts +38 -4
  79. package/src/theme/agenc-tailwind-preset.cjs +134 -108
  80. package/src/types.ts +27 -1
  81. package/dist/chunk-JVXGNW3Q.js.map +0 -1
  82. package/dist/chunk-ON6XR4XO.js +0 -128
  83. package/dist/chunk-ON6XR4XO.js.map +0 -1
  84. package/dist/chunk-XLA7DARS.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { DecodedProgramAccount, ServiceListing, ListActiveListingsOptions, IndexerAgentTrackRecord, IndexerListing, Task, TaskStatus, facade } from '@tetsuo-ai/marketplace-sdk';
1
+ import { DecodedProgramAccount, ServiceListing, ListActiveListingsOptions, IndexerAgentTrackRecord, IndexerListing, Task, TaskStatus, facade, HireAndActivateProgress } from '@tetsuo-ai/marketplace-sdk';
2
2
  import { Address, TransactionSigner } from '@solana/kit';
3
- import { H as HumanlessHireInput } from '../useAgentTrackRecord-DPt3SfYz.cjs';
4
- export { A as AcceptInput, a as AgentTrackRecord, b as AnyHireInput, D as DisputeReader, c as DisputeStatus, d as HireInput, e as HireResult, f as HireStatus, I as InitiateDisputeInput, R as RejectInput, g as RequestChangesInput, h as ReviewAction, i as ReviewStatus, T as TaskGuaranteeReader, j as TrackRecordOutcome, U as UseAgentTrackRecordOptions, k as UseAgentTrackRecordResult, l as UseDisputeOptions, m as UseDisputeResult, n as UseHireResult, o as UseSubmissionReviewResult, p as UseTaskGuaranteeOptions, q as UseTaskGuaranteeResult, r as projectTrackRecord, u as useAgentTrackRecord, s as useDispute, t as useHire, v as useSubmissionReview, w as useTaskGuarantee } from '../useAgentTrackRecord-DPt3SfYz.cjs';
3
+ import { H as HumanlessHireInput } from '../useAgentTrackRecord-Ch7gHTFj.cjs';
4
+ export { A as AcceptInput, a as AgentTrackRecord, b as AnyHireInput, D as DisputeReader, c as DisputeStatus, d as HireInput, e as HireResult, f as HireStatus, I as InitiateDisputeInput, R as RejectInput, g as RequestChangesInput, h as ReviewAction, i as ReviewStatus, T as TaskGuaranteeReader, j as TrackRecordOutcome, U as UseAgentTrackRecordOptions, k as UseAgentTrackRecordResult, l as UseDisputeOptions, m as UseDisputeResult, n as UseHireResult, o as UseSubmissionReviewResult, p as UseTaskGuaranteeOptions, q as UseTaskGuaranteeResult, r as projectTrackRecord, u as useAgentTrackRecord, s as useDispute, t as useHire, v as useSubmissionReview, w as useTaskGuarantee } from '../useAgentTrackRecord-Ch7gHTFj.cjs';
5
5
 
6
6
  /** A decoded active listing row (address + decoded account). */
7
7
  type ListingRow = DecodedProgramAccount<ServiceListing>;
@@ -112,11 +112,24 @@ type TaskReader = (pda: Address | string) => Promise<Task | null>;
112
112
  */
113
113
  type ObservedEvent = unknown;
114
114
  /**
115
- * An async source of coordination events for the watched task. Pass the result
116
- * of the SDK's `subscribeMarketplaceEvents(...)` (already address-filtered) or
117
- * any async iterable. Optional.
115
+ * Original coordination-event stream API.
116
+ *
117
+ * @deprecated Prefer {@link TaskEventsSourceFactory}. A pre-created iterable
118
+ * cannot pass this hook's abort signal into its subscription transport. Legacy
119
+ * streams remain cancellation-safe at the iterator boundary through an abort
120
+ * race and best-effort `iterator.return()` cleanup.
118
121
  */
119
122
  type TaskEventsSource = AsyncIterable<ObservedEvent>;
123
+ /**
124
+ * Abort-aware coordination-event factory. Implementations should pass the
125
+ * signal to their subscription transport. The task identity lets a factory
126
+ * construct an address-filtered stream. This form is preferred over the
127
+ * deprecated pre-created {@link TaskEventsSource}.
128
+ */
129
+ type TaskEventsSourceFactory = (options: {
130
+ signal: AbortSignal;
131
+ taskPda: Address | string;
132
+ }) => AsyncIterable<ObservedEvent>;
120
133
  /** Options for {@link useTaskStatus}. */
121
134
  interface UseTaskStatusOptions {
122
135
  /**
@@ -125,17 +138,24 @@ interface UseTaskStatusOptions {
125
138
  */
126
139
  taskReader?: TaskReader;
127
140
  /**
128
- * Optional event source. When given, observed events are appended to
129
- * `events` and each triggers a refetch. Drained in a browser-only effect and
130
- * aborted on unmount.
141
+ * Optional event stream. Prefer an abort-aware factory; the deprecated
142
+ * pre-created AsyncIterable form remains supported for compatibility. Each
143
+ * event triggers a refetch.
131
144
  */
132
- events?: TaskEventsSource;
145
+ events?: TaskEventsSourceFactory | TaskEventsSource;
146
+ /** Maximum recent events retained in memory (default `256`). */
147
+ maxEvents?: number;
133
148
  /**
134
149
  * Stop polling once the task reaches this status (in addition to terminal
135
150
  * statuses). Useful to await a specific transition (e.g. `Completed`).
136
151
  */
137
152
  targetStatus?: TaskStatus;
138
- /** Poll interval in ms while non-terminal. Default `2000`. */
153
+ /**
154
+ * Poll interval in ms while non-terminal. Default `2000`.
155
+ *
156
+ * Must be a non-negative integer no greater than `2_147_483_647`, the
157
+ * maximum portable JavaScript timer delay; invalid values throw RangeError.
158
+ */
139
159
  pollIntervalMs?: number;
140
160
  /** Disable the hook entirely. Default `true` when `taskPda` + reader exist. */
141
161
  enabled?: boolean;
@@ -174,8 +194,9 @@ declare function useTaskStatus(taskPda: Address | string | undefined | null, opt
174
194
  declare const QUERY_KEY_ROOT: "agenc";
175
195
  /**
176
196
  * Stable, hierarchical TanStack Query keys. Hooks build their keys ONLY through
177
- * this factory so a consumer (or a hook) can invalidate a whole sub-tree
178
- * (`["agenc", "listings"]`) or one entity (`["agenc", "listing", pda]`).
197
+ * this factory so a consumer (or a hook) can invalidate a deployment sub-tree
198
+ * (`["agenc", namespace, "listings"]`) or one entity
199
+ * (`["agenc", namespace, "listing", pda]`).
179
200
  *
180
201
  * `JSON.stringify` is intentionally NOT used — TanStack compares keys
181
202
  * structurally, so passing the raw filter object keeps equality correct for
@@ -183,19 +204,19 @@ declare const QUERY_KEY_ROOT: "agenc";
183
204
  */
184
205
  declare const queryKeys: {
185
206
  /** All listings list queries (with their filter object as the leaf). */
186
- readonly listings: (filter?: unknown) => readonly ["agenc", "listings", {} | null];
207
+ readonly listings: (filter?: unknown, cacheNamespace?: string) => readonly ["agenc", string, "listings", {} | null];
187
208
  /** One listing + its joined provider/track-record/moderation. */
188
- readonly listing: (pda: string) => readonly ["agenc", "listing", string];
209
+ readonly listing: (pda: string, cacheNamespace?: string) => readonly ["agenc", string, "listing", string];
189
210
  /** One agent's indexer track record. */
190
- readonly agentTrackRecord: (agentPda: string) => readonly ["agenc", "agentTrackRecord", string];
211
+ readonly agentTrackRecord: (agentPda: string, cacheNamespace?: string) => readonly ["agenc", string, "agentTrackRecord", string];
191
212
  /** One task's status (read via transport / svm decode). */
192
- readonly taskStatus: (taskPda: string) => readonly ["agenc", "taskStatus", string];
213
+ readonly taskStatus: (taskPda: string, cacheNamespace?: string) => readonly ["agenc", string, "taskStatus", string];
193
214
  /** One task's dispute record. */
194
- readonly dispute: (taskPda: string) => readonly ["agenc", "dispute", string];
215
+ readonly dispute: (taskPda: string, cacheNamespace?: string) => readonly ["agenc", string, "dispute", string];
195
216
  /** One task's completion-bond ("Guaranteed Hire") state. */
196
- readonly taskGuarantee: (taskPda: string) => readonly ["agenc", "taskGuarantee", string];
217
+ readonly taskGuarantee: (taskPda: string, cacheNamespace?: string) => readonly ["agenc", string, "taskGuarantee", string];
197
218
  /** One referrer wallet's earnings (indexer-gated; see useReferrerEarnings). */
198
- readonly referrerEarnings: (wallet: string) => readonly ["agenc", "referrerEarnings", string];
219
+ readonly referrerEarnings: (wallet: string, cacheNamespace?: string) => readonly ["agenc", string, "referrerEarnings", string];
199
220
  };
200
221
  type MutationStatus = "idle" | "pending" | "success" | "error";
201
222
 
@@ -215,7 +236,10 @@ declare function useTaskActivation(taskPda: Parameters<typeof facade.setTaskJobS
215
236
 
216
237
  type HumanlessHireFlowPhase = "idle" | "hiring" | "moderating" | "activating" | "activated" | "error";
217
238
  type HumanlessHireFlowStatus = MutationStatus;
218
- type HumanlessHireFlowHireInput = Omit<HumanlessHireInput, "humanless" | "creator" | "referrer" | "referrerFeeBps">;
239
+ type HumanlessHireFlowHireInput = Omit<HumanlessHireInput, "humanless" | "creator" | "referrer" | "referrerFeeBps" | "listingSpecHash"> & {
240
+ /** Exact non-zero listing commitment required by durable SDK recovery. */
241
+ listingSpecHash: NonNullable<HumanlessHireInput["listingSpecHash"]>;
242
+ };
219
243
  type HumanlessHireFlowActivationInput = Omit<TaskActivationInput, "creator" | "jobSpecHash" | "jobSpecUri" | "moderator"> & {
220
244
  /**
221
245
  * Override the activation `moderator` (P1.2). Defaults to the `moderator`
@@ -224,7 +248,7 @@ type HumanlessHireFlowActivationInput = Omit<TaskActivationInput, "creator" | "j
224
248
  */
225
249
  moderator?: TaskActivationInput["moderator"];
226
250
  };
227
- type HumanlessHireFlowCreator = HumanlessHireInput["creator"];
251
+ type HumanlessHireFlowCreator = NonNullable<HumanlessHireInput["creator"]>;
228
252
  type HumanlessHireFlowJobSpecHash = Parameters<typeof facade.setTaskJobSpec>[0]["jobSpecHash"];
229
253
  interface HumanlessHireFlowModerationResult {
230
254
  jobSpecHash: HumanlessHireFlowJobSpecHash;
@@ -244,6 +268,8 @@ interface HumanlessHireFlowHostInput<TJobSpec> {
244
268
  listing: HumanlessHireFlowHireInput["listing"];
245
269
  jobSpec: TJobSpec;
246
270
  hireSignature: string;
271
+ /** True when finalized account state, rather than a wire response, proved the hire. */
272
+ hireReconciled?: boolean;
247
273
  referrerInjected: boolean;
248
274
  }
249
275
  type HumanlessHireFlowHost<TJobSpec> = (input: HumanlessHireFlowHostInput<TJobSpec>) => Promise<HumanlessHireFlowModerationResult>;
@@ -261,6 +287,12 @@ interface HumanlessHireFlowProgress {
261
287
  jobSpecHash: HumanlessHireFlowJobSpecHash | null;
262
288
  jobSpecUri: string | null;
263
289
  referrerInjected: boolean;
290
+ /**
291
+ * Durable SDK resume token. Persist this token before retrying a failed
292
+ * post-submission flow; pass it to `resumeHireAndActivate`, never to the
293
+ * funded `hireAndActivate` entry point.
294
+ */
295
+ recovery: HireAndActivateProgress | null;
264
296
  }
265
297
  interface HumanlessHireFlowResult {
266
298
  taskPda: Address;
@@ -269,10 +301,14 @@ interface HumanlessHireFlowResult {
269
301
  jobSpecHash: HumanlessHireFlowJobSpecHash;
270
302
  jobSpecUri: string;
271
303
  referrerInjected: boolean;
304
+ hireReconciled?: boolean;
305
+ activationReconciled?: boolean;
272
306
  moderation?: unknown;
273
307
  }
274
308
  interface UseHumanlessHireFlowResult<TJobSpec = unknown> {
275
309
  hireAndActivate: (input: HumanlessHireFlowInput<TJobSpec>) => Promise<HumanlessHireFlowResult>;
310
+ /** Resume an exact durable SDK token without submitting another hire. */
311
+ resumeHireAndActivate: (input: HumanlessHireFlowInput<TJobSpec>, recovery: HireAndActivateProgress) => Promise<HumanlessHireFlowResult>;
276
312
  phase: HumanlessHireFlowPhase;
277
313
  status: HumanlessHireFlowStatus;
278
314
  progress: HumanlessHireFlowProgress;
@@ -379,10 +415,9 @@ interface UseCompletionBondResult {
379
415
  declare function useCompletionBond(taskPda: Parameters<typeof facade.postCompletionBond>[0]["task"]): UseCompletionBondResult;
380
416
 
381
417
  /**
382
- * The minimal adapter shape this hook bridges. The forthcoming
383
- * `@tetsuo-ai/signer-adapters` hook is expected to return exactly this shape
384
- * (its `signerFromWalletAccount(...)` resolves the `signer`); until it ships,
385
- * any object matching this interface works.
418
+ * The minimal adapter shape this hook bridges. Any wallet connection hook can
419
+ * return this shape after resolving its signer with `signerFromWalletAccount`
420
+ * or `signerFromWalletAdapter`.
386
421
  */
387
422
  interface WalletSignerAdapter {
388
423
  /** The resolved kit signer, or null when no wallet is connected. */
@@ -417,8 +452,7 @@ interface UseWalletSignerResult {
417
452
  *
418
453
  * @example
419
454
  * ```tsx
420
- * // Once @tetsuo-ai/signer-adapters ships:
421
- * const adapter = useWalletStandardSigner(); // returns WalletSignerAdapter
455
+ * const adapter = useMyWalletConnection(); // returns WalletSignerAdapter
422
456
  * const { signer, connected, connect } = useWalletSigner({ adapter });
423
457
  * ```
424
458
  */
@@ -473,4 +507,4 @@ interface UseReferrerEarningsResult {
473
507
  */
474
508
  declare function useReferrerEarnings(wallet: Address | string | undefined | null): UseReferrerEarningsResult;
475
509
 
476
- export { type AutoAcceptTaskResultInput, type CancelTaskInput, type ClaimTaskInput, type CloseTaskInput, type CompletionBondStatus, type HumanlessHireFlowActivationInput, type HumanlessHireFlowCreator, type HumanlessHireFlowHireInput, type HumanlessHireFlowHost, type HumanlessHireFlowHostInput, type HumanlessHireFlowInput, type HumanlessHireFlowJobSpecHash, type HumanlessHireFlowModerationResult, type HumanlessHireFlowPhase, type HumanlessHireFlowProgress, type HumanlessHireFlowResult, type HumanlessHireFlowStatus, HumanlessHireInput, type ListingDetail, type ListingRow, type ObservedEvent, type PostCompletionBondInput, QUERY_KEY_ROOT, type RateHireInput, type RateHireStatus, type ReclaimCompletionBondInput, type ReferrerHire, type SubmitTaskResultInput, type TaskActivationInput, type TaskActivationStatus, type TaskEventsSource, type TaskLifecycleStatus, type TaskReader, type TaskWorkStatus, type UseCompletionBondResult, type UseHumanlessHireFlowResult, type UseListingOptions, type UseListingResult, type UseListingsFilter, type UseListingsOptions, type UseListingsResult, type UseRateHireResult, type UseReferrerEarningsResult, type UseTaskActivationResult, type UseTaskLifecycleResult, type UseTaskStatusOptions, type UseTaskStatusResult, type UseTaskWorkResult, type UseWalletSignerOptions, type UseWalletSignerResult, type WalletSignerAdapter, queryKeys, useCompletionBond, useHumanlessHireFlow, useListing, useListings, useRateHire, useReferrerEarnings, useTaskActivation, useTaskLifecycle, useTaskStatus, useTaskWork, useWalletSigner };
510
+ export { type AutoAcceptTaskResultInput, type CancelTaskInput, type ClaimTaskInput, type CloseTaskInput, type CompletionBondStatus, type HumanlessHireFlowActivationInput, type HumanlessHireFlowCreator, type HumanlessHireFlowHireInput, type HumanlessHireFlowHost, type HumanlessHireFlowHostInput, type HumanlessHireFlowInput, type HumanlessHireFlowJobSpecHash, type HumanlessHireFlowModerationResult, type HumanlessHireFlowPhase, type HumanlessHireFlowProgress, type HumanlessHireFlowResult, type HumanlessHireFlowStatus, HumanlessHireInput, type ListingDetail, type ListingRow, type ObservedEvent, type PostCompletionBondInput, QUERY_KEY_ROOT, type RateHireInput, type RateHireStatus, type ReclaimCompletionBondInput, type ReferrerHire, type SubmitTaskResultInput, type TaskActivationInput, type TaskActivationStatus, type TaskEventsSource, type TaskEventsSourceFactory, type TaskLifecycleStatus, type TaskReader, type TaskWorkStatus, type UseCompletionBondResult, type UseHumanlessHireFlowResult, type UseListingOptions, type UseListingResult, type UseListingsFilter, type UseListingsOptions, type UseListingsResult, type UseRateHireResult, type UseReferrerEarningsResult, type UseTaskActivationResult, type UseTaskLifecycleResult, type UseTaskStatusOptions, type UseTaskStatusResult, type UseTaskWorkResult, type UseWalletSignerOptions, type UseWalletSignerResult, type WalletSignerAdapter, queryKeys, useCompletionBond, useHumanlessHireFlow, useListing, useListings, useRateHire, useReferrerEarnings, useTaskActivation, useTaskLifecycle, useTaskStatus, useTaskWork, useWalletSigner };
@@ -1,7 +1,7 @@
1
- import { DecodedProgramAccount, ServiceListing, ListActiveListingsOptions, IndexerAgentTrackRecord, IndexerListing, Task, TaskStatus, facade } from '@tetsuo-ai/marketplace-sdk';
1
+ import { DecodedProgramAccount, ServiceListing, ListActiveListingsOptions, IndexerAgentTrackRecord, IndexerListing, Task, TaskStatus, facade, HireAndActivateProgress } from '@tetsuo-ai/marketplace-sdk';
2
2
  import { Address, TransactionSigner } from '@solana/kit';
3
- import { H as HumanlessHireInput } from '../useAgentTrackRecord-DPt3SfYz.js';
4
- export { A as AcceptInput, a as AgentTrackRecord, b as AnyHireInput, D as DisputeReader, c as DisputeStatus, d as HireInput, e as HireResult, f as HireStatus, I as InitiateDisputeInput, R as RejectInput, g as RequestChangesInput, h as ReviewAction, i as ReviewStatus, T as TaskGuaranteeReader, j as TrackRecordOutcome, U as UseAgentTrackRecordOptions, k as UseAgentTrackRecordResult, l as UseDisputeOptions, m as UseDisputeResult, n as UseHireResult, o as UseSubmissionReviewResult, p as UseTaskGuaranteeOptions, q as UseTaskGuaranteeResult, r as projectTrackRecord, u as useAgentTrackRecord, s as useDispute, t as useHire, v as useSubmissionReview, w as useTaskGuarantee } from '../useAgentTrackRecord-DPt3SfYz.js';
3
+ import { H as HumanlessHireInput } from '../useAgentTrackRecord-Ch7gHTFj.js';
4
+ export { A as AcceptInput, a as AgentTrackRecord, b as AnyHireInput, D as DisputeReader, c as DisputeStatus, d as HireInput, e as HireResult, f as HireStatus, I as InitiateDisputeInput, R as RejectInput, g as RequestChangesInput, h as ReviewAction, i as ReviewStatus, T as TaskGuaranteeReader, j as TrackRecordOutcome, U as UseAgentTrackRecordOptions, k as UseAgentTrackRecordResult, l as UseDisputeOptions, m as UseDisputeResult, n as UseHireResult, o as UseSubmissionReviewResult, p as UseTaskGuaranteeOptions, q as UseTaskGuaranteeResult, r as projectTrackRecord, u as useAgentTrackRecord, s as useDispute, t as useHire, v as useSubmissionReview, w as useTaskGuarantee } from '../useAgentTrackRecord-Ch7gHTFj.js';
5
5
 
6
6
  /** A decoded active listing row (address + decoded account). */
7
7
  type ListingRow = DecodedProgramAccount<ServiceListing>;
@@ -112,11 +112,24 @@ type TaskReader = (pda: Address | string) => Promise<Task | null>;
112
112
  */
113
113
  type ObservedEvent = unknown;
114
114
  /**
115
- * An async source of coordination events for the watched task. Pass the result
116
- * of the SDK's `subscribeMarketplaceEvents(...)` (already address-filtered) or
117
- * any async iterable. Optional.
115
+ * Original coordination-event stream API.
116
+ *
117
+ * @deprecated Prefer {@link TaskEventsSourceFactory}. A pre-created iterable
118
+ * cannot pass this hook's abort signal into its subscription transport. Legacy
119
+ * streams remain cancellation-safe at the iterator boundary through an abort
120
+ * race and best-effort `iterator.return()` cleanup.
118
121
  */
119
122
  type TaskEventsSource = AsyncIterable<ObservedEvent>;
123
+ /**
124
+ * Abort-aware coordination-event factory. Implementations should pass the
125
+ * signal to their subscription transport. The task identity lets a factory
126
+ * construct an address-filtered stream. This form is preferred over the
127
+ * deprecated pre-created {@link TaskEventsSource}.
128
+ */
129
+ type TaskEventsSourceFactory = (options: {
130
+ signal: AbortSignal;
131
+ taskPda: Address | string;
132
+ }) => AsyncIterable<ObservedEvent>;
120
133
  /** Options for {@link useTaskStatus}. */
121
134
  interface UseTaskStatusOptions {
122
135
  /**
@@ -125,17 +138,24 @@ interface UseTaskStatusOptions {
125
138
  */
126
139
  taskReader?: TaskReader;
127
140
  /**
128
- * Optional event source. When given, observed events are appended to
129
- * `events` and each triggers a refetch. Drained in a browser-only effect and
130
- * aborted on unmount.
141
+ * Optional event stream. Prefer an abort-aware factory; the deprecated
142
+ * pre-created AsyncIterable form remains supported for compatibility. Each
143
+ * event triggers a refetch.
131
144
  */
132
- events?: TaskEventsSource;
145
+ events?: TaskEventsSourceFactory | TaskEventsSource;
146
+ /** Maximum recent events retained in memory (default `256`). */
147
+ maxEvents?: number;
133
148
  /**
134
149
  * Stop polling once the task reaches this status (in addition to terminal
135
150
  * statuses). Useful to await a specific transition (e.g. `Completed`).
136
151
  */
137
152
  targetStatus?: TaskStatus;
138
- /** Poll interval in ms while non-terminal. Default `2000`. */
153
+ /**
154
+ * Poll interval in ms while non-terminal. Default `2000`.
155
+ *
156
+ * Must be a non-negative integer no greater than `2_147_483_647`, the
157
+ * maximum portable JavaScript timer delay; invalid values throw RangeError.
158
+ */
139
159
  pollIntervalMs?: number;
140
160
  /** Disable the hook entirely. Default `true` when `taskPda` + reader exist. */
141
161
  enabled?: boolean;
@@ -174,8 +194,9 @@ declare function useTaskStatus(taskPda: Address | string | undefined | null, opt
174
194
  declare const QUERY_KEY_ROOT: "agenc";
175
195
  /**
176
196
  * Stable, hierarchical TanStack Query keys. Hooks build their keys ONLY through
177
- * this factory so a consumer (or a hook) can invalidate a whole sub-tree
178
- * (`["agenc", "listings"]`) or one entity (`["agenc", "listing", pda]`).
197
+ * this factory so a consumer (or a hook) can invalidate a deployment sub-tree
198
+ * (`["agenc", namespace, "listings"]`) or one entity
199
+ * (`["agenc", namespace, "listing", pda]`).
179
200
  *
180
201
  * `JSON.stringify` is intentionally NOT used — TanStack compares keys
181
202
  * structurally, so passing the raw filter object keeps equality correct for
@@ -183,19 +204,19 @@ declare const QUERY_KEY_ROOT: "agenc";
183
204
  */
184
205
  declare const queryKeys: {
185
206
  /** All listings list queries (with their filter object as the leaf). */
186
- readonly listings: (filter?: unknown) => readonly ["agenc", "listings", {} | null];
207
+ readonly listings: (filter?: unknown, cacheNamespace?: string) => readonly ["agenc", string, "listings", {} | null];
187
208
  /** One listing + its joined provider/track-record/moderation. */
188
- readonly listing: (pda: string) => readonly ["agenc", "listing", string];
209
+ readonly listing: (pda: string, cacheNamespace?: string) => readonly ["agenc", string, "listing", string];
189
210
  /** One agent's indexer track record. */
190
- readonly agentTrackRecord: (agentPda: string) => readonly ["agenc", "agentTrackRecord", string];
211
+ readonly agentTrackRecord: (agentPda: string, cacheNamespace?: string) => readonly ["agenc", string, "agentTrackRecord", string];
191
212
  /** One task's status (read via transport / svm decode). */
192
- readonly taskStatus: (taskPda: string) => readonly ["agenc", "taskStatus", string];
213
+ readonly taskStatus: (taskPda: string, cacheNamespace?: string) => readonly ["agenc", string, "taskStatus", string];
193
214
  /** One task's dispute record. */
194
- readonly dispute: (taskPda: string) => readonly ["agenc", "dispute", string];
215
+ readonly dispute: (taskPda: string, cacheNamespace?: string) => readonly ["agenc", string, "dispute", string];
195
216
  /** One task's completion-bond ("Guaranteed Hire") state. */
196
- readonly taskGuarantee: (taskPda: string) => readonly ["agenc", "taskGuarantee", string];
217
+ readonly taskGuarantee: (taskPda: string, cacheNamespace?: string) => readonly ["agenc", string, "taskGuarantee", string];
197
218
  /** One referrer wallet's earnings (indexer-gated; see useReferrerEarnings). */
198
- readonly referrerEarnings: (wallet: string) => readonly ["agenc", "referrerEarnings", string];
219
+ readonly referrerEarnings: (wallet: string, cacheNamespace?: string) => readonly ["agenc", string, "referrerEarnings", string];
199
220
  };
200
221
  type MutationStatus = "idle" | "pending" | "success" | "error";
201
222
 
@@ -215,7 +236,10 @@ declare function useTaskActivation(taskPda: Parameters<typeof facade.setTaskJobS
215
236
 
216
237
  type HumanlessHireFlowPhase = "idle" | "hiring" | "moderating" | "activating" | "activated" | "error";
217
238
  type HumanlessHireFlowStatus = MutationStatus;
218
- type HumanlessHireFlowHireInput = Omit<HumanlessHireInput, "humanless" | "creator" | "referrer" | "referrerFeeBps">;
239
+ type HumanlessHireFlowHireInput = Omit<HumanlessHireInput, "humanless" | "creator" | "referrer" | "referrerFeeBps" | "listingSpecHash"> & {
240
+ /** Exact non-zero listing commitment required by durable SDK recovery. */
241
+ listingSpecHash: NonNullable<HumanlessHireInput["listingSpecHash"]>;
242
+ };
219
243
  type HumanlessHireFlowActivationInput = Omit<TaskActivationInput, "creator" | "jobSpecHash" | "jobSpecUri" | "moderator"> & {
220
244
  /**
221
245
  * Override the activation `moderator` (P1.2). Defaults to the `moderator`
@@ -224,7 +248,7 @@ type HumanlessHireFlowActivationInput = Omit<TaskActivationInput, "creator" | "j
224
248
  */
225
249
  moderator?: TaskActivationInput["moderator"];
226
250
  };
227
- type HumanlessHireFlowCreator = HumanlessHireInput["creator"];
251
+ type HumanlessHireFlowCreator = NonNullable<HumanlessHireInput["creator"]>;
228
252
  type HumanlessHireFlowJobSpecHash = Parameters<typeof facade.setTaskJobSpec>[0]["jobSpecHash"];
229
253
  interface HumanlessHireFlowModerationResult {
230
254
  jobSpecHash: HumanlessHireFlowJobSpecHash;
@@ -244,6 +268,8 @@ interface HumanlessHireFlowHostInput<TJobSpec> {
244
268
  listing: HumanlessHireFlowHireInput["listing"];
245
269
  jobSpec: TJobSpec;
246
270
  hireSignature: string;
271
+ /** True when finalized account state, rather than a wire response, proved the hire. */
272
+ hireReconciled?: boolean;
247
273
  referrerInjected: boolean;
248
274
  }
249
275
  type HumanlessHireFlowHost<TJobSpec> = (input: HumanlessHireFlowHostInput<TJobSpec>) => Promise<HumanlessHireFlowModerationResult>;
@@ -261,6 +287,12 @@ interface HumanlessHireFlowProgress {
261
287
  jobSpecHash: HumanlessHireFlowJobSpecHash | null;
262
288
  jobSpecUri: string | null;
263
289
  referrerInjected: boolean;
290
+ /**
291
+ * Durable SDK resume token. Persist this token before retrying a failed
292
+ * post-submission flow; pass it to `resumeHireAndActivate`, never to the
293
+ * funded `hireAndActivate` entry point.
294
+ */
295
+ recovery: HireAndActivateProgress | null;
264
296
  }
265
297
  interface HumanlessHireFlowResult {
266
298
  taskPda: Address;
@@ -269,10 +301,14 @@ interface HumanlessHireFlowResult {
269
301
  jobSpecHash: HumanlessHireFlowJobSpecHash;
270
302
  jobSpecUri: string;
271
303
  referrerInjected: boolean;
304
+ hireReconciled?: boolean;
305
+ activationReconciled?: boolean;
272
306
  moderation?: unknown;
273
307
  }
274
308
  interface UseHumanlessHireFlowResult<TJobSpec = unknown> {
275
309
  hireAndActivate: (input: HumanlessHireFlowInput<TJobSpec>) => Promise<HumanlessHireFlowResult>;
310
+ /** Resume an exact durable SDK token without submitting another hire. */
311
+ resumeHireAndActivate: (input: HumanlessHireFlowInput<TJobSpec>, recovery: HireAndActivateProgress) => Promise<HumanlessHireFlowResult>;
276
312
  phase: HumanlessHireFlowPhase;
277
313
  status: HumanlessHireFlowStatus;
278
314
  progress: HumanlessHireFlowProgress;
@@ -379,10 +415,9 @@ interface UseCompletionBondResult {
379
415
  declare function useCompletionBond(taskPda: Parameters<typeof facade.postCompletionBond>[0]["task"]): UseCompletionBondResult;
380
416
 
381
417
  /**
382
- * The minimal adapter shape this hook bridges. The forthcoming
383
- * `@tetsuo-ai/signer-adapters` hook is expected to return exactly this shape
384
- * (its `signerFromWalletAccount(...)` resolves the `signer`); until it ships,
385
- * any object matching this interface works.
418
+ * The minimal adapter shape this hook bridges. Any wallet connection hook can
419
+ * return this shape after resolving its signer with `signerFromWalletAccount`
420
+ * or `signerFromWalletAdapter`.
386
421
  */
387
422
  interface WalletSignerAdapter {
388
423
  /** The resolved kit signer, or null when no wallet is connected. */
@@ -417,8 +452,7 @@ interface UseWalletSignerResult {
417
452
  *
418
453
  * @example
419
454
  * ```tsx
420
- * // Once @tetsuo-ai/signer-adapters ships:
421
- * const adapter = useWalletStandardSigner(); // returns WalletSignerAdapter
455
+ * const adapter = useMyWalletConnection(); // returns WalletSignerAdapter
422
456
  * const { signer, connected, connect } = useWalletSigner({ adapter });
423
457
  * ```
424
458
  */
@@ -473,4 +507,4 @@ interface UseReferrerEarningsResult {
473
507
  */
474
508
  declare function useReferrerEarnings(wallet: Address | string | undefined | null): UseReferrerEarningsResult;
475
509
 
476
- export { type AutoAcceptTaskResultInput, type CancelTaskInput, type ClaimTaskInput, type CloseTaskInput, type CompletionBondStatus, type HumanlessHireFlowActivationInput, type HumanlessHireFlowCreator, type HumanlessHireFlowHireInput, type HumanlessHireFlowHost, type HumanlessHireFlowHostInput, type HumanlessHireFlowInput, type HumanlessHireFlowJobSpecHash, type HumanlessHireFlowModerationResult, type HumanlessHireFlowPhase, type HumanlessHireFlowProgress, type HumanlessHireFlowResult, type HumanlessHireFlowStatus, HumanlessHireInput, type ListingDetail, type ListingRow, type ObservedEvent, type PostCompletionBondInput, QUERY_KEY_ROOT, type RateHireInput, type RateHireStatus, type ReclaimCompletionBondInput, type ReferrerHire, type SubmitTaskResultInput, type TaskActivationInput, type TaskActivationStatus, type TaskEventsSource, type TaskLifecycleStatus, type TaskReader, type TaskWorkStatus, type UseCompletionBondResult, type UseHumanlessHireFlowResult, type UseListingOptions, type UseListingResult, type UseListingsFilter, type UseListingsOptions, type UseListingsResult, type UseRateHireResult, type UseReferrerEarningsResult, type UseTaskActivationResult, type UseTaskLifecycleResult, type UseTaskStatusOptions, type UseTaskStatusResult, type UseTaskWorkResult, type UseWalletSignerOptions, type UseWalletSignerResult, type WalletSignerAdapter, queryKeys, useCompletionBond, useHumanlessHireFlow, useListing, useListings, useRateHire, useReferrerEarnings, useTaskActivation, useTaskLifecycle, useTaskStatus, useTaskWork, useWalletSigner };
510
+ export { type AutoAcceptTaskResultInput, type CancelTaskInput, type ClaimTaskInput, type CloseTaskInput, type CompletionBondStatus, type HumanlessHireFlowActivationInput, type HumanlessHireFlowCreator, type HumanlessHireFlowHireInput, type HumanlessHireFlowHost, type HumanlessHireFlowHostInput, type HumanlessHireFlowInput, type HumanlessHireFlowJobSpecHash, type HumanlessHireFlowModerationResult, type HumanlessHireFlowPhase, type HumanlessHireFlowProgress, type HumanlessHireFlowResult, type HumanlessHireFlowStatus, HumanlessHireInput, type ListingDetail, type ListingRow, type ObservedEvent, type PostCompletionBondInput, QUERY_KEY_ROOT, type RateHireInput, type RateHireStatus, type ReclaimCompletionBondInput, type ReferrerHire, type SubmitTaskResultInput, type TaskActivationInput, type TaskActivationStatus, type TaskEventsSource, type TaskEventsSourceFactory, type TaskLifecycleStatus, type TaskReader, type TaskWorkStatus, type UseCompletionBondResult, type UseHumanlessHireFlowResult, type UseListingOptions, type UseListingResult, type UseListingsFilter, type UseListingsOptions, type UseListingsResult, type UseRateHireResult, type UseReferrerEarningsResult, type UseTaskActivationResult, type UseTaskLifecycleResult, type UseTaskStatusOptions, type UseTaskStatusResult, type UseTaskWorkResult, type UseWalletSignerOptions, type UseWalletSignerResult, type WalletSignerAdapter, queryKeys, useCompletionBond, useHumanlessHireFlow, useListing, useListings, useRateHire, useReferrerEarnings, useTaskActivation, useTaskLifecycle, useTaskStatus, useTaskWork, useWalletSigner };