@singularity-layer/cli 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -2
- package/dist/cli.js +83 -14
- package/dist/index.js +1 -1
- package/dist/processors.d.ts +22 -1
- package/dist/version.d.ts +1 -1
- package/package.json +75 -75
package/README.md
CHANGED
|
@@ -79,8 +79,55 @@ singularity processors env list # which are declared, which are
|
|
|
79
79
|
singularity processors env unset OPENAI_API_KEY
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Values are write-only
|
|
83
|
-
|
|
82
|
+
Values are write-only *to you*: we never hand one back through the API.
|
|
83
|
+
|
|
84
|
+
**Two modes, chosen per secret.** The default is the strong one:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
"secrets": [
|
|
88
|
+
{ "name": "OPENAI_API_KEY", "hosts": ["api.openai.com"],
|
|
89
|
+
"inject": { "header": "Authorization", "format": "Bearer {value}" } },
|
|
90
|
+
{ "name": "SIGNING_KEY", "mode": "env" }
|
|
91
|
+
]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`inject` (the default) — **the value never enters your isolate.** You call `fetch()` with no
|
|
95
|
+
credential and the egress gateway adds the header server-side, for the hosts you declared and nowhere
|
|
96
|
+
else. Code that never holds a key cannot leak the key.
|
|
97
|
+
|
|
98
|
+
`mode: "env"` — **your code holds the value**, via `await SGL.secrets.get('SIGNING_KEY')`. This is a
|
|
99
|
+
real downgrade and it is opt-in for exactly that reason: once your code has the value it can print it
|
|
100
|
+
into your logs, or send it to any host in your egress allowlist, and we cannot stop either. Use it
|
|
101
|
+
only for credentials that genuinely cannot be an outbound header — a key you sign with locally, or a
|
|
102
|
+
value an SDK insists on reading itself. The alternative most people reach for otherwise is
|
|
103
|
+
hard-coding the secret in their source, which is worse in every way.
|
|
104
|
+
|
|
105
|
+
`singularity processors env list` shows which of yours is which.
|
|
106
|
+
|
|
107
|
+
## Processor state
|
|
108
|
+
|
|
109
|
+
A processor is a fresh isolate every run, so anything you want to keep has to go somewhere:
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
// Key/value — a cursor, a cache, a dedupe set. Values are opaque strings, byte-exact.
|
|
113
|
+
await SGL.kv.put('cursor', '2026-08-12');
|
|
114
|
+
const cursor = await SGL.kv.get('cursor');
|
|
115
|
+
|
|
116
|
+
// Compare-and-swap, for a counter or a lock. Concurrent runs are the normal case.
|
|
117
|
+
const cur = await SGL.kv.getWithVersion('count');
|
|
118
|
+
await SGL.kv.put('count', String(Number(cur.value) + 1), { ifVersion: cur.version });
|
|
119
|
+
|
|
120
|
+
// Objects — a generated PDF, an image, a dataset.
|
|
121
|
+
await SGL.files.put('reports/august.pdf', bytes, { contentType: 'application/pdf' });
|
|
122
|
+
const { url } = await SGL.files.downloadUrl('reports/august.pdf', { ttlSeconds: 3600 });
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`downloadUrl` gives you a signed, expiring link a buyer can fetch with **no credential**. It is
|
|
126
|
+
always served as an attachment with a forced `application/octet-stream` type — your declared type is
|
|
127
|
+
never echoed — so a stored HTML or SVG file cannot execute. Treat it as a bearer link: anyone who
|
|
128
|
+
gets it can download until it expires.
|
|
129
|
+
|
|
130
|
+
None of this needs an `egress.allow` entry. It is not the network.
|
|
84
131
|
|
|
85
132
|
### Turning it off without losing it
|
|
86
133
|
|
package/dist/cli.js
CHANGED
|
@@ -383,7 +383,33 @@ var HELP = `singularity processors \u2014 deploy loops we host and run
|
|
|
383
383
|
--slug <slug> when not run from a processor directory
|
|
384
384
|
--json machine-readable output, for scripts and agents
|
|
385
385
|
--bundle bundle with esbuild: imports and npm packages
|
|
386
|
-
--entry <file> bundle entry (default: the manifest's $code)
|
|
386
|
+
--entry <file> bundle entry (default: the manifest's $code)
|
|
387
|
+
|
|
388
|
+
Getting paid. Buyers pay YOU directly \u2014 we never hold the money and take no cut. By default that
|
|
389
|
+
is USDC on Solana at your signing wallet. To be paid on more than one chain, add a "payout" block
|
|
390
|
+
to processor.json:
|
|
391
|
+
|
|
392
|
+
"payout": {
|
|
393
|
+
"solana": "<base58 wallet>", USDC
|
|
394
|
+
"base": "0x\u2026", USDC
|
|
395
|
+
"robinhood": "0x\u2026" USDG on Robinhood Chain
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
One price_usd covers all three (every asset is 6-decimal), and buyers pick a chain from the 402.
|
|
399
|
+
Name only the chains you want: a chain you leave out is never offered. Check each address twice \u2014
|
|
400
|
+
a payment cannot be reversed.`;
|
|
401
|
+
var PAYOUT_CHAINS = ["solana", "base", "robinhood"];
|
|
402
|
+
function checkPayoutAddress(chain, value) {
|
|
403
|
+
if (typeof value !== "string" || !value.trim()) return "must be a non-empty string";
|
|
404
|
+
const addr = value.trim();
|
|
405
|
+
if (chain === "solana") {
|
|
406
|
+
if (!/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(addr)) return "must be a base58 Solana address";
|
|
407
|
+
return null;
|
|
408
|
+
}
|
|
409
|
+
if (!/^0x[0-9a-fA-F]{40}$/.test(addr)) return "must be a 0x-prefixed 20-byte hex address";
|
|
410
|
+
if (/^0x0{40}$/.test(addr)) return "the zero address cannot receive payment";
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
387
413
|
var STARTER_MANIFEST = (slug) => ({
|
|
388
414
|
$code: "processor.js",
|
|
389
415
|
manifest_version: 1,
|
|
@@ -440,11 +466,31 @@ var readConfig = () => {
|
|
|
440
466
|
function loadManifest(flags) {
|
|
441
467
|
const p = resolve(String(flags.manifest || "processor.json"));
|
|
442
468
|
if (!existsSync3(p)) die(`no manifest at ${p} \u2014 run \`singularity processors init\` first`);
|
|
469
|
+
let m;
|
|
443
470
|
try {
|
|
444
|
-
|
|
471
|
+
m = JSON.parse(readFileSync3(p, "utf8"));
|
|
445
472
|
} catch {
|
|
446
473
|
return die(`${p} is not valid JSON`);
|
|
447
474
|
}
|
|
475
|
+
checkPayout(m);
|
|
476
|
+
return m;
|
|
477
|
+
}
|
|
478
|
+
function checkPayout(m) {
|
|
479
|
+
if (m.payout === void 0) return;
|
|
480
|
+
if (typeof m.payout !== "object" || m.payout === null || Array.isArray(m.payout)) {
|
|
481
|
+
die('payout must be an object keyed by chain, e.g. { "solana": "\u2026", "base": "0x\u2026" }');
|
|
482
|
+
}
|
|
483
|
+
const entries = Object.entries(m.payout);
|
|
484
|
+
if (entries.length === 0) {
|
|
485
|
+
die("payout names no chain \u2014 remove it entirely to be paid in USDC on Solana at your signing wallet");
|
|
486
|
+
}
|
|
487
|
+
for (const [chain, value] of entries) {
|
|
488
|
+
if (!PAYOUT_CHAINS.includes(chain)) {
|
|
489
|
+
die(`payout.${chain}: unknown chain \u2014 supported: ${PAYOUT_CHAINS.join(", ")}`);
|
|
490
|
+
}
|
|
491
|
+
const problem = checkPayoutAddress(chain, value);
|
|
492
|
+
if (problem) die(`payout.${chain}: ${problem}`);
|
|
493
|
+
}
|
|
448
494
|
}
|
|
449
495
|
var clean = (m) => Object.fromEntries(Object.entries(m).filter(([k]) => !k.startsWith("$")));
|
|
450
496
|
function resolveSlug(flags) {
|
|
@@ -460,6 +506,15 @@ var emit = (flags, value) => {
|
|
|
460
506
|
console.log(JSON.stringify(value, null, 2));
|
|
461
507
|
return true;
|
|
462
508
|
};
|
|
509
|
+
function warnEnvSecrets(manifest) {
|
|
510
|
+
const envNames = (manifest.secrets ?? []).filter((s) => s.mode === "env").map((s) => s.name);
|
|
511
|
+
if (!envNames.length) return;
|
|
512
|
+
ok("");
|
|
513
|
+
ok(`note: ${envNames.join(", ")} ${envNames.length === 1 ? "is" : "are"} declared mode: "env".`);
|
|
514
|
+
ok(" Your code can read the value. That means it can also print it into your logs, or send");
|
|
515
|
+
ok(' it to any host in your egress allowlist \u2014 we cannot stop either. Use "inject" for');
|
|
516
|
+
ok(" anything that is only ever an outbound header.");
|
|
517
|
+
}
|
|
463
518
|
async function resolveSource(manifest, flags) {
|
|
464
519
|
const entryPath = resolve(String(flags.entry || manifest.$entry || manifest.$code || "processor.js"));
|
|
465
520
|
if (!existsSync3(entryPath)) die(`no code at ${entryPath}`);
|
|
@@ -634,6 +689,7 @@ async function run(words, flags) {
|
|
|
634
689
|
ok();
|
|
635
690
|
ok(`try it: singularity processors run '{"hello":"world"}'`);
|
|
636
691
|
ok("go live: singularity processors publish");
|
|
692
|
+
warnEnvSecrets(manifest);
|
|
637
693
|
break;
|
|
638
694
|
}
|
|
639
695
|
case "update": {
|
|
@@ -650,6 +706,7 @@ async function run(words, flags) {
|
|
|
650
706
|
if (emit(flags, res)) break;
|
|
651
707
|
ok(`updated ${slug} (config_rev ${res.config_rev})`);
|
|
652
708
|
if (res.note) ok(res.note);
|
|
709
|
+
warnEnvSecrets(manifest);
|
|
653
710
|
break;
|
|
654
711
|
}
|
|
655
712
|
case "run":
|
|
@@ -732,7 +789,9 @@ async function run(words, flags) {
|
|
|
732
789
|
);
|
|
733
790
|
if (emit(flags, res)) break;
|
|
734
791
|
ok(`secrets set: ${res.secrets.join(", ") || "(none)"}`);
|
|
735
|
-
ok("values are write-only \u2014 never
|
|
792
|
+
ok("values are write-only here \u2014 we never return them to you");
|
|
793
|
+
if (existsSync3("processor.json")) warnEnvSecrets(loadManifest(flags));
|
|
794
|
+
else ok("run `singularity processors env list` to see which are injected and which your code reads");
|
|
736
795
|
break;
|
|
737
796
|
}
|
|
738
797
|
case "env": {
|
|
@@ -740,24 +799,26 @@ async function run(words, flags) {
|
|
|
740
799
|
const slug = requireSlug(flags);
|
|
741
800
|
const action = words[1] || "list";
|
|
742
801
|
if (action === "list") {
|
|
743
|
-
const d = await api(
|
|
744
|
-
BASE,
|
|
745
|
-
"GET",
|
|
746
|
-
`/processors/${slug}`,
|
|
747
|
-
{ kp }
|
|
748
|
-
);
|
|
802
|
+
const d = await api(BASE, "GET", `/processors/${slug}`, { kp });
|
|
749
803
|
const declared = d.manifest?.secrets ?? [];
|
|
750
804
|
const set = new Set(d.secret_keys ?? []);
|
|
751
|
-
|
|
805
|
+
const modes = d.secret_modes ?? {};
|
|
806
|
+
if (emit(flags, { declared: declared.map((s) => s.name), set: [...set], modes })) break;
|
|
752
807
|
if (!declared.length) {
|
|
753
808
|
ok("no secrets declared \u2014 add them to manifest.secrets, then set values");
|
|
754
809
|
break;
|
|
755
810
|
}
|
|
756
811
|
for (const s of declared) {
|
|
757
|
-
|
|
812
|
+
const mode = modes[s.name] ?? s.mode ?? "inject";
|
|
813
|
+
const where = mode === "env" ? "readable by your code" : `injected -> ${(s.hosts ?? []).join(", ") || s.host || "(no host)"}`;
|
|
814
|
+
ok(`${set.has(s.name) ? "set " : "unset "} ${s.name.padEnd(24)} ${mode.padEnd(7)} ${where}`);
|
|
758
815
|
}
|
|
759
816
|
ok("");
|
|
760
|
-
ok("
|
|
817
|
+
ok("inject the value never enters your isolate; the gateway adds the header for you");
|
|
818
|
+
if (Object.values(modes).includes("env")) {
|
|
819
|
+
ok("env YOUR CODE HOLDS THIS VALUE. Printing it puts it in your logs, and we");
|
|
820
|
+
ok(" cannot stop it being sent anywhere your egress allowlist permits.");
|
|
821
|
+
}
|
|
761
822
|
break;
|
|
762
823
|
}
|
|
763
824
|
if (action === "unset") {
|
|
@@ -877,7 +938,15 @@ async function run(words, flags) {
|
|
|
877
938
|
const slug = words[1] || requireSlug(flags);
|
|
878
939
|
const res = await api(BASE, "GET", `/processors/${slug}/earnings`, { kp });
|
|
879
940
|
if (emit(flags, res)) break;
|
|
880
|
-
|
|
941
|
+
const byChain = res.sales.paid_to_by_chain;
|
|
942
|
+
if (byChain && Object.keys(byChain).length > 1) {
|
|
943
|
+
ok(`Sales $${usd(res.sales.total_micro)} (${res.sales.count} paid runs)`);
|
|
944
|
+
for (const [chain, addr] of Object.entries(byChain)) {
|
|
945
|
+
ok(` ${chain.padEnd(10)} ${addr}`);
|
|
946
|
+
}
|
|
947
|
+
} else {
|
|
948
|
+
ok(`Sales $${usd(res.sales.total_micro)} (${res.sales.count} paid runs, sent to ${res.sales.paid_to})`);
|
|
949
|
+
}
|
|
881
950
|
ok(`Compute $${usd(res.runtime.spent_micro)} spent from your credit balance`);
|
|
882
951
|
if (res.runtime.held_open_micro > 0) {
|
|
883
952
|
ok(`Held $${usd(res.runtime.held_open_micro)} reserved for runs still in flight`);
|
|
@@ -986,7 +1055,7 @@ async function followLogs(base, slug, kp, limit) {
|
|
|
986
1055
|
}
|
|
987
1056
|
|
|
988
1057
|
// src/version.ts
|
|
989
|
-
var VERSION = "0.2.
|
|
1058
|
+
var VERSION = "0.2.2";
|
|
990
1059
|
|
|
991
1060
|
// src/cli.ts
|
|
992
1061
|
var COMMANDS = {
|
package/dist/index.js
CHANGED
package/dist/processors.d.ts
CHANGED
|
@@ -6,5 +6,26 @@
|
|
|
6
6
|
* reduced one — and an agent can drive it identically.
|
|
7
7
|
*/
|
|
8
8
|
import { type Flags } from './auth.js';
|
|
9
|
-
export declare const HELP = "singularity processors \u2014 deploy loops we host and run\n\n init [slug] scaffold processor.json + processor.js here\n configure interactive setup: keypair, defaults\n deploy create it (prints the invoke token ONCE)\n update push new code or manifest\n run '{\"n\":10}' invoke and print the output\n run --get '{\"n\":10}' invoke over GET (for methods: [\"GET\"] processors)\n call -i invoke interactively, prompted per input field\n schema [slug] the input/output schema buyers and agents see\n list your processors\n search [query] the public catalogue\n logs [slug] recent runs and failure rate\n logs --follow stream new runs as they happen\n revenue sales and compute spend across everything you own\n earnings [slug] the same, for one processor\n env list | unset KEY which secrets are set; clear one\n secrets KEY=value ... set secret values (KEY= also clears)\n pause | resume stop or restart traffic, keeping the slug\n publish | unpublish list or unlist publicly (instant, no review)\n rotate new invoke token, the old one stops working\n delete --yes soft delete (the slug is never reusable)\n\n --keypair <path> defaults to ~/.config/solana/id.json\n --slug <slug> when not run from a processor directory\n --json machine-readable output, for scripts and agents\n --bundle bundle with esbuild: imports and npm packages\n --entry <file> bundle entry (default: the manifest's $code)";
|
|
9
|
+
export declare const HELP = "singularity processors \u2014 deploy loops we host and run\n\n init [slug] scaffold processor.json + processor.js here\n configure interactive setup: keypair, defaults\n deploy create it (prints the invoke token ONCE)\n update push new code or manifest\n run '{\"n\":10}' invoke and print the output\n run --get '{\"n\":10}' invoke over GET (for methods: [\"GET\"] processors)\n call -i invoke interactively, prompted per input field\n schema [slug] the input/output schema buyers and agents see\n list your processors\n search [query] the public catalogue\n logs [slug] recent runs and failure rate\n logs --follow stream new runs as they happen\n revenue sales and compute spend across everything you own\n earnings [slug] the same, for one processor\n env list | unset KEY which secrets are set; clear one\n secrets KEY=value ... set secret values (KEY= also clears)\n pause | resume stop or restart traffic, keeping the slug\n publish | unpublish list or unlist publicly (instant, no review)\n rotate new invoke token, the old one stops working\n delete --yes soft delete (the slug is never reusable)\n\n --keypair <path> defaults to ~/.config/solana/id.json\n --slug <slug> when not run from a processor directory\n --json machine-readable output, for scripts and agents\n --bundle bundle with esbuild: imports and npm packages\n --entry <file> bundle entry (default: the manifest's $code)\n\nGetting paid. Buyers pay YOU directly \u2014 we never hold the money and take no cut. By default that\nis USDC on Solana at your signing wallet. To be paid on more than one chain, add a \"payout\" block\nto processor.json:\n\n \"payout\": {\n \"solana\": \"<base58 wallet>\", USDC\n \"base\": \"0x\u2026\", USDC\n \"robinhood\": \"0x\u2026\" USDG on Robinhood Chain\n }\n\nOne price_usd covers all three (every asset is 6-decimal), and buyers pick a chain from the 402.\nName only the chains you want: a chain you leave out is never offered. Check each address twice \u2014\na payment cannot be reversed.";
|
|
10
|
+
/**
|
|
11
|
+
* The chains a buyer can pay on. USDC on Solana and Base, USDG on Robinhood Chain — all three are
|
|
12
|
+
* 6-decimal stablecoins, so ONE `price_usd` is the price everywhere with no conversion.
|
|
13
|
+
*/
|
|
14
|
+
export type PayoutChain = 'solana' | 'base' | 'robinhood';
|
|
15
|
+
/**
|
|
16
|
+
* Check a payout address BEFORE it is deployed.
|
|
17
|
+
*
|
|
18
|
+
* SHAPE ONLY, and the limit is deliberate. The server validates these too, including the EIP-55
|
|
19
|
+
* checksum, and its check is the one that counts. This one exists because the CLI is where a human
|
|
20
|
+
* pastes an address, and catching "that is not a Solana address" without a round trip is worth a few
|
|
21
|
+
* lines. One wrong character sends every sale for the life of the processor somewhere nobody controls.
|
|
22
|
+
*
|
|
23
|
+
* EIP-55 IS NOT VERIFIED HERE, on purpose: it needs keccak256, and adding a hash implementation — or a
|
|
24
|
+
* dependency — to a CLI that people hand a Solana keypair to costs more than it saves. Deploy rejects a
|
|
25
|
+
* bad checksum and names the address it thinks you meant.
|
|
26
|
+
*
|
|
27
|
+
* NOTHING IS CASE-FOLDED. base58 is case-sensitive, so a lowercased Solana address is a DIFFERENT
|
|
28
|
+
* account that still looks valid; and an EVM address's case IS its checksum.
|
|
29
|
+
*/
|
|
30
|
+
export declare function checkPayoutAddress(chain: PayoutChain, value: unknown): string | null;
|
|
10
31
|
export declare function run(words: string[], flags: Flags): Promise<void>;
|
package/dist/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist",
|
|
19
|
-
"README.md",
|
|
20
|
-
"LICENSE"
|
|
21
|
-
],
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=20"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "node build.mjs",
|
|
27
|
-
"test": "vitest run",
|
|
28
|
-
"typecheck": "tsc --noEmit",
|
|
29
|
-
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"esbuild": "^0.25.0",
|
|
33
|
-
"tweetnacl": "^1.0.3"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@types/node": "^22.0.0",
|
|
37
|
-
"typescript": "^5.6.0",
|
|
38
|
-
"vitest": "^2.1.9"
|
|
39
|
-
},
|
|
40
|
-
"keywords": [
|
|
41
|
-
"singularity",
|
|
42
|
-
"processors",
|
|
43
|
-
"x402",
|
|
44
|
-
"serverless",
|
|
45
|
-
"agents",
|
|
46
|
-
"solana",
|
|
47
|
-
"mcp"
|
|
48
|
-
],
|
|
49
|
-
"license": "MIT",
|
|
50
|
-
"repository": {
|
|
51
|
-
"type": "git",
|
|
52
|
-
"url": "git+https://github.com/Singularity-Layer/singularity-cli.git"
|
|
53
|
-
},
|
|
54
|
-
"//": [
|
|
55
|
-
"PACKAGE NAME vs COMMAND NAME are deliberately different. The bare `singularity` name on npm",
|
|
56
|
-
"belongs to someone else, so the package is scoped \u2014 matching the rest of the family. The BIN",
|
|
57
|
-
"is still `singularity`, so users type what they expect.",
|
|
58
|
-
"",
|
|
59
|
-
"esbuild is a RUNTIME dependency, not a build-time one: the CLI bundles the publisher's processor",
|
|
60
|
-
"for them. That is what makes npm packages and multi-file TypeScript processors possible at all \u2014",
|
|
61
|
-
"bundling happens on the publisher's machine, because running `npm install` on our infrastructure",
|
|
62
|
-
"would mean executing arbitrary postinstall scripts on a box holding platform credentials.",
|
|
63
|
-
"",
|
|
64
|
-
"THIS REPO IS PUBLIC ON PURPOSE. People hand this CLI a Solana keypair, so the code that signs with",
|
|
65
|
-
"it should be readable, and npm provenance \u2014 which attests the tarball was built from a named commit",
|
|
66
|
-
"by the release workflow \u2014 is only available for public sources.",
|
|
67
|
-
"",
|
|
68
|
-
"This is the DEVELOPER CLI: one command, subcommands per product. It is deliberately NOT:",
|
|
69
|
-
" \u2022 `sgl` \u2014 the Rust node-operator daemon. Different audience and runtime, and its",
|
|
70
|
-
" releases are hash-allowlisted, so coupling would slow both.",
|
|
71
|
-
" \u2022 `sglcode` \u2014 the agentic coding CLI, a product in its own right.",
|
|
72
|
-
"The rule that stops sprawl: new capabilities become SUBCOMMANDS here, never new binaries."
|
|
73
|
-
],
|
|
74
|
-
"homepage": "https://github.com/Singularity-Layer/singularity-cli#readme",
|
|
75
|
-
"bugs": {
|
|
76
|
-
"url": "https://github.com/Singularity-Layer/singularity-cli/issues"
|
|
2
|
+
"name": "@singularity-layer/cli",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Singularity developer CLI \u2014 deploy paid endpoints (Processors) on the Singularity Cloud Network",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"singularity": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
77
15
|
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "node build.mjs",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"esbuild": "^0.25.0",
|
|
33
|
+
"tweetnacl": "^1.0.3"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^22.0.0",
|
|
37
|
+
"typescript": "^5.6.0",
|
|
38
|
+
"vitest": "^2.1.9"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"singularity",
|
|
42
|
+
"processors",
|
|
43
|
+
"x402",
|
|
44
|
+
"serverless",
|
|
45
|
+
"agents",
|
|
46
|
+
"solana",
|
|
47
|
+
"mcp"
|
|
48
|
+
],
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/Singularity-Layer/singularity-cli.git"
|
|
53
|
+
},
|
|
54
|
+
"//": [
|
|
55
|
+
"PACKAGE NAME vs COMMAND NAME are deliberately different. The bare `singularity` name on npm",
|
|
56
|
+
"belongs to someone else, so the package is scoped \u2014 matching the rest of the family. The BIN",
|
|
57
|
+
"is still `singularity`, so users type what they expect.",
|
|
58
|
+
"",
|
|
59
|
+
"esbuild is a RUNTIME dependency, not a build-time one: the CLI bundles the publisher's processor",
|
|
60
|
+
"for them. That is what makes npm packages and multi-file TypeScript processors possible at all \u2014",
|
|
61
|
+
"bundling happens on the publisher's machine, because running `npm install` on our infrastructure",
|
|
62
|
+
"would mean executing arbitrary postinstall scripts on a box holding platform credentials.",
|
|
63
|
+
"",
|
|
64
|
+
"THIS REPO IS PUBLIC ON PURPOSE. People hand this CLI a Solana keypair, so the code that signs with",
|
|
65
|
+
"it should be readable, and npm provenance \u2014 which attests the tarball was built from a named commit",
|
|
66
|
+
"by the release workflow \u2014 is only available for public sources.",
|
|
67
|
+
"",
|
|
68
|
+
"This is the DEVELOPER CLI: one command, subcommands per product. It is deliberately NOT:",
|
|
69
|
+
" \u2022 `sgl` \u2014 the Rust node-operator daemon. Different audience and runtime, and its",
|
|
70
|
+
" releases are hash-allowlisted, so coupling would slow both.",
|
|
71
|
+
" \u2022 `sglcode` \u2014 the agentic coding CLI, a product in its own right.",
|
|
72
|
+
"The rule that stops sprawl: new capabilities become SUBCOMMANDS here, never new binaries."
|
|
73
|
+
],
|
|
74
|
+
"homepage": "https://github.com/Singularity-Layer/singularity-cli#readme",
|
|
75
|
+
"bugs": {
|
|
76
|
+
"url": "https://github.com/Singularity-Layer/singularity-cli/issues"
|
|
77
|
+
}
|
|
78
78
|
}
|