@c4roa0/agentpay-user 0.0.0-stage → 0.3.1

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 (175) hide show
  1. package/AGENTS.md +137 -0
  2. package/CONTRIBUTING.md +16 -0
  3. package/LICENSE +373 -0
  4. package/NOTICE.md +20 -0
  5. package/README.md +85 -2
  6. package/SECURITY.md +16 -0
  7. package/doc/README.md +52 -0
  8. package/doc/TODO.md +107 -0
  9. package/doc/architecture.md +99 -0
  10. package/doc/design.md +60 -0
  11. package/doc/develope.md +68 -0
  12. package/doc/plans/user-wallet-distribution.md +91 -0
  13. package/doc/reference/harness-skill-runtime.md +120 -0
  14. package/doc/reference/local-cache-foundation.md +176 -0
  15. package/doc/reference/local-safe-owner-ui.md +25 -0
  16. package/doc/reference/local-update.md +18 -0
  17. package/doc/reference/multi-service-runtime.md +119 -0
  18. package/doc/reference/npm-integration-verification.md +103 -0
  19. package/doc/reference/onboarding-writing.md +48 -0
  20. package/doc/reference/original-order-recovery.md +97 -0
  21. package/doc/reference/private-anvil-onboarding-config.example.json +18 -0
  22. package/doc/reference/public-deployment-settings.md +56 -0
  23. package/doc/reference/random-skill-contract.md +18 -0
  24. package/doc/reference/result-file-cache.md +166 -0
  25. package/doc/reference/runtime-address-recovery.md +42 -0
  26. package/doc/reference/runtime-result-cache.md +157 -0
  27. package/doc/reference/runtime-startup-recovery.md +141 -0
  28. package/doc/reference/skill-input-output-cache.md +93 -0
  29. package/doc/reference/wallet-identity-policy-history.md +23 -0
  30. package/doc/runbooks/commands.md +103 -0
  31. package/doc/runbooks/deployment-authorization-update.md +42 -0
  32. package/doc/runbooks/emergency-payment-stop.md +80 -0
  33. package/doc/runbooks/local-autostart.md +212 -0
  34. package/doc/runbooks/local-cache.md +115 -0
  35. package/doc/runbooks/local-update.md +84 -0
  36. package/doc/runbooks/market-connection.md +73 -0
  37. package/doc/runbooks/npm-publication.md +56 -0
  38. package/doc/runbooks/official-test-package.md +62 -0
  39. package/doc/runbooks/order-cancellation.md +56 -0
  40. package/doc/runbooks/order-support.md +41 -0
  41. package/doc/runbooks/policy-renewal.md +80 -0
  42. package/doc/runbooks/private-anvil-terminal-setup.md +58 -0
  43. package/doc/runbooks/runtime-skill-client.md +155 -0
  44. package/doc/runbooks/safe-owner-web.md +104 -0
  45. package/doc/runbooks/safe-policy-migration.md +36 -0
  46. package/doc/runbooks/safe-policy-setup.md +52 -0
  47. package/doc/runbooks/terminal-authorization-preview.md +38 -0
  48. package/doc/runbooks/unlock-wallet.md +68 -0
  49. package/doc/runbooks/user-onboarding.md +87 -0
  50. package/doc/runbooks/wallet-identity.md +59 -0
  51. package/doc/security/public-source-review-2026-11-06.md +71 -0
  52. package/doc/usage.md +54 -0
  53. package/package.json +49 -4
  54. package/progress.md +210 -0
  55. package/run +29 -0
  56. package/scripts/agentpay-cli.mjs +11 -0
  57. package/scripts/authorize-existing-safe.mjs +211 -0
  58. package/scripts/autostart.mjs +186 -0
  59. package/scripts/cancel-order.mjs +76 -0
  60. package/scripts/check-installation.mjs +26 -0
  61. package/scripts/check-official-test-package.mjs +35 -0
  62. package/scripts/check-purchase-readiness.mjs +275 -0
  63. package/scripts/configure-runtime-client.mjs +16 -0
  64. package/scripts/guide-policy.mjs +64 -0
  65. package/scripts/initialize-caller-credential.mjs +11 -0
  66. package/scripts/install-skill-bundle.mjs +176 -0
  67. package/scripts/install-user.mjs +24 -0
  68. package/scripts/local-service.mjs +60 -0
  69. package/scripts/lock.mjs +11 -0
  70. package/scripts/login-notify.mjs +39 -0
  71. package/scripts/migrate-safe-policy.mjs +165 -0
  72. package/scripts/official-paid-test.mjs +9 -0
  73. package/scripts/poll-unconfirmed-notice.mjs +75 -0
  74. package/scripts/prepare-onboarding.mjs +33 -0
  75. package/scripts/preview-policy.mjs +65 -0
  76. package/scripts/random-model-ack-smoke.mjs +235 -0
  77. package/scripts/random-reject-smoke.mjs +147 -0
  78. package/scripts/renew.mjs +9 -0
  79. package/scripts/repair.mjs +10 -0
  80. package/scripts/revoke.mjs +9 -0
  81. package/scripts/select-skill-bundle.mjs +39 -0
  82. package/scripts/setup-local.mjs +199 -0
  83. package/scripts/status.mjs +13 -0
  84. package/scripts/test-package.mjs +35 -0
  85. package/scripts/unlock.mjs +13 -0
  86. package/scripts/update.mjs +7 -0
  87. package/scripts/user-setup.mjs +219 -0
  88. package/scripts/verify-npm-release.mjs +32 -0
  89. package/src/active-skill.mjs +160 -0
  90. package/src/anvil-onboarding-state.mjs +96 -0
  91. package/src/anvil-onboarding.mjs +1036 -0
  92. package/src/authorization-question-checkpoint.mjs +114 -0
  93. package/src/autostart-files.mjs +50 -0
  94. package/src/cache-management-cli.mjs +302 -0
  95. package/src/cache-management.mjs +47 -0
  96. package/src/caller-auth.mjs +58 -0
  97. package/src/client-request-lock.mjs +44 -0
  98. package/src/connect-market.mjs +408 -0
  99. package/src/demo-unlock-secret.mjs +64 -0
  100. package/src/deployment-status.mjs +198 -0
  101. package/src/file-cache-cli.mjs +83 -0
  102. package/src/file-cache-owner.mjs +74 -0
  103. package/src/file-cache-settings.mjs +50 -0
  104. package/src/file-cache.mjs +790 -0
  105. package/src/file-download.mjs +281 -0
  106. package/src/finalization-disclosure.mjs +16 -0
  107. package/src/guided-setup.mjs +194 -0
  108. package/src/index.mjs +1233 -0
  109. package/src/install-and-setup.mjs +38 -0
  110. package/src/install-preflight.mjs +201 -0
  111. package/src/install-user.mjs +279 -0
  112. package/src/installation-paths.mjs +31 -0
  113. package/src/invocation-result.mjs +148 -0
  114. package/src/invocation-store.mjs +385 -0
  115. package/src/local-data-directory.mjs +117 -0
  116. package/src/local-info.mjs +181 -0
  117. package/src/local-services.mjs +156 -0
  118. package/src/local-time.mjs +36 -0
  119. package/src/local-update.mjs +316 -0
  120. package/src/local-wallet-ipc.mjs +93 -0
  121. package/src/login-reminder.mjs +28 -0
  122. package/src/market-download-url.mjs +21 -0
  123. package/src/node-version.mjs +12 -0
  124. package/src/npm-update.mjs +126 -0
  125. package/src/official-paid-test.mjs +407 -0
  126. package/src/official-test-package.mjs +41 -0
  127. package/src/official-test-update.mjs +162 -0
  128. package/src/order-cancellation.mjs +241 -0
  129. package/src/order-closure.mjs +42 -0
  130. package/src/order-list-panel.mjs +110 -0
  131. package/src/order-review.mjs +424 -0
  132. package/src/order-status-panel.mjs +65 -0
  133. package/src/order-support.mjs +365 -0
  134. package/src/owner-approval-server.mjs +332 -0
  135. package/src/owner-signer.mjs +67 -0
  136. package/src/policy-info.mjs +38 -0
  137. package/src/policy-migration.mjs +84 -0
  138. package/src/policy-operations.mjs +67 -0
  139. package/src/policy-preview-server.mjs +236 -0
  140. package/src/policy-terminal-guide.mjs +377 -0
  141. package/src/prepare-local-services.mjs +143 -0
  142. package/src/prepare-onboarding.mjs +210 -0
  143. package/src/private-journal-files.mjs +29 -0
  144. package/src/protocol-package.mjs +25 -0
  145. package/src/readiness-profile.mjs +30 -0
  146. package/src/renew-policy.mjs +605 -0
  147. package/src/repair-market-wallet.mjs +137 -0
  148. package/src/restore-wallet.mjs +255 -0
  149. package/src/result-cache-view.mjs +276 -0
  150. package/src/runtime-client.mjs +1145 -0
  151. package/src/runtime-connection-settings.mjs +101 -0
  152. package/src/runtime-recovery.mjs +667 -0
  153. package/src/runtime-status.mjs +32 -0
  154. package/src/safe-owner-anvil.mjs +115 -0
  155. package/src/safe-policy-plan.mjs +195 -0
  156. package/src/service-reference.mjs +233 -0
  157. package/src/service-url.mjs +52 -0
  158. package/src/settlement-response.mjs +69 -0
  159. package/src/setup-autostart.mjs +197 -0
  160. package/src/setup-demo.mjs +152 -0
  161. package/src/skill-bundle.mjs +142 -0
  162. package/src/skill-client.mjs +198 -0
  163. package/src/skill-install-prompt.mjs +31 -0
  164. package/src/skill-package.mjs +50 -0
  165. package/src/skill-zip.mjs +220 -0
  166. package/src/software-versions.mjs +48 -0
  167. package/src/status-panel.mjs +603 -0
  168. package/src/transport.mjs +48 -0
  169. package/src/uninstall-local.mjs +299 -0
  170. package/src/user-cli.mjs +354 -0
  171. package/src/user-setup-guide.mjs +193 -0
  172. package/src/wallet-control.mjs +182 -0
  173. package/src/wallet-ipc-error.mjs +16 -0
  174. package/src/wallet-package.mjs +28 -0
  175. package/update-pair.json +6 -0
