sim 2.1.8-dev.95.1 → 2.1.8-preview.102.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 (57) hide show
  1. package/README.md +68 -21
  2. package/THIRD_PARTY_LICENSES +42 -0
  3. package/dist/index.js +3634 -1096
  4. package/package.json +6 -16
  5. package/dist/auth/device-flow.d.ts +0 -38
  6. package/dist/commands/auth.d.ts +0 -5
  7. package/dist/commands/configure.d.ts +0 -2
  8. package/dist/commands/credentials.d.ts +0 -3
  9. package/dist/commands/protocol/chat.d.ts +0 -11
  10. package/dist/commands/protocol/files-get.d.ts +0 -25
  11. package/dist/commands/protocol/files-upload.d.ts +0 -2
  12. package/dist/commands/protocol/index.d.ts +0 -3
  13. package/dist/commands/protocol/knowledge-document-upload.d.ts +0 -2
  14. package/dist/commands/protocol/logs-follow.d.ts +0 -39
  15. package/dist/commands/protocol/resource-directory.d.ts +0 -24
  16. package/dist/commands/protocol/result.d.ts +0 -2
  17. package/dist/commands/protocol/tables-import.d.ts +0 -2
  18. package/dist/commands/protocol/workflow-run-follow.d.ts +0 -56
  19. package/dist/commands/protocol/workflow-run-get.d.ts +0 -15
  20. package/dist/commands/protocol/workflow-run-wait.d.ts +0 -3
  21. package/dist/commands/secrets.d.ts +0 -3
  22. package/dist/config/index.d.ts +0 -2
  23. package/dist/config/ini.d.ts +0 -111
  24. package/dist/config/paths.d.ts +0 -10
  25. package/dist/config/profile.d.ts +0 -158
  26. package/dist/context.d.ts +0 -21
  27. package/dist/contract/commands.d.ts +0 -14
  28. package/dist/contract/types.d.ts +0 -292
  29. package/dist/embed-context.d.ts +0 -77
  30. package/dist/embed-output.d.ts +0 -15
  31. package/dist/generated/v2-api.d.ts +0 -12969
  32. package/dist/helpers.d.ts +0 -9
  33. package/dist/http/client.d.ts +0 -166
  34. package/dist/http/environment.d.ts +0 -24
  35. package/dist/output/io.d.ts +0 -5
  36. package/dist/output/presentation.d.ts +0 -4
  37. package/dist/output/render.d.ts +0 -60
  38. package/dist/output/terminal-text.d.ts +0 -17
  39. package/dist/output/trace.d.ts +0 -3
  40. package/dist/program.d.ts +0 -21
  41. package/dist/runtime/build.d.ts +0 -38
  42. package/dist/runtime/derive.d.ts +0 -20
  43. package/dist/runtime/execute.d.ts +0 -30
  44. package/dist/runtime/naming.d.ts +0 -25
  45. package/dist/runtime/options.d.ts +0 -7
  46. package/dist/runtime/renamed.d.ts +0 -6
  47. package/dist/runtime/request.d.ts +0 -109
  48. package/dist/runtime/result.d.ts +0 -50
  49. package/dist/runtime/types.d.ts +0 -23
  50. package/dist/runtime.d.ts +0 -4
  51. package/dist/runtime.js +0 -16886
  52. package/dist/terminal/secret-input.d.ts +0 -15
  53. package/dist/terminal.d.ts +0 -6
  54. package/dist/transfer/local-file.d.ts +0 -16
  55. package/dist/transfer/streaming-upload.d.ts +0 -16
  56. package/dist/transfer/upload-session.d.ts +0 -18
  57. package/dist/version.d.ts +0 -10
package/README.md CHANGED
@@ -33,23 +33,37 @@ Sign in to the default profile:
33
33
  sim login
