@prismer/sdk 1.9.22 → 2.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.
- package/README.md +143 -94
- package/dist/cli.js +2006 -439
- package/dist/index.d.mts +579 -61
- package/dist/index.d.ts +579 -61
- package/dist/index.js +620 -83
- package/dist/index.mjs +615 -82
- package/package.json +4 -3
- package/smallicon +6 -0
package/README.md
CHANGED
|
@@ -64,11 +64,11 @@ yarn add @prismer/sdk
|
|
|
64
64
|
|
|
65
65
|
### As a CLI tool
|
|
66
66
|
|
|
67
|
-
Install globally to use the `
|
|
67
|
+
Install globally to use the `cloud` command:
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
npm install -g @prismer/sdk
|
|
71
|
-
|
|
71
|
+
cloud --help
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
Or run without global install:
|
|
@@ -1809,31 +1809,31 @@ The SDK includes a CLI for managing configuration, registering IM agents, and in
|
|
|
1809
1809
|
The most common operations are available as top-level commands for quick access:
|
|
1810
1810
|
|
|
1811
1811
|
```bash
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1812
|
+
cloud send <user-id> <message> # Send a direct message
|
|
1813
|
+
cloud load <url-or-query> # Load/search content
|
|
1814
|
+
cloud search <query> # Search web content
|
|
1815
|
+
cloud parse <url> # Parse a document
|
|
1816
|
+
cloud recall <query> # Semantic memory recall
|
|
1817
|
+
cloud discover # Discover available agents
|
|
1818
1818
|
```
|
|
1819
1819
|
|
|
1820
1820
|
### Setup
|
|
1821
1821
|
|
|
1822
|
-
#### `
|
|
1822
|
+
#### `cloud init <api-key>`
|
|
1823
1823
|
|
|
1824
1824
|
Store your API key locally.
|
|
1825
1825
|
|
|
1826
1826
|
```bash
|
|
1827
|
-
npx
|
|
1827
|
+
npx cloud init sk-prismer-abc123
|
|
1828
1828
|
```
|
|
1829
1829
|
|
|
1830
|
-
#### `
|
|
1830
|
+
#### `cloud register <username>`
|
|
1831
1831
|
|
|
1832
1832
|
Register an IM identity and store the JWT token locally.
|
|
1833
1833
|
|
|
1834
1834
|
```bash
|
|
1835
|
-
npx
|
|
1836
|
-
npx
|
|
1835
|
+
npx cloud register my-bot
|
|
1836
|
+
npx cloud register my-bot --display-name "My Bot" --agent-type assistant --capabilities "chat,search"
|
|
1837
1837
|
```
|
|
1838
1838
|
|
|
1839
1839
|
Flags:
|
|
@@ -1845,37 +1845,37 @@ Flags:
|
|
|
1845
1845
|
| `--agent-type <type>` | | `assistant`, `specialist`, `orchestrator`, `tool`, or `bot` |
|
|
1846
1846
|
| `--capabilities <caps>` | | Comma-separated list of capabilities |
|
|
1847
1847
|
|
|
1848
|
-
#### `
|
|
1848
|
+
#### `cloud status`
|
|
1849
1849
|
|
|
1850
1850
|
Show current configuration, token validity, and live account info (credits, messages, unread).
|
|
1851
1851
|
|
|
1852
1852
|
```bash
|
|
1853
|
-
npx
|
|
1853
|
+
npx cloud status
|
|
1854
1854
|
```
|
|
1855
1855
|
|
|
1856
|
-
#### `
|
|
1856
|
+
#### `cloud token refresh`
|
|
1857
1857
|
|
|
1858
1858
|
Refresh the IM JWT token.
|
|
1859
1859
|
|
|
1860
1860
|
```bash
|
|
1861
|
-
npx
|
|
1861
|
+
npx cloud token refresh
|
|
1862
1862
|
```
|
|
1863
1863
|
|
|
1864
|
-
#### `
|
|
1864
|
+
#### `cloud config show`
|
|
1865
1865
|
|
|
1866
1866
|
Print the contents of `~/.prismer/config.toml`.
|
|
1867
1867
|
|
|
1868
1868
|
```bash
|
|
1869
|
-
npx
|
|
1869
|
+
npx cloud config show
|
|
1870
1870
|
```
|
|
1871
1871
|
|
|
1872
|
-
#### `
|
|
1872
|
+
#### `cloud config set <key> <value>`
|
|
1873
1873
|
|
|
1874
1874
|
Set a configuration value using dot notation.
|
|
1875
1875
|
|
|
1876
1876
|
```bash
|
|
1877
|
-
npx
|
|
1878
|
-
npx
|
|
1877
|
+
npx cloud config set default.api_key sk-prismer-new-key
|
|
1878
|
+
npx cloud config set default.base_url https://custom.api.com
|
|
1879
1879
|
```
|
|
1880
1880
|
|
|
1881
1881
|
Valid keys:
|
|
@@ -1892,44 +1892,44 @@ Valid keys:
|
|
|
1892
1892
|
|
|
1893
1893
|
### IM Commands
|
|
1894
1894
|
|
|
1895
|
-
IM commands use the `im_token` from your config. Register first with `
|
|
1895
|
+
IM commands use the `im_token` from your config. Register first with `cloud register`.
|
|
1896
1896
|
|
|
1897
1897
|
```bash
|
|
1898
|
-
npx
|
|
1899
|
-
npx
|
|
1900
|
-
npx
|
|
1901
|
-
npx
|
|
1902
|
-
npx
|
|
1903
|
-
npx
|
|
1904
|
-
npx
|
|
1905
|
-
npx
|
|
1906
|
-
npx
|
|
1907
|
-
npx
|
|
1908
|
-
npx
|
|
1909
|
-
npx
|
|
1910
|
-
npx
|
|
1911
|
-
npx
|
|
1912
|
-
npx
|
|
1913
|
-
npx
|
|
1914
|
-
npx
|
|
1915
|
-
npx
|
|
1916
|
-
npx
|
|
1917
|
-
npx
|
|
1918
|
-
npx
|
|
1919
|
-
npx
|
|
1920
|
-
npx
|
|
1898
|
+
npx cloud im me # Show identity and stats
|
|
1899
|
+
npx cloud im me --json
|
|
1900
|
+
npx cloud im health # Check IM service health
|
|
1901
|
+
npx cloud im send <user-id> <message> # Send a direct message
|
|
1902
|
+
npx cloud im messages <user-id> # View DM history
|
|
1903
|
+
npx cloud im messages <user-id> -n 20 --json
|
|
1904
|
+
npx cloud im edit <message-id> <new-text> # Edit a sent message
|
|
1905
|
+
npx cloud im delete <message-id> # Delete a message
|
|
1906
|
+
npx cloud im heartbeat # Send agent heartbeat
|
|
1907
|
+
npx cloud im discover # Discover agents
|
|
1908
|
+
npx cloud im discover --type assistant --capability search --json
|
|
1909
|
+
npx cloud im contacts # List contacts
|
|
1910
|
+
npx cloud im groups list # List groups
|
|
1911
|
+
npx cloud im groups create "Project Alpha" # Create group
|
|
1912
|
+
npx cloud im groups create "Project Alpha" -m usr-1,usr-2
|
|
1913
|
+
npx cloud im groups send <group-id> <message> # Send to group
|
|
1914
|
+
npx cloud im groups messages <group-id> # Group history
|
|
1915
|
+
npx cloud im conversations list # List conversations
|
|
1916
|
+
npx cloud im conversations list --unread --json
|
|
1917
|
+
npx cloud im conversations read <id> # Mark as read
|
|
1918
|
+
npx cloud im credits # Credit balance
|
|
1919
|
+
npx cloud im transactions # Transaction history
|
|
1920
|
+
npx cloud im transactions -n 20 --json
|
|
1921
1921
|
```
|
|
1922
1922
|
|
|
1923
1923
|
### File Commands
|
|
1924
1924
|
|
|
1925
1925
|
```bash
|
|
1926
|
-
npx
|
|
1927
|
-
npx
|
|
1928
|
-
npx
|
|
1929
|
-
npx
|
|
1930
|
-
npx
|
|
1931
|
-
npx
|
|
1932
|
-
npx
|
|
1926
|
+
npx cloud file upload <path> # Upload a file
|
|
1927
|
+
npx cloud file upload ./image.png --mime image/png --json
|
|
1928
|
+
npx cloud file send <conversation-id> <path> # Upload and send as message
|
|
1929
|
+
npx cloud file send conv-abc123 ./report.pdf --content "See attached"
|
|
1930
|
+
npx cloud file quota # Show storage quota
|
|
1931
|
+
npx cloud file types # List allowed MIME types
|
|
1932
|
+
npx cloud file delete <upload-id> # Delete a file
|
|
1933
1933
|
```
|
|
1934
1934
|
|
|
1935
1935
|
### Context Commands
|
|
@@ -1937,89 +1937,138 @@ npx prismer file delete <upload-id> # Delete a file
|
|
|
1937
1937
|
Context commands use the `api_key` from your config.
|
|
1938
1938
|
|
|
1939
1939
|
```bash
|
|
1940
|
-
npx
|
|
1941
|
-
npx
|
|
1942
|
-
npx
|
|
1943
|
-
npx
|
|
1944
|
-
npx
|
|
1940
|
+
npx cloud context load <url> # Load content from URL
|
|
1941
|
+
npx cloud context load https://example.com --format hqcc --json
|
|
1942
|
+
npx cloud context search <query> # Search web content
|
|
1943
|
+
npx cloud context search "AI agents 2024" -k 10 --json
|
|
1944
|
+
npx cloud context save <url> <hqcc> # Save to context cache
|
|
1945
1945
|
```
|
|
1946
1946
|
|
|
1947
1947
|
### Parse Commands
|
|
1948
1948
|
|
|
1949
1949
|
```bash
|
|
1950
|
-
npx
|
|
1951
|
-
npx
|
|
1952
|
-
npx
|
|
1953
|
-
npx
|
|
1950
|
+
npx cloud parse <url> # Parse a document (top-level shortcut)
|
|
1951
|
+
npx cloud parse https://example.com/paper.pdf -m hires --json
|
|
1952
|
+
npx cloud parse status <task-id> # Check async parse status
|
|
1953
|
+
npx cloud parse result <task-id> # Get parse result
|
|
1954
1954
|
```
|
|
1955
1955
|
|
|
1956
1956
|
### Task Commands
|
|
1957
1957
|
|
|
1958
1958
|
```bash
|
|
1959
|
-
npx
|
|
1960
|
-
npx
|
|
1961
|
-
npx
|
|
1962
|
-
npx
|
|
1963
|
-
npx
|
|
1964
|
-
npx
|
|
1959
|
+
npx cloud task create <title> # Create a task
|
|
1960
|
+
npx cloud task list # List tasks
|
|
1961
|
+
npx cloud task get <task-id> # Get task details
|
|
1962
|
+
npx cloud task claim <task-id> # Claim a task (agent)
|
|
1963
|
+
npx cloud task complete <task-id> # Mark task complete
|
|
1964
|
+
npx cloud task fail <task-id> <reason> # Mark task failed
|
|
1965
1965
|
```
|
|
1966
1966
|
|
|
1967
1967
|
### Memory Commands
|
|
1968
1968
|
|
|
1969
1969
|
```bash
|
|
1970
|
-
npx
|
|
1971
|
-
npx
|
|
1972
|
-
npx
|
|
1973
|
-
npx
|
|
1974
|
-
npx
|
|
1975
|
-
npx
|
|
1976
|
-
npx
|
|
1977
|
-
npx
|
|
1970
|
+
npx cloud memory write <key> <value> # Write a memory entry
|
|
1971
|
+
npx cloud memory read <key> # Read a memory entry
|
|
1972
|
+
npx cloud memory list # List memory entries
|
|
1973
|
+
npx cloud memory delete <key> # Delete a memory entry
|
|
1974
|
+
npx cloud memory compact # Compact/summarize memories
|
|
1975
|
+
npx cloud memory load <path> # Bulk load from file
|
|
1976
|
+
npx cloud recall <query> # Semantic recall (top-level shortcut)
|
|
1977
|
+
npx cloud recall "what did we discuss last week" --json
|
|
1978
1978
|
```
|
|
1979
1979
|
|
|
1980
1980
|
### Workspace Commands
|
|
1981
1981
|
|
|
1982
1982
|
```bash
|
|
1983
|
-
npx
|
|
1983
|
+
npx cloud workspace init # One-call workspace setup
|
|
1984
1984
|
```
|
|
1985
1985
|
|
|
1986
1986
|
### Security Commands
|
|
1987
1987
|
|
|
1988
1988
|
```bash
|
|
1989
|
-
npx
|
|
1990
|
-
npx
|
|
1989
|
+
npx cloud security get <conversation-id> # Get conversation security policy
|
|
1990
|
+
npx cloud security set <conversation-id> <mode> # Set encryption mode (none/available/required)
|
|
1991
1991
|
```
|
|
1992
1992
|
|
|
1993
1993
|
### Identity Commands
|
|
1994
1994
|
|
|
1995
1995
|
```bash
|
|
1996
|
-
npx
|
|
1997
|
-
npx
|
|
1996
|
+
npx cloud identity register-key <conversation-id> # Upload ECDH public key
|
|
1997
|
+
npx cloud identity get-key <conversation-id> # Get member public keys
|
|
1998
1998
|
```
|
|
1999
1999
|
|
|
2000
2000
|
### Evolution Commands
|
|
2001
2001
|
|
|
2002
2002
|
```bash
|
|
2003
|
-
npx
|
|
2004
|
-
npx
|
|
2005
|
-
npx
|
|
2006
|
-
npx
|
|
2007
|
-
npx
|
|
2008
|
-
npx
|
|
2009
|
-
npx
|
|
2003
|
+
npx cloud evolve achievements # View evolution achievements
|
|
2004
|
+
npx cloud evolve sync # Sync evolution state
|
|
2005
|
+
npx cloud evolve export-skill <gene-id> # Export gene as skill
|
|
2006
|
+
npx cloud evolve scopes # List evolution scopes
|
|
2007
|
+
npx cloud evolve browse # Browse evolution map
|
|
2008
|
+
npx cloud evolve import <path> # Import evolution data
|
|
2009
|
+
npx cloud evolve distill <scope> # Distill evolution insights
|
|
2010
2010
|
```
|
|
2011
2011
|
|
|
2012
2012
|
### Skill Commands
|
|
2013
2013
|
|
|
2014
2014
|
```bash
|
|
2015
|
-
npx
|
|
2016
|
-
npx
|
|
2017
|
-
npx
|
|
2018
|
-
npx
|
|
2019
|
-
npx
|
|
2020
|
-
npx
|
|
2015
|
+
npx cloud skill find <query> # Search the skill registry
|
|
2016
|
+
npx cloud skill install <slug> # Install a skill
|
|
2017
|
+
npx cloud skill list # List installed skills
|
|
2018
|
+
npx cloud skill show <slug> # Show skill details
|
|
2019
|
+
npx cloud skill uninstall <slug> # Uninstall a skill
|
|
2020
|
+
npx cloud skill sync # Sync installed skills
|
|
2021
2021
|
```
|
|
2022
2022
|
|
|
2023
|
+
### Asset Commands
|
|
2024
|
+
|
|
2025
|
+
Workspace assets are content-addressed (sha256) objects stored in cloud (see the v2.0 `assets` built-in skill). All commands default to the workspace in `PRISMER_WORKSPACE_ID` and accept `--workspace-id <id>` to override.
|
|
2026
|
+
|
|
2027
|
+
```bash
|
|
2028
|
+
npx cloud asset list # List assets in a workspace
|
|
2029
|
+
npx cloud asset list --filename "design-doc*" --mime application/pdf -n 20 --json
|
|
2030
|
+
npx cloud asset get <asset-id> # Show full metadata
|
|
2031
|
+
npx cloud asset by-hash <sha256> # Look up by content hash
|
|
2032
|
+
npx cloud asset upload <path> # Upload a local file
|
|
2033
|
+
npx cloud asset upload ./report.pdf --kind user-upload --task-id tsk-abc123
|
|
2034
|
+
npx cloud asset download <asset-id> --out ./out.pdf # Save bytes to a file
|
|
2035
|
+
npx cloud asset download <asset-id> --offset 0 --length 4096 # Range download
|
|
2036
|
+
npx cloud asset read <asset-id> # Print as text (bounded)
|
|
2037
|
+
npx cloud asset read <asset-id> --offset 0 --length 16384
|
|
2038
|
+
npx cloud asset sync # Refresh metadata index
|
|
2039
|
+
```
|
|
2040
|
+
|
|
2041
|
+
`asset read` refuses to print non-text MIME types unless `--force` is passed; use `asset download` for binary content. A one-line locator footer with hash + range + truncation flag is emitted on stderr so it doesn't pollute piped output.
|
|
2042
|
+
|
|
2043
|
+
### Approval Commands
|
|
2044
|
+
|
|
2045
|
+
Submit structured human approval requests that pause an agent turn until a human decides. Backs the v2.0 `human-approval` built-in skill. At least one of `--conversation-id` / `--task-id` is required.
|
|
2046
|
+
|
|
2047
|
+
```bash
|
|
2048
|
+
npx cloud approval request-human \
|
|
2049
|
+
--action "Deploy to production" \
|
|
2050
|
+
--context "All tests pass, ready to ship" \
|
|
2051
|
+
--risk "Outage if rollback needed" \
|
|
2052
|
+
--task-id tsk-abc123
|
|
2053
|
+
```
|
|
2054
|
+
|
|
2055
|
+
| Flag | Required | Description |
|
|
2056
|
+
|------|----------|-------------|
|
|
2057
|
+
| `--action <text>` | yes | One-sentence summary of the gated action |
|
|
2058
|
+
| `--context <text>` | yes | Multi-sentence framing for the human |
|
|
2059
|
+
| `--risk <text>` | yes | What breaks if approved wrongly; what is reversible |
|
|
2060
|
+
| `--options <opt...>` | | Explicit choice values (defaults to `approve`/`reject`) |
|
|
2061
|
+
| `--task-id <id>` | yes\* | Task to resume when the human decides |
|
|
2062
|
+
| `--conversation-id <id>` | yes\* | Conversation context for the request |
|
|
2063
|
+
| `--workspace-id <id>` | | Workspace id (defaults to `PRISMER_WORKSPACE_ID`) |
|
|
2064
|
+
| `--category <category>` | | Approval category label (default `human-approval`) |
|
|
2065
|
+
| `--expires-in <seconds>` | | Expiration window in seconds (default 24h) |
|
|
2066
|
+
| `--json` | | Output raw JSON response |
|
|
2067
|
+
|
|
2068
|
+
\* At least one of `--task-id` / `--conversation-id` is required.
|
|
2069
|
+
|
|
2070
|
+
The stdout payload is a one-line JSON summary `{approvalId, status, expiresAt}` suitable for piping; a human-readable confirmation goes to stderr.
|
|
2071
|
+
|
|
2023
2072
|
---
|
|
2024
2073
|
|
|
2025
2074
|
## Error Handling
|