package/AGENTS.md ADDED
@@ -0,0 +1,137 @@
1
+ # AgentPay User Runtime Instructions
2
+
3
+ ## Behavior-first verification — 2026-11-06
4
+
5
+ - Prefer end-to-end tests through real product entry points and public interfaces.
6
+ Test observable behavior and user outcomes, not internal implementation shape.
7
+ Use real processes, storage and Anvil where the claim depends on them; do not
8
+ substitute direct database writes or internal-state injection for the workflow
9
+ being accepted. Controlled fixtures may prepare prerequisites.
10
+ - Select meaningful complete journeys and failure boundaries: independent install/
11
+ package consumption, authorization, payment, delivery, settlement/refund, denied
12
+ access, duplicate requests and interrupted-operation recovery as applicable.
13
+ A test should demonstrate a functional requirement or a concrete regression.
14
+ - Avoid tests that merely mirror implementation, assert source text/private helper
15
+ structure, or repeat the same coverage without a distinct failure boundary.
16
+ Syntax, type and build checks are useful checks, not functional acceptance.
17
+ - Keep focused tests for signatures, canonical hashes, amount/time boundaries,
18
+ authorization and concurrency invariants when they give precise protection that
19
+ end-to-end tests alone cannot efficiently provide. End-to-end preference does
20
+ not remove negative security or financial-boundary coverage.
21
+ - Review existing tests by the same standard. Consolidate redundant tests only
22
+ after equivalent meaningful coverage passes; do not delete a regression merely
23
+ because it is a unit test. Do not inflate test counts as a measure of readiness.
24
+ - Label mocked external dependencies and evidence limits explicitly. Simulated
25
+ success does not prove real process recovery, real payment or participant usability.
26
+ Keep tests bounded to the change and use maintained fixtures; this principle does
27
+ not authorize live funds, public-network operations, destructive resets or broad
28
+ resource-heavy test runs.
29
+
30
+
31
+
32
+ ## Network portability invariant — 2026-11-04
33
+
34
+ Develop and verify the same product flows on Anvil. Moving to a supported EVM
35
+ network must use configuration, deployment artifacts and explicit signer selection,
36
+ not a separate implementation of authorization, payment or recovery. External-owner
37
+ signing must be testable against Anvil as well. Keep test signer guards and private
38
+ reset/funding tools restricted; never remove them to make a product entry portable.
39
+ Chain ID is identity, not permission to select an unlocked test signer. Network
40
+ capabilities/finality and deployment addresses are explicit validated settings.
41
+ Changing networks never silently rewrites saved Policies, Orders or request identity.
42
+ Anvil results do not establish real-network compatibility or release approval.
43
+
44
+ ## Cache and download boundaries — 2026-11-04
45
+
46
+ Cache text/files are business-neutral. Show saved Provider provenance when package
47
+ provenance is unavailable; never infer caller identity from installed ZIPs. Merge
48
+ matching logical outputs for display but count physical result copies. Display
49
+ metadata must not change request identity, payment authorization or cleanup safety.
50
+ ZIP source URLs are explicit and independent of service endpoint paths. Protocol
51
+ v1 canonical endpoint/profile requirements remain authoritative; do not relax them
52
+ as part of a generic installer or UI fix. Official random-test selection is scoped.
53
+
54
+
55
+ ## Canonical User commands
56
+
57
+ Use grouped public commands: `wallet info/unlock/lock/restore`, `policy info/renew/revoke`,
58
+ `service start/stop/restart`, `service autostart on/off`, `service logs wallet/runtime`,
59
+ `market connect`, `orders ACTION ID`, `cache ACTION`, and `payment test`.
60
+ Top-level install/setup/repair/uninstall/status/help remain. The official test is a
61
+ paid private-Anvil check after explicit quote consent. Completed tests lead to a
62
+ fresh quote and confirmation; unfinished tests retain their original request. Retain older test identities and records. Keep
63
+ generated Next steps, web copy, tests and current
64
+ runbooks aligned. Do not add legacy flat aliases. Policy owner confirmation cannot
65
+ be bypassed by repair's `-f`. See doc/runbooks/commands.md.
66
+
67
+
68
+ ## Wallet identity priority — 2026-10-31
69
+
70
+ Read `doc/reference/wallet-identity-policy-history.md` before connection/recovery work.
71
+ Market identity is network/Module/Safe/delegate; nickname belongs to this tuple,
72
+ while each Policy remains an independently verified Order-access scope. Do not
73
+ merge by Safe/name alone or create device IDs. Use current progress/TODO to identify
74
+ remaining acceptance; historical implementation pauses are not current blockers. Do not
75
+ silently reinterpret existing connection IDs, reset data or broaden authority.
76
+
77
+
78
+ Read `README.md`, `progress.md`, `doc/architecture.md`, `doc/design.md`, and
79
+ `doc/TODO.md` before changing this repository. Check this repository's Git
80
+ status first; when working inside a larger workspace, also check its enclosing
81
+ repository status.
82
+
83
+ ## Product Boundary
84
+
85
+ - This is the user-side Agent/Skill runtime, not the Provider server.
86
+ - Wallet is a separate process and the only owner of the Session Key.
87
+ - Use only Wallet's narrow AgentPay IPC operations; never add generic signing.
88
+ - A local Skill may receive an opaque Service Authorization but must not log or
89
+ persist it beyond the active invocation.
90
+ - Private request and output data travel only through User Runtime, Skill, and
91
+ Provider server. Settlement and Market receive only hashes and metadata.
92
+ - Never accept caller-supplied price, usage limit, Provider identity, or payout
93
+ facts as authority. Settlement owns commercial truth.
94
+ - Do not introduce legacy Execution Ticket behavior into native purchases.
95
+
96
+ ## Development Rules
97
+
98
+ - Keep participant interactions simple: one `agentpay` command should orchestrate
99
+ required preparation and continue the original task. Ask only for meaningful
100
+ decisions or secrets; do not make users assemble build/restart/unlock commands.
101
+ - Use concise, human-readable progress, clear completion and a concrete retry
102
+ action. Keep detailed diagnostics in logs, not the main guide.
103
+
104
+ - Complete one approved closed loop at a time and report before starting the
105
+ next.
106
+ - Native acceptance evidence must start real processes and use formal APIs. Test harnesses
107
+ may orchestrate and assert, but must not fabricate states through direct
108
+ database writes, internal stores, or static authorization bypasses.
109
+ - Keep ports loopback-only until a later ingress decision.
110
+ - Never commit secrets, private requests/results, runtime config, logs, or
111
+ generated credentials.
112
+ - Prefer targeted syntax, unit, and process checks over full builds.
113
+
114
+ ## Documentation
115
+
116
+ Keep `README.md`, `AGENTS.md`, `progress.md`, and the required `doc/` files
117
+ current. Put durable evidence in `doc/records/`, runbooks in `doc/runbooks/`,
118
+ specialized contracts in `doc/reference/`, and obsolete material in
119
+ `doc/archive/`.
120
+
121
+ ## Documentation navigation
122
+
123
+ Use `doc/README.md` to select documents by role and function. Keep current work in
124
+ `progress.md` and `doc/TODO.md`; put dated verification in `doc/records/` and superseded
125
+ chronology in `doc/archive/`. Archived pending tasks do not authorize repeating old
126
+ operations. Keep this repository independently readable; do not link parent workspace
127
+ documentation. Update local links and the catalog when reorganizing documents.
128
+
129
+ ## Public source and independent development
130
+
131
+ User's original code is MPL 2.0; preserve MIT notices on Protocol and attributed
132
+ reference fixtures. Keep private platform scripts and operational records outside
133
+ this repository. Normal local tests need only User with `npm ci`; Wallet comes from its pinned public package;
134
+ load Protocol fixtures from the pinned public package, not a source checkout.
135
+ Do not remove scripts merely because their name contains smoke or Anvil: some are
136
+ current onboarding entries. Review callers first. Never weaken signer or payment
137
+ boundaries to simplify tests. Keep source maps and behavioral evidence limits current.
@@ -0,0 +1,16 @@
1
+ # Contributing to AgentPay User
2
+
3
+ Start with the [developer guide](doc/develope.md) and [source map](doc/architecture.md).
4
+ Explain the user-visible problem and the intended behavior before changing public
5
+ interfaces, payment/recovery rules or persisted identity. Keep fixes focused and
6
+ include meaningful behavioral evidence with its limits.
7
+
8
+ Use disposable data and controlled local fixtures. Never add private platform source,
9
+ real credentials, owner keys or participant records to tests. Financial changes need
10
+ negative authorization, duplicate/conflict and recovery checks; tests of helper shape
11
+ or source text alone are not acceptance. See the [test guide](test/README.md).
12
+
13
+ Report security issues through [SECURITY.md](SECURITY.md), not a public issue.
14
+ Contributions to MPL-covered files are provided under MPL 2.0. Preserve the separate
15
+ licenses of vendored dependencies and attributed test fixtures. Do not submit code
16
+ whose license or ownership you cannot grant on those terms.
package/LICENSE ADDED
@@ -0,0 +1,373 @@
1
+ Mozilla Public License Version 2.0
2
+ ==================================
3
+
4
+ 1. Definitions
5
+ --------------
6
+
7
+ 1.1. "Contributor"
8
+ means each individual or legal entity that creates, contributes to
9
+ the creation of, or owns Covered Software.
10
+
11
+ 1.2. "Contributor Version"
12
+ means the combination of the Contributions of others (if any) used
13
+ by a Contributor and that particular Contributor's Contribution.
14
+
15
+ 1.3. "Contribution"
16
+ means Covered Software of a particular Contributor.
17
+
18
+ 1.4. "Covered Software"
19
+ means Source Code Form to which the initial Contributor has attached
20
+ the notice in Exhibit A, the Executable Form of such Source Code
21
+ Form, and Modifications of such Source Code Form, in each case
22
+ including portions thereof.
23
+
24
+ 1.5. "Incompatible With Secondary Licenses"
25
+ means
26
+
27
+ (a) that the initial Contributor has attached the notice described
28
+ in Exhibit B to the Covered Software; or
29
+
30
+ (b) that the Covered Software was made available under the terms of
31
+ version 1.1 or earlier of the License, but not also under the
32
+ terms of a Secondary License.
33
+
34
+ 1.6. "Executable Form"
35
+ means any form of the work other than Source Code Form.
36
+
37
+ 1.7. "Larger Work"
38
+ means a work that combines Covered Software with other material, in
39
+ a separate file or files, that is not Covered Software.
40
+
41
+ 1.8. "License"
42
+ means this document.
43
+
44
+ 1.9. "Licensable"
45
+ means having the right to grant, to the maximum extent possible,
46
+ whether at the time of the initial grant or subsequently, any and
47
+ all of the rights conveyed by this License.
48
+
49
+ 1.10. "Modifications"
50
+ means any of the following:
51
+
52
+ (a) any file in Source Code Form that results from an addition to,
53
+ deletion from, or modification of the contents of Covered
54
+ Software; or
55
+
56
+ (b) any new file in Source Code Form that contains any Covered
57
+ Software.
58
+
59
+ 1.11. "Patent Claims" of a Contributor
60
+ means any patent claim(s), including without limitation, method,
61
+ process, and apparatus claims, in any patent Licensable by such
62
+ Contributor that would be infringed, but for the grant of the
63
+ License, by the making, using, selling, offering for sale, having
64
+ made, import, or transfer of either its Contributions or its
65
+ Contributor Version.
66
+
67
+ 1.12. "Secondary License"
68
+ means either the GNU General Public License, Version 2.0, the GNU
69
+ Lesser General Public License, Version 2.1, the GNU Affero General
70
+ Public License, Version 3.0, or any later versions of those
71
+ licenses.
72
+
73
+ 1.13. "Source Code Form"
74
+ means the form of the work preferred for making modifications.
75
+
76
+ 1.14. "You" (or "Your")
77
+ means an individual or a legal entity exercising rights under this
78
+ License. For legal entities, "You" includes any entity that
79
+ controls, is controlled by, or is under common control with You. For
80
+ purposes of this definition, "control" means (a) the power, direct
81
+ or indirect, to cause the direction or management of such entity,
82
+ whether by contract or otherwise, or (b) ownership of more than
83
+ fifty percent (50%) of the outstanding shares or beneficial
84
+ ownership of such entity.
85
+
86
+ 2. License Grants and Conditions
87
+ --------------------------------
88
+
89
+ 2.1. Grants
90
+
91
+ Each Contributor hereby grants You a world-wide, royalty-free,
92
+ non-exclusive license:
93
+
94
+ (a) under intellectual property rights (other than patent or trademark)
95
+ Licensable by such Contributor to use, reproduce, make available,
96
+ modify, display, perform, distribute, and otherwise exploit its
97
+ Contributions, either on an unmodified basis, with Modifications, or
98
+ as part of a Larger Work; and
99
+
100
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
101
+ for sale, have made, import, and otherwise transfer either its
102
+ Contributions or its Contributor Version.
103
+
104
+ 2.2. Effective Date
105
+
106
+ The licenses granted in Section 2.1 with respect to any Contribution
107
+ become effective for each Contribution on the date the Contributor first
108
+ distributes such Contribution.
109
+
110
+ 2.3. Limitations on Grant Scope
111
+
112
+ The licenses granted in this Section 2 are the only rights granted under
113
+ this License. No additional rights or licenses will be implied from the
114
+ distribution or licensing of Covered Software under this License.
115
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
116
+ Contributor:
117
+
118
+ (a) for any code that a Contributor has removed from Covered Software;
119
+ or
120
+
121
+ (b) for infringements caused by: (i) Your and any other third party's
122
+ modifications of Covered Software, or (ii) the combination of its
123
+ Contributions with other software (except as part of its Contributor
124
+ Version); or
125
+
126
+ (c) under Patent Claims infringed by Covered Software in the absence of
127
+ its Contributions.
128
+
129
+ This License does not grant any rights in the trademarks, service marks,
130
+ or logos of any Contributor (except as may be necessary to comply with
131
+ the notice requirements in Section 3.4).
132
+
133
+ 2.4. Subsequent Licenses
134
+
135
+ No Contributor makes additional grants as a result of Your choice to
136
+ distribute the Covered Software under a subsequent version of this
137
+ License (see Section 10.2) or under the terms of a Secondary License (if
138
+ permitted under the terms of Section 3.3).
139
+
140
+ 2.5. Representation
141
+
142
+ Each Contributor represents that the Contributor believes its
143
+ Contributions are its original creation(s) or it has sufficient rights
144
+ to grant the rights to its Contributions conveyed by this License.
145
+
146
+ 2.6. Fair Use
147
+
148
+ This License is not intended to limit any rights You have under
149
+ applicable copyright doctrines of fair use, fair dealing, or other
150
+ equivalents.
151
+
152
+ 2.7. Conditions
153
+
154
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155
+ in Section 2.1.
156
+
157
+ 3. Responsibilities
158
+ -------------------
159
+
160
+ 3.1. Distribution of Source Form
161
+
162
+ All distribution of Covered Software in Source Code Form, including any
163
+ Modifications that You create or to which You contribute, must be under
164
+ the terms of this License. You must inform recipients that the Source
165
+ Code Form of the Covered Software is governed by the terms of this
166
+ License, and how they can obtain a copy of this License. You may not
167
+ attempt to alter or restrict the recipients' rights in the Source Code
168
+ Form.
169
+
170
+ 3.2. Distribution of Executable Form
171
+
172
+ If You distribute Covered Software in Executable Form then:
173
+
174
+ (a) such Covered Software must also be made available in Source Code
175
+ Form, as described in Section 3.1, and You must inform recipients of
176
+ the Executable Form how they can obtain a copy of such Source Code
177
+ Form by reasonable means in a timely manner, at a charge no more
178
+ than the cost of distribution to the recipient; and
179
+
180
+ (b) You may distribute such Executable Form under the terms of this
181
+ License, or sublicense it under different terms, provided that the
182
+ license for the Executable Form does not attempt to limit or alter
183
+ the recipients' rights in the Source Code Form under this License.
184
+
185
+ 3.3. Distribution of a Larger Work
186
+
187
+ You may create and distribute a Larger Work under terms of Your choice,
188
+ provided that You also comply with the requirements of this License for
189
+ the Covered Software. If the Larger Work is a combination of Covered
190
+ Software with a work governed by one or more Secondary Licenses, and the
191
+ Covered Software is not Incompatible With Secondary Licenses, this
192
+ License permits You to additionally distribute such Covered Software
193
+ under the terms of such Secondary License(s), so that the recipient of
194
+ the Larger Work may, at their option, further distribute the Covered
195
+ Software under the terms of either this License or such Secondary
196
+ License(s).
197
+
198
+ 3.4. Notices
199
+
200
+ You may not remove or alter the substance of any license notices
201
+ (including copyright notices, patent notices, disclaimers of warranty,
202
+ or limitations of liability) contained within the Source Code Form of
203
+ the Covered Software, except that You may alter any license notices to
204
+ the extent required to remedy known factual inaccuracies.
205
+
206
+ 3.5. Application of Additional Terms
207
+
208
+ You may choose to offer, and to charge a fee for, warranty, support,
209
+ indemnity or liability obligations to one or more recipients of Covered
210
+ Software. However, You may do so only on Your own behalf, and not on
211
+ behalf of any Contributor. You must make it absolutely clear that any
212
+ such warranty, support, indemnity, or liability obligation is offered by
213
+ You alone, and You hereby agree to indemnify every Contributor for any
214
+ liability incurred by such Contributor as a result of warranty, support,
215
+ indemnity or liability terms You offer. You may include additional
216
+ disclaimers of warranty and limitations of liability specific to any
217
+ jurisdiction.
218
+
219
+ 4. Inability to Comply Due to Statute or Regulation
220
+ ---------------------------------------------------
221
+
222
+ If it is impossible for You to comply with any of the terms of this
223
+ License with respect to some or all of the Covered Software due to
224
+ statute, judicial order, or regulation then You must: (a) comply with
225
+ the terms of this License to the maximum extent possible; and (b)
226
+ describe the limitations and the code they affect. Such description must
227
+ be placed in a text file included with all distributions of the Covered
228
+ Software under this License. Except to the extent prohibited by statute
229
+ or regulation, such description must be sufficiently detailed for a
230
+ recipient of ordinary skill to be able to understand it.
231
+
232
+ 5. Termination
233
+ --------------
234
+
235
+ 5.1. The rights granted under this License will terminate automatically
236
+ if You fail to comply with any of its terms. However, if You become
237
+ compliant, then the rights granted under this License from a particular
238
+ Contributor are reinstated (a) provisionally, unless and until such
239
+ Contributor explicitly and finally terminates Your grants, and (b) on an
240
+ ongoing basis, if such Contributor fails to notify You of the
241
+ non-compliance by some reasonable means prior to 60 days after You have
242
+ come back into compliance. Moreover, Your grants from a particular
243
+ Contributor are reinstated on an ongoing basis if such Contributor
244
+ notifies You of the non-compliance by some reasonable means, this is the
245
+ first time You have received notice of non-compliance with this License
246
+ from such Contributor, and You become compliant prior to 30 days after
247
+ Your receipt of the notice.
248
+
249
+ 5.2. If You initiate litigation against any entity by asserting a patent
250
+ infringement claim (excluding declaratory judgment actions,
251
+ counter-claims, and cross-claims) alleging that a Contributor Version
252
+ directly or indirectly infringes any patent, then the rights granted to
253
+ You by any and all Contributors for the Covered Software under Section
254
+ 2.1 of this License shall terminate.
255
+
256
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257
+ end user license agreements (excluding distributors and resellers) which
258
+ have been validly granted by You or Your distributors under this License
259
+ prior to termination shall survive termination.
260
+
261
+ ************************************************************************
262
+ * *
263
+ * 6. Disclaimer of Warranty *
264
+ * ------------------------- *
265
+ * *
266
+ * Covered Software is provided under this License on an "as is" *
267
+ * basis, without warranty of any kind, either expressed, implied, or *
268
+ * statutory, including, without limitation, warranties that the *
269
+ * Covered Software is free of defects, merchantable, fit for a *
270
+ * particular purpose or non-infringing. The entire risk as to the *
271
+ * quality and performance of the Covered Software is with You. *
272
+ * Should any Covered Software prove defective in any respect, You *
273
+ * (not any Contributor) assume the cost of any necessary servicing, *
274
+ * repair, or correction. This disclaimer of warranty constitutes an *
275
+ * essential part of this License. No use of any Covered Software is *
276
+ * authorized under this License except under this disclaimer. *
277
+ * *
278
+ ************************************************************************
279
+
280
+ ************************************************************************
281
+ * *
282
+ * 7. Limitation of Liability *
283
+ * -------------------------- *
284
+ * *
285
+ * Under no circumstances and under no legal theory, whether tort *
286
+ * (including negligence), contract, or otherwise, shall any *
287
+ * Contributor, or anyone who distributes Covered Software as *
288
+ * permitted above, be liable to You for any direct, indirect, *
289
+ * special, incidental, or consequential damages of any character *
290
+ * including, without limitation, damages for lost profits, loss of *
291
+ * goodwill, work stoppage, computer failure or malfunction, or any *
292
+ * and all other commercial damages or losses, even if such party *
293
+ * shall have been informed of the possibility of such damages. This *
294
+ * limitation of liability shall not apply to liability for death or *
295
+ * personal injury resulting from such party's negligence to the *
296
+ * extent applicable law prohibits such limitation. Some *
297
+ * jurisdictions do not allow the exclusion or limitation of *
298
+ * incidental or consequential damages, so this exclusion and *
299
+ * limitation may not apply to You. *
300
+ * *
301
+ ************************************************************************
302
+
303
+ 8. Litigation
304
+ -------------
305
+
306
+ Any litigation relating to this License may be brought only in the
307
+ courts of a jurisdiction where the defendant maintains its principal
308
+ place of business and such litigation shall be governed by laws of that
309
+ jurisdiction, without reference to its conflict-of-law provisions.
310
+ Nothing in this Section shall prevent a party's ability to bring
311
+ cross-claims or counter-claims.
312
+
313
+ 9. Miscellaneous
314
+ ----------------
315
+
316
+ This License represents the complete agreement concerning the subject
317
+ matter hereof. If any provision of this License is held to be
318
+ unenforceable, such provision shall be reformed only to the extent
319
+ necessary to make it enforceable. Any law or regulation which provides
320
+ that the language of a contract shall be construed against the drafter
321
+ shall not be used to construe this License against a Contributor.
322
+
323
+ 10. Versions of the License
324
+ ---------------------------
325
+
326
+ 10.1. New Versions
327
+
328
+ Mozilla Foundation is the license steward. Except as provided in Section
329
+ 10.3, no one other than the license steward has the right to modify or
330
+ publish new versions of this License. Each version will be given a
331
+ distinguishing version number.
332
+
333
+ 10.2. Effect of New Versions
334
+
335
+ You may distribute the Covered Software under the terms of the version
336
+ of the License under which You originally received the Covered Software,
337
+ or under the terms of any subsequent version published by the license
338
+ steward.
339
+
340
+ 10.3. Modified Versions
341
+
342
+ If you create software not governed by this License, and you want to
343
+ create a new license for such software, you may create and use a
344
+ modified version of this License if you rename the license and remove
345
+ any references to the name of the license steward (except to note that
346
+ such modified license differs from this License).
347
+
348
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
349
+ Licenses
350
+
351
+ If You choose to distribute Source Code Form that is Incompatible With
352
+ Secondary Licenses under the terms of this version of the License, the
353
+ notice described in Exhibit B of this License must be attached.
354
+
355
+ Exhibit A - Source Code Form License Notice
356
+ -------------------------------------------
357
+
358
+ This Source Code Form is subject to the terms of the Mozilla Public
359
+ License, v. 2.0. If a copy of the MPL was not distributed with this
360
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
361
+
362
+ If it is not possible or desirable to put the notice in a particular
363
+ file, then You may include the notice in a location (such as a LICENSE
364
+ file in a relevant directory) where a recipient would be likely to look
365
+ for such a notice.
366
+
367
+ You may add additional accurate notices of copyright ownership.
368
+
369
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
370
+ ---------------------------------------------------------
371
+
372
+ This Source Code Form is "Incompatible With Secondary Licenses", as
373
+ defined by the Mozilla Public License, v. 2.0.
package/NOTICE.md ADDED
@@ -0,0 +1,20 @@
1
+ # Licensing and third-party material
2
+
3
+ AgentPay User's original source and documentation are licensed under the Mozilla
4
+ Public License 2.0; see LICENSE. This Source Code Form is subject to the terms of
5
+ the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
6
+ this file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+
8
+ Exceptions retain their own licenses:
9
+
10
+ - `@c4roa0/agentpay-protocol`: public npm dependency, MIT; its license ships
11
+ with the installed package. This does not include private Settlement source.
12
+ - `test/fixtures/skill-zip.mjs` and `test/fixtures/random-skill/`: reference fixture
13
+ snapshot from AgentPay Agent, MIT; see `test/fixtures/REFERENCE-SKILL-LICENSE`
14
+ and its README for the source revision.
15
+ - Installed third-party packages retain the licenses shipped with those packages.
16
+ `@c4roa0/agentpay-wallet` is a separate MIT-licensed package; its license ships
17
+ with the installed dependency and it is not relicensed by User.
18
+
19
+ For license interpretation, consult the unmodified license text and Mozilla's FAQ:
20
+ https://www.mozilla.org/en-US/MPL/2.0/FAQ/.
package/README.md CHANGED
@@ -1,3 +1,86 @@
1
- # Temporary Holding Version
1
+ # AgentPay User
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ User connects your AI Agent's Skills to paid services. A separate local Wallet
4
+ holds the Session Key; your Safe's bounded permission controls spending. After
5
+ setup, eligible purchases do not require an owner-wallet signature every time.
6
+
7
+ User is the Agent/Skill runtime, not a Provider server or a general-purpose wallet.
8
+ It retains request identity and local results so interruptions can be recovered
9
+ without silently creating a replacement purchase.
10
+
11
+ ## Install with npm
12
+
13
+ On Linux, prepare Node.js 22.22.3 or newer, npm and your AgentPay Market address.
14
+ Install User with the command below. It automatically installs the matching Wallet
15
+ and Protocol packages; you do not need to download two repositories:
16
+
17
+ ```sh
18
+ npm install --global @c4roa0/agentpay-user@0.3.1
19
+ agentpay install --market https://YOUR_MARKET_ORIGIN
20
+ ```
21
+
22
+ Replace the Market URL with your platform's address. Use a user-owned Node/npm
23
+ installation with Node and npm's executable directory on PATH. No Wallet checkout,
24
+ Corepack, pnpm or TypeScript build is needed.
25
+
26
+ Install verifies dependencies, downloads public settings and continues setup.
27
+ You choose the Safe and spending limits, then approve with its owner wallet.
28
+ The optional official payment test asks before spending. Never enter an owner
29
+ private key into AgentPay. See [installation and first use](doc/runbooks/user-onboarding.md).
30
+
31
+ Program files and private state are separate. Keys, Policies, Orders and cache
32
+ normally live in `~/.local/share/agentpay/user`; an existing custom data directory
33
+ is retained. Installation checkpoints use `~/.local/state/agentpay/user` (or
34
+ `$XDG_STATE_HOME/agentpay/user`). Upgrading program files does not erase either.
35
+
36
+ ## After setup
37
+
38
+ ```sh
39
+ agentpay status
40
+ agentpay wallet unlock
41
+ agentpay orders list
42
+ agentpay market connect
43
+ ```
44
+
45
+ Linux background services use your systemd user session. Wallet starts locked after
46
+ a restart. `agentpay service help` explains startup, stop and logs; `agentpay help` lists
47
+ all groups. Global npm installations use `agentpay update` to review and install a
48
+ new User version with its matching Wallet and official test Skill. Source checkouts
49
+ update their files, run `npm ci`, then `agentpay repair`. [Commands](doc/runbooks/commands.md) · [Updates](doc/runbooks/local-update.md)
50
+ · [Backup and restore](doc/runbooks/wallet-identity.md).
51
+
52
+ ## Develop or integrate
53
+
54
+ For contributors or source ZIP users:
55
+
56
+ ```sh
57
+ git clone https://github.com/c4rO-0/agentpay-user.git user
58
+ cd user
59
+ npm ci
60
+ npm link
61
+ agentpay help
62
+ ```
63
+
64
+ `npm link` exposes the command from your checkout. Without linking, `./run` (or
65
+ `sh run`) provides the same commands; `AGENTPAY_NODE` can select your Node executable.
66
+
67
+ - [Developer guide](doc/develope.md): independent checkout, focused tests and evidence limits.
68
+ - [Architecture](doc/architecture.md): source map and recovery/authorization boundaries.
69
+ - [Skill author guide](doc/runbooks/runtime-skill-client.md): call the shared Runtime client.
70
+ - [Contribution guide](CONTRIBUTING.md), [documentation catalog](doc/README.md),
71
+ [progress](progress.md) and [TODO](doc/TODO.md).
72
+
73
+ ## Safety and scope
74
+
75
+ Source includes external-owner browser approval and a guarded Anvil test signer.
76
+ Network identity never automatically selects the test signer. The recorded private
77
+ single-owner journey is not real-network, multisig or production acceptance.
78
+ Current release gates are in TODO. macOS startup remains unverified.
79
+
80
+ Keep keys, passwords, caller tokens and private Order data out of repositories and
81
+ support messages. For a suspected compromise, follow
82
+ [emergency payment stop](doc/runbooks/emergency-payment-stop.md) from a trusted device.
83
+ Locking Wallet or disconnecting Market does not revoke on-chain spending permission.
84
+
85
+ Original User code is **MPL 2.0**. See [LICENSE](LICENSE), [third-party notices](NOTICE.md)
86
+ and [security reporting](SECURITY.md). Wallet and Protocol retain their own licenses.
package/SECURITY.md ADDED
@@ -0,0 +1,16 @@
1
+ # Security reports
2
+
3
+ Report suspected vulnerabilities privately to **agentpay@mail.c4r.fun**. Include
4
+ User/Wallet versions, the affected interface and reproducible steps using disposable
5
+ data. Do not post keys, passwords, tokens, signed payments or private Order inputs
6
+ in public issues. Do not send them to support either.
7
+
8
+ User Runtime coordinates purchases; Wallet owns the Session Key and Safe enforces
9
+ on-chain permission. A local caller token is not a sandbox against code running
10
+ as the same operating-system user. Private Anvil tests do not establish real-funds
11
+ safety or a completed security audit.
12
+
13
+ If a key or computer may be compromised, use a trusted device and your Safe owner
14
+ wallet to stop payment permission. See [emergency instructions](doc/runbooks/emergency-payment-stop.md).
15
+ Deleting User, disconnecting Market or stopping a process does not revoke on-chain
16
+ authorization.