34
34
  ```
35
35
 
36
- The CLI opens a browser and prints a pairing code. Confirm that the code in the
37
- browser matches the one in your terminal, approve the login, and choose a
38
- workspace. The selected workspace becomes the default for this profile.
39
-
40
- The login stores a personal API key locally. It does not start a local callback
41
- server, so the same flow works over SSH and in containers. Use
42
- `sim login --no-browser` when the browser is on another machine.
43
-
44
- Check the active profile and verify that its endpoint, API key, and workspace
36
+ With no `--method`, the CLI prefers OAuth when the server offers it and a local
37
+ browser callback is possible. It selects API-key pairing for remote terminals
38
+ or servers without OAuth. Use `sim login --method oauth` to require OAuth;
39
+ if the server does not offer it, login fails without creating an API key.
40
+
41
+ OAuth login opens Sim in your browser, asks you to approve the requested access,
42
+ and receives the one-time authorization code on a loopback callback. It stores
43
+ a short-lived OAuth login that renews automatically and can be revoked under
44
+ **Settings General Authorized apps**. Choose a default workspace afterward with
45
+ `sim configure --set-workspace <id>`.
46
+
47
+ Use `--no-browser` with either method to print the approval URL without opening
48
+ it. OAuth still needs the browser to reach the CLI's loopback callback. Over SSH
49
+ or in a container without port forwarding, use
50
+ `sim login --method api-key --no-browser` to approve from another device and
51
+ create a permanent personal API key. `--method api-key` creates a new key;
52
+ set `SIM_API_KEY` to supply an existing one.
53
+
54
+ Pairing requires a server that supports `platform` API keys. Upgrade older
55
+ deployments that only issue `copilot` keys before login; they are not compatible
56
+ with the platform CLI. OAuth discovery does not check pairing compatibility.
57
+
58
+ Check the active profile and verify that its endpoint, credential, and workspace
45
59
  work together:
46
60
 
47
61
  ```bash
48
62
  sim whoami
49
63
  ```
50
64
 
51
- This also reports whether the active key is personal or workspace-scoped. Some
52
- administrative and deployment operations require a personal key.
65
+ This also reports whether the active credential is an OAuth login or an API
66
+ key. Some administrative operations require a personal credential.
53
67
 
54
68
  Then list and run workflows:
55
69
 
@@ -73,7 +87,7 @@ not a workflow.
73
87
  A profile is a named CLI configuration. It determines:
74
88
 
75
89
  - which Sim deployment to use
76
- - which API key to authenticate with
90
+ - which stored login or API key to authenticate with
77
91
  - which workspace to target by default
78
92
  - how command output is formatted
79
93
 
@@ -94,8 +108,8 @@ There are two common ways to create profiles.
94
108
 
95
109
  ### Use one login with several workspaces
96
110
 
97
- After `sim login`, create another profile that shares the active profile's API
98
- key but has its own default workspace:
111
+ After `sim login`, create another profile that shares the active profile's
112
+ credential but has its own default workspace:
99
113
 
100
114
  ```bash
101
115
  sim workspaces list
@@ -105,7 +119,7 @@ sim --profile acme whoami
105
119
 
106
120
  If you omit `--workspace` in an interactive terminal, the CLI asks you to choose
107
121
  one. The new profile stores an `auth_profile` reference to the active login; it
108
- does not copy the API key.
122
+ does not copy the credential.
109
123
 
110
124
  ### Use a separate account or deployment
111
125
 
@@ -117,8 +131,8 @@ sim login --profile work
117
131
  sim login --profile local --endpoint http://localhost:3000
118
132
  ```
119
133
 
120
- Each of these profiles stores its own API key. The endpoint selected during
121
- login is saved with the profile.
134
+ Each of these profiles stores its own login. The endpoint selected during login
135
+ is saved with the profile.
122
136
 
123
137
  ### View and change profiles
124
138
 
@@ -134,8 +148,9 @@ sim whoami --profile work
134
148
  `sim profiles` marks the active profile with `*`. Running `sim configure` with
135
149
  no setting flags prints the saved settings for that profile.
136
150
 
137
- Non-secret settings are stored in `~/.sim/config`. API keys are stored separately
138
- in `~/.sim/credentials`, which is written with `0600` permissions. Set
151
+ Non-secret settings are stored in `~/.sim/config`. OAuth tokens and API keys are
152
+ stored separately in `~/.sim/credentials`, which is written with `0600`
153
+ permissions. Set
139
154
  `SIM_CONFIG_DIR` to use a different directory.
140
155
 
141
156
  For each setting, the CLI uses the first available value in this order:
@@ -205,11 +220,26 @@ will consume the result, and `text` for tab-separated shell output:
205
220
 
206
221
  ```bash
207
222
  sim workflows list --output json
208
- sim logs list --output json | jq -r '.[].runId'
223
+ sim logs list --output json | jq -r '.data[].runId'
209
224
  SIM_OUTPUT=yaml sim tables get <tableId>
210
225
  sim configure --set-output json
