@dopemarkets/agent 0.1.0 → 0.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dopemarkets/agent",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "DOPE Agent Mode CLI. Run agentic Stack trades on DOPE from the terminal.",
5
5
  "bin": {
6
6
  "dope": "bin/dope.js"
@@ -10,7 +10,8 @@
10
10
  "scripts": {
11
11
  "build": "tsc -p tsconfig.json",
12
12
  "clean": "rm -rf dist",
13
- "dev": "node --import tsx src/index.ts"
13
+ "dev": "node --import tsx src/index.ts",
14
+ "postinstall": "node scripts/postinstall.js"
14
15
  },
15
16
  "dependencies": {
16
17
  "@dopemarkets/agent-client": "0.1.0"
@@ -26,6 +27,7 @@
26
27
  "files": [
27
28
  "dist",
28
29
  "bin",
30
+ "scripts",
29
31
  "README.md"
30
32
  ],
31
33
  "publishConfig": {
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ // Banner printed once after `npm install -g @dopemarkets/agent`.
3
+ //
4
+ // Goal: replace npm's opaque "changed N packages in Ns" with an
5
+ // unambiguous "the install succeeded — here's what to do next" line.
6
+ // Non-developers won't otherwise know the install worked.
7
+ //
8
+ // Rules:
9
+ // - Only print on global installs (`npm install -g @dopemarkets/agent`).
10
+ // Skipping local installs keeps this quiet when the package is pulled
11
+ // in as a transitive dep, which is the npm convention.
12
+ // - Print to stderr so it sits alongside npm's own install chatter.
13
+ // - Never throw. Postinstall failures bubble up as install failures,
14
+ // and a banner is not worth breaking somebody's machine over.
15
+
16
+ 'use strict';
17
+
18
+ try {
19
+ const isGlobal = process.env.npm_config_global === 'true';
20
+ if (!isGlobal) return;
21
+
22
+ const lines = [
23
+ '',
24
+ 'DOPE Agent Mode installed.',
25
+ '',
26
+ ' Next: dope login',
27
+ ' Docs: https://dope.markets/agent',
28
+ '',
29
+ 'Run `dope --help` to see every command.',
30
+ '',
31
+ ];
32
+ process.stderr.write(lines.join('\n'));
33
+ } catch {
34
+ // Intentionally swallow. A banner is never worth a failed install.
35
+ }