@hugomrdias/fil 0.0.0-stage → 0.0.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 (90) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +136 -2
  3. package/bin/fil.js +7 -0
  4. package/dist/chunks/_esm-BBXTTBLC.js +9 -0
  5. package/dist/chunks/_esm-BBXTTBLC.js.map +7 -0
  6. package/dist/chunks/ccip-TGFMQFIR.js +3 -0
  7. package/dist/chunks/ccip-TGFMQFIR.js.map +7 -0
  8. package/dist/chunks/chunk-2KPBBDBJ.js +3 -0
  9. package/dist/chunks/chunk-2KPBBDBJ.js.map +7 -0
  10. package/dist/chunks/chunk-35V77X3C.js +12 -0
  11. package/dist/chunks/chunk-35V77X3C.js.map +7 -0
  12. package/dist/chunks/chunk-46FBFEBX.js +3 -0
  13. package/dist/chunks/chunk-46FBFEBX.js.map +7 -0
  14. package/dist/chunks/chunk-4BBXH7CB.js +6 -0
  15. package/dist/chunks/chunk-4BBXH7CB.js.map +7 -0
  16. package/dist/chunks/chunk-4DUACCJB.js +186 -0
  17. package/dist/chunks/chunk-4DUACCJB.js.map +7 -0
  18. package/dist/chunks/chunk-5EYSPKTK.js +3 -0
  19. package/dist/chunks/chunk-5EYSPKTK.js.map +7 -0
  20. package/dist/chunks/chunk-7MEK5RQ7.js +11 -0
  21. package/dist/chunks/chunk-7MEK5RQ7.js.map +7 -0
  22. package/dist/chunks/chunk-7WN6TT5U.js +4 -0
  23. package/dist/chunks/chunk-7WN6TT5U.js.map +7 -0
  24. package/dist/chunks/chunk-CU3SGKNA.js +3 -0
  25. package/dist/chunks/chunk-CU3SGKNA.js.map +7 -0
  26. package/dist/chunks/chunk-EDF5XCIN.js +4 -0
  27. package/dist/chunks/chunk-EDF5XCIN.js.map +7 -0
  28. package/dist/chunks/chunk-GVAFHRPJ.js +124 -0
  29. package/dist/chunks/chunk-GVAFHRPJ.js.map +7 -0
  30. package/dist/chunks/chunk-IJ2NNDTJ.js +3 -0
  31. package/dist/chunks/chunk-IJ2NNDTJ.js.map +7 -0
  32. package/dist/chunks/chunk-ISML2NA2.js +3 -0
  33. package/dist/chunks/chunk-ISML2NA2.js.map +7 -0
  34. package/dist/chunks/chunk-KAQPCD23.js +4 -0
  35. package/dist/chunks/chunk-KAQPCD23.js.map +7 -0
  36. package/dist/chunks/chunk-LOTWVNDB.js +3 -0
  37. package/dist/chunks/chunk-LOTWVNDB.js.map +7 -0
  38. package/dist/chunks/chunk-NPYAGWD6.js +4 -0
  39. package/dist/chunks/chunk-NPYAGWD6.js.map +7 -0
  40. package/dist/chunks/chunk-QYPR6473.js +3 -0
  41. package/dist/chunks/chunk-QYPR6473.js.map +7 -0
  42. package/dist/chunks/chunk-RK6JJQZL.js +41 -0
  43. package/dist/chunks/chunk-RK6JJQZL.js.map +7 -0
  44. package/dist/chunks/chunk-UJQDDRQD.js +59 -0
  45. package/dist/chunks/chunk-UJQDDRQD.js.map +7 -0
  46. package/dist/chunks/chunk-UVXTIEPU.js +4 -0
  47. package/dist/chunks/chunk-UVXTIEPU.js.map +7 -0
  48. package/dist/chunks/chunk-VTR7BON5.js +4 -0
  49. package/dist/chunks/chunk-VTR7BON5.js.map +7 -0
  50. package/dist/chunks/chunk-XQRC2SUG.js +4 -0
  51. package/dist/chunks/chunk-XQRC2SUG.js.map +7 -0
  52. package/dist/chunks/chunk-YIAP3JO3.js +3 -0
  53. package/dist/chunks/chunk-YIAP3JO3.js.map +7 -0
  54. package/dist/chunks/chunk-ZD6MKB4J.js +5 -0
  55. package/dist/chunks/chunk-ZD6MKB4J.js.map +7 -0
  56. package/dist/chunks/delete-XVYLEMHB.js +3 -0
  57. package/dist/chunks/delete-XVYLEMHB.js.map +7 -0
  58. package/dist/chunks/doctor-2W65SQJS.js +3 -0
  59. package/dist/chunks/doctor-2W65SQJS.js.map +7 -0
  60. package/dist/chunks/get-ZP66WVWT.js +3 -0
  61. package/dist/chunks/get-ZP66WVWT.js.map +7 -0
  62. package/dist/chunks/inspect-HV2SQPTB.js +3 -0
  63. package/dist/chunks/inspect-HV2SQPTB.js.map +7 -0
  64. package/dist/chunks/inspect-PQCV7LQT.js +3 -0
  65. package/dist/chunks/inspect-PQCV7LQT.js.map +7 -0
  66. package/dist/chunks/login-GQ4PM7SA.js +4 -0
  67. package/dist/chunks/login-GQ4PM7SA.js.map +7 -0
  68. package/dist/chunks/logout-7N23QWWM.js +3 -0
  69. package/dist/chunks/logout-7N23QWWM.js.map +7 -0
  70. package/dist/chunks/ls-7XYH5VPL.js +3 -0
  71. package/dist/chunks/ls-7XYH5VPL.js.map +7 -0
  72. package/dist/chunks/ls-ARM57VNR.js +3 -0
  73. package/dist/chunks/ls-ARM57VNR.js.map +7 -0
  74. package/dist/chunks/map-error-7POTPJ7R.js +3 -0
  75. package/dist/chunks/map-error-7POTPJ7R.js.map +7 -0
  76. package/dist/chunks/put-EHRNCZHT.js +3 -0
  77. package/dist/chunks/put-EHRNCZHT.js.map +7 -0
  78. package/dist/chunks/resume-RLZB7L3C.js +3 -0
  79. package/dist/chunks/resume-RLZB7L3C.js.map +7 -0
  80. package/dist/chunks/secp256k1-2OHXXNYZ.js +3 -0
  81. package/dist/chunks/secp256k1-2OHXXNYZ.js.map +7 -0
  82. package/dist/chunks/skills.run-IDY347MW.js +5 -0
  83. package/dist/chunks/skills.run-IDY347MW.js.map +7 -0
  84. package/dist/chunks/status-D4CXVYRA.js +3 -0
  85. package/dist/chunks/status-D4CXVYRA.js.map +7 -0
  86. package/dist/main.js +3 -0
  87. package/dist/main.js.map +7 -0
  88. package/dist/tsconfig.tsbuildinfo +1 -0
  89. package/package.json +52 -3
  90. package/skills/fil/SKILL.md +28 -0
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@hugomrdias/fil",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.0",
4
+ "description": "Command-line interface for Filecoin storage",
5
+ "license": "MIT",
6
+ "author": "Hugo Dias <hugomrdias@gmail.com>",
7
+ "homepage": "https://github.com/hugomrdias/fil/tree/main/packages/fil-cli#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/hugomrdias/fil.git",
11
+ "directory": "packages/fil-cli"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/hugomrdias/fil/issues"
15
+ },
16
+ "type": "module",
17
+ "bin": {
18
+ "fil": "./bin/fil.js"
19
+ },
20
+ "files": [
21
+ "bin",
22
+ "dist",
23
+ "skills",
24
+ "README.md"
25
+ ],
26
+ "devDependencies": {
27
+ "@filoz/synapse-core": "^0.10.0",
28
+ "@ipld/car": "^5.4.7",
29
+ "@types/node": "26.5.1",
30
+ "clipact": "0.0.0",
31
+ "env-paths": "^4.0.0",
32
+ "esbuild": "0.28.2",
33
+ "ipfs-unixfs-exporter": "^16.2.3",
34
+ "ipfs-unixfs-importer": "^16.1.5",
35
+ "iso-conf": "^0.4.2",
36
+ "multiformats": "^14.0.5",
37
+ "typescript": "7.0.2",
38
+ "viem": "^2.56.9",
39
+ "zod": "4.6.5"
40
+ },
41
+ "engines": {
42
+ "node": ">=24"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "scripts": {
48
+ "clean": "rm -rf dist skills",
49
+ "build": "node scripts/build.ts",
50
+ "typecheck": "tsc -p tsconfig.json",
51
+ "test": "node --test 'test/**/*.test.ts'",
52
+ "lint": "biome check .",
53
+ "check": "pnpm typecheck && pnpm test && pnpm lint"
54
+ }
6
55
  }
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: fil
3
+ description: Store files and folders on Filecoin with the fil CLI and return retrieval links; download, list, delete, and resume interrupted uploads. Use when the user asks to publish, store, share, or retrieve content on Filecoin or FOC.
4
+ ---
5
+
6
+ # fil
7
+
8
+ `fil` stores a file (exact bytes) or a folder (a UnixFS CAR served over IPFS) on Filecoin and returns a link. Every command writes one JSON object to stdout when run by an agent; it has `data` on success or `error` on failure. Branch on `error.code`, never on stderr text.
9
+
10
+ ## Discover before you call
11
+
12
+ - `fil schema --list` lists every command with its side effects.
13
+ - `fil schema <command>` gives the input JSON Schema, the JSON Schema of `data`, and what each error code means, for the installed version. Prefer it over guessing flags.
14
+
15
+ ## Workflow
16
+
17
+ 1. `fil status` shows whether a session key is active and the account is funded.
18
+ 2. `fil put <path> --dry-run` shows the size, provider, cost, and any missing authorization without storing anything.
19
+ 3. `fil put <path>` (or `fil publish <path>`) stores it. Return `data.urls.browser` to the user exactly as given, with `data.resource.ref`. `data.urls.piece` serves the exact stored bytes. A new link can return 404 until the indexer behind it has the piece; `fil inspect <ref> --check` reports when it answers.
20
+ 4. `fil get <ref>` downloads and verifies content; `fil ls` and `fil inspect <ref>` find what was stored.
21
+
22
+ ## Rules
23
+
24
+ - Never ask for or pass a private key. Logging in needs the user: `auth_required` or `login_pending` means relay the `by: "user"` step (the fil-app approval link) and stop. After the user approves, run `fil login` once to confirm.
25
+ - `insufficient_funds` and `session_expired` also need the user; relay their `next` steps.
26
+ - `fil delete <ref>` needs `--yes`. On `confirmation_required`, relay the reason and rerun with `--yes` only after the user agrees.
27
+ - Never repeat a failed or interrupted `put` or `delete`: that starts a new paid operation. Run the `fil operations resume <id>` command from `next` instead; errors with a fil code also carry the ID in `error.details.operationId`. Find lost operation IDs with `fil operations ls --incomplete`.
28
+ - Retry only when `error.retryable` is `true`, after `retryAfterSeconds` when present.