211
226
  ```
212
227
 
228
+ Paginated lists return `{ "data": [...], "nextCursor": "..." }` in JSON and YAML.
229
+ `nextCursor` is `null` when no pages remain. Resource lists and directory `ls`
230
+ fetch every page by default; use `--limit N` to cap them. Table rows (including
231
+ queries), logs, audit/billing events, workflow runs/versions, and knowledge
232
+ documents/chunks keep a default limit of 100. Use `--limit 0` to fetch every page
233
+ of those datasets, or pass the returned `nextCursor` to `--cursor` to continue
234
+ with another bounded result. Keep the same resource, filters, and sort order
235
+ when resuming; stop when `nextCursor` is `null`. Results accumulate in memory
236
+ before printing, so large datasets need an explicit limit or filter.
237
+
238
+ ```bash
239
+ sim tables rows list <tableId> --limit 100 --output json
240
+ sim tables rows list <tableId> --limit 100 --cursor "$nextCursor" --output json
241
+ ```
242
+
213
243
  JSON-valued options accept inline JSON, a file prefixed with `@`, or stdin with
214
244
  `@-`:
215
245
 
@@ -256,9 +286,26 @@ The main environment variables are:
256
286
  | `SIM_API_KEY` | API key, usually for CI |
257
287
  | `SIM_WORKSPACE` | Workspace to target |
258
288
  | `SIM_OUTPUT` | `table`, `json`, `yaml`, or `text` |
259
- | `SIM_CONFIG_DIR` | Directory containing CLI config and credentials |
289
+ | `SIM_CONFIG_DIR` | Base directory for CLI config, credentials, and the update cache |
260
290
  | `SIM_TIMEOUT_SECONDS` | Per-request timeout; `0` waits indefinitely |
261
291
  | `SIM_DEBUG` | Print request diagnostics to stderr |
292
+ | `SIM_NO_UPDATE_CHECK` | Turn off the update notice |
293
+
294
+ On eligible interactive invocations, `sim` uses a daily cache before asking
295
+ `registry.npmjs.org` what is published under the `latest` tag and prints one
296
+ line on stderr when a newer version exists. Prerelease installs are skipped
297
+ entirely. The cache lives in `~/.sim` by default and follows `SIM_CONFIG_DIR`;
298
+ without a writable cache, each eligible invocation checks again. Concurrent
299
+ invocations can also perform duplicate checks. The registry request has a
300
+ one-second deadline; the short-lived request process is terminated on expiry.
301
+ Apart from the configured registry URL, it sends only its own version and never
302
+ your Sim API key. If `npm_config_registry` points at a private mirror, its query
303
+ string is preserved, including any query-string credentials. Registry URLs
304
+ containing username/password userinfo are rejected. Set
305
+ `SIM_NO_UPDATE_CHECK=1` to turn it off. Empty or whitespace-only registry values
306
+ use the public default; non-empty malformed or non-HTTP(S) values fail closed.
307
+ The full list of cases where it stays quiet is in the
308
+ [configuration guide](https://docs.sim.ai/cli/configuration).
262
309
 
263
310
  ## Documentation
264
311
 
@@ -9,6 +9,13 @@ Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
9
9
  js-yaml
10
10
  Copyright (C) 2011-2015 by Vitaly Puzrin
11
11
 
12
+ proper-lockfile
13
+ Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
14
+
15
+ retry
16
+ Copyright (c) 2011 Tim Koschützki (tim@debuggable.com)
17
+ Copyright (c) 2011 Felix Geisendörfer (felix@debuggable.com)
18
+
12
19
  Each dependency above is licensed under the MIT License:
13
20
 
14
21
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,3 +35,38 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
35
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
36
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
37
  SOFTWARE.
38
+
39
+ graceful-fs
40
+ The ISC License
41
+
42
+ Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
43
+
44
+ Permission to use, copy, modify, and/or distribute this software for any
45
+ purpose with or without fee is hereby granted, provided that the above
46
+ copyright notice and this permission notice appear in all copies.
47
+
48
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
49
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
50
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
51
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
52
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
53
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
54
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
55
+
56
+ signal-exit
57
+ The ISC License
58
+
59
+ Copyright (c) 2015, Contributors
60
+
61
+ Permission to use, copy, modify, and/or distribute this software
62
+ for any purpose with or without fee is hereby granted, provided
63
+ that the above copyright notice and this permission notice
64
+ appear in all copies.
65
+
66
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
67
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
68
+ OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
69
+ LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
70
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
71
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
72
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.