@deepraxis/sdk 0.1.1-dev.b4fa9b9 → 0.1.1-dev.b58d05d

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/METHODS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SDK methods
2
2
 
3
- Generated by `bun run generate`. 665 HTTP operations, plus product aliases. Version segments and path parameters are omitted from resource names. Inputs use typed `{ path, query, body, headers }` options. Collections form nested resource objects; POST actions retain their verb. Naming rules are documented in `scripts/resources.ts`; semantic exceptions and aliases with reasons are in `scripts/naming-overrides.ts`.
3
+ Generated by `bun run generate`. 696 HTTP operations, plus product aliases. Version segments and path parameters are omitted from resource names. Inputs use typed `{ path, query, body, headers }` options. Collections form nested resource objects; POST actions retain their verb. Naming rules are documented in `scripts/resources.ts`; semantic exceptions and aliases with reasons are in `scripts/naming-overrides.ts`.
4
4
 
5
5
  `always` returns an AsyncIterable; `optional` streams with `{ stream: true }`; `yes` pagination returns a Page. Only `{ data, next_cursor }` + `cursor` query contracts are automatically paginated.
6
6
 
@@ -576,9 +576,11 @@ Multipart request bodies expand plain objects into bracketed fields (for example
576
576
  | Method | HTTP | Path | Streaming | Pagination |
577
577
  |---|---|---|---|---|
578
578
  | create | POST | `/browser/v1/sessions` | no | no |
579
+ | frames | GET | `/browser/v1/sessions/{sessionId}/frames` | always | no |
579
580
  | list | GET | `/browser/v1/sessions` | no | no |
580
581
  | retrieve | GET | `/browser/v1/sessions/{sessionId}` | no | no |
581
582
  | retrieveDebug | GET | `/browser/v1/sessions/{sessionId}/debug` | no | no |
583
+ | retrieveFrame | GET | `/browser/v1/sessions/{sessionId}/frame` | no | no |
582
584
  | stream | GET | `/browser/v1/sessions/{sessionId}/stream` | always | no |
583
585
  | update | POST | `/browser/v1/sessions/{sessionId}` | no | no |
584
586
 
@@ -878,6 +880,14 @@ Multipart request bodies expand plain objects into bracketed fields (for example
878
880
 
879
881
  ## devops
880
882
 
883
+ ### devops.changes
884
+
885
+ | Method | HTTP | Path | Streaming | Pagination |
886
+ |---|---|---|---|---|
887
+ | abandon | POST | `/devops/v1/changes/{id}:abandon` | no | no |
888
+ | markLastSlice | POST | `/devops/v1/changes/{id}:markLastSlice` | no | no |
889
+ | retrieve | GET | `/devops/v1/changes/{id}` | no | no |
890
+
881
891
  ### devops.environments.checkpoints
882
892
 
883
893
  | Method | HTTP | Path | Streaming | Pagination |
@@ -917,12 +927,39 @@ Multipart request bodies expand plain objects into bracketed fields (for example
917
927
  | retrieve | GET | `/devops/v1/projects/{id}` | no | no |
918
928
  | retrieveTestCatalog | GET | `/devops/v1/projects/{project}/test-catalog` | no | no |
919
929
 
930
+ ### devops.projects.changes
931
+
932
+ | Method | HTTP | Path | Streaming | Pagination |
933
+ |---|---|---|---|---|
934
+ | create | POST | `/devops/v1/projects/{project}/changes` | no | no |
935
+ | list | GET | `/devops/v1/projects/{project}/changes` | no | no |
936
+
920
937
  ### devops.projects.environments
921
938
 
922
939
  | Method | HTTP | Path | Streaming | Pagination |
923
940
  |---|---|---|---|---|
924
941
  | list | GET | `/devops/v1/projects/{project}/environments` | no | no |
925
942
 
943
+ ### devops.projects.environments.targets
944
+
945
+ | Method | HTTP | Path | Streaming | Pagination |
946
+ |---|---|---|---|---|
947
+ | deleteState | DELETE | `/devops/v1/projects/{project}/environments/{environment}/targets/{target}/state` | no | no |
948
+ | retrieveState | GET | `/devops/v1/projects/{project}/environments/{environment}/targets/{target}/state` | no | no |
949
+
950
+ ### devops.projects.environments.targets.state
951
+
952
+ | Method | HTTP | Path | Streaming | Pagination |
953
+ |---|---|---|---|---|
954
+ | create | POST | `/devops/v1/projects/{project}/environments/{environment}/targets/{target}/state` | no | no |
955
+ | deleteLock | DELETE | `/devops/v1/projects/{project}/environments/{environment}/targets/{target}/state/lock` | no | no |
956
+
957
+ ### devops.projects.environments.targets.state.lock
958
+
959
+ | Method | HTTP | Path | Streaming | Pagination |
960
+ |---|---|---|---|---|
961
+ | create | POST | `/devops/v1/projects/{project}/environments/{environment}/targets/{target}/state/lock` | no | no |
962
+
926
963
  ### devops.projects.flags
927
964
 
928
965
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1256,12 +1293,6 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1256
1293
  |---|---|---|---|---|
1257
1294
  | list | GET | `/media/v1/libraries/{library_id}/folders` | no | no |
1258
1295
 
1259
- ### media.libraries.generations
1260
-
1261
- | Method | HTTP | Path | Streaming | Pagination |
1262
- |---|---|---|---|---|
1263
- | create | POST | `/media/v1/libraries/{library_id}/generations` | no | no |
1264
-
1265
1296
  ### media.libraries.jobs
1266
1297
 
1267
1298
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1270,12 +1301,6 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1270
1301
  | list | GET | `/media/v1/libraries/{library_id}/jobs` | no | yes |
1271
1302
  | retrieve | GET | `/media/v1/libraries/{library_id}/jobs/{job_id}` | no | no |
1272
1303
 
1273
- ### media.libraries.jobs.outputs.save
1274
-
1275
- | Method | HTTP | Path | Streaming | Pagination |
1276
- |---|---|---|---|---|
1277
- | create | POST | `/media/v1/libraries/{library_id}/jobs/{job_id}/outputs/{index}/save` | no | no |
1278
-
1279
1304
  ### media.libraries.purge
1280
1305
 
1281
1306
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1313,6 +1338,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1313
1338
  | list | GET | `/media/v1/libraries/{library_id}/understandings` | no | yes |
1314
1339
  | retrieveFailureSummary | GET | `/media/v1/libraries/{library_id}/understandings/failure_summary` | no | no |
1315
1340
 
1341
+ ### media.speech
1342
+
1343
+ | Method | HTTP | Path | Streaming | Pagination |
1344
+ |---|---|---|---|---|
1345
+ | create | POST | `/media/v1/libraries/{library_id}/audio/speech` | no | no |
1346
+
1316
1347
  ### media.videos
1317
1348
 
1318
1349
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1576,6 +1607,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1576
1607
 
1577
1608
  ## sandbox
1578
1609
 
1610
+ ### sandbox.events.sandboxes
1611
+
1612
+ | Method | HTTP | Path | Streaming | Pagination |
1613
+ |---|---|---|---|---|
1614
+ | retrieve | GET | `/sandbox/v1/events/sandboxes/{sandboxID}` | no | no |
1615
+
1579
1616
  ### sandbox.sandboxes
1580
1617
 
1581
1618
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1633,6 +1670,13 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1633
1670
  |---|---|---|---|---|
1634
1671
  | create | POST | `/sandbox/v1/sandboxes/{sandboxID}/snapshots` | no | no |
1635
1672
 
1673
+ ### sandbox.sandboxes.tasks
1674
+
1675
+ | Method | HTTP | Path | Streaming | Pagination |
1676
+ |---|---|---|---|---|
1677
+ | create | POST | `/sandbox/v1/sandboxes/{sandboxID}/tasks` | no | no |
1678
+ | retrieveLog | GET | `/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log` | no | no |
1679
+
1636
1680
  ### sandbox.sandboxes.upgrade
1637
1681
 
1638
1682
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1790,7 +1834,6 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1790
1834
  | resolve | GET | `/studio/v1/works:resolve` | no | no |
1791
1835
  | retrieve | GET | `/studio/v1/works/{work}` | no | no |
1792
1836
  | update | PATCH | `/studio/v1/works/{work}` | no | no |
1793
- | updateBrief | PATCH | `/studio/v1/works/{work}/brief` | no | no |
1794
1837
 
1795
1838
  ### studio.works.drafts
1796
1839
 
@@ -1804,6 +1847,15 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1804
1847
  | retrieveOutline | GET | `/studio/v1/works/{work}/drafts/{draft}/outline` | no | no |
1805
1848
  | retrieveReview | GET | `/studio/v1/works/{work}/drafts/{draft}/review` | no | no |
1806
1849
  | update | PATCH | `/studio/v1/works/{work}/drafts/{draft}` | no | no |
1850
+ | updateBrief | PATCH | `/studio/v1/works/{work}/drafts/{draft}/brief` | no | no |
1851
+
1852
+ ### studio.works.drafts.foreshadows
1853
+
1854
+ | Method | HTTP | Path | Streaming | Pagination |
1855
+ |---|---|---|---|---|
1856
+ | delete | DELETE | `/studio/v1/works/{work}/drafts/{draft}/foreshadows/{key}` | no | no |
1857
+ | list | GET | `/studio/v1/works/{work}/drafts/{draft}/foreshadows` | no | no |
1858
+ | update | PUT | `/studio/v1/works/{work}/drafts/{draft}/foreshadows/{key}` | no | no |
1807
1859
 
1808
1860
  ### studio.works.drafts.renditions
1809
1861
 
@@ -1825,6 +1877,14 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1825
1877
  | batchUpdate | POST | `/studio/v1/works/{work}/drafts/{draft}/units:batchUpdate` | no | no |
1826
1878
  | create | POST | `/studio/v1/works/{work}/drafts/{draft}/units` | no | no |
1827
1879
 
1880
+ ### studio.works.progressions
1881
+
1882
+ | Method | HTTP | Path | Streaming | Pagination |
1883
+ |---|---|---|---|---|
1884
+ | create | POST | `/studio/v1/works/{work}/progressions` | no | no |
1885
+ | delete | DELETE | `/studio/v1/works/{work}/progressions/{id}` | no | no |
1886
+ | list | GET | `/studio/v1/works/{work}/progressions` | no | no |
1887
+
1828
1888
  ### studio.works.renditions
1829
1889
 
1830
1890
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1837,6 +1897,31 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1837
1897
  | retrieveContent | GET | `/studio/v1/works/{work}/renditions/{rendition}/content` | no | no |
1838
1898
  | update | PATCH | `/studio/v1/works/{work}/renditions/{rendition}` | no | no |
1839
1899
 
1900
+ ### studio.works.reviewSettings
1901
+
1902
+ | Method | HTTP | Path | Streaming | Pagination |
1903
+ |---|---|---|---|---|
1904
+ | retrieve | GET | `/studio/v1/works/{work}/review-settings` | no | no |
1905
+ | update | PATCH | `/studio/v1/works/{work}/review-settings` | no | no |
1906
+
1907
+ ### studio.works.reviewers
1908
+
1909
+ | Method | HTTP | Path | Streaming | Pagination |
1910
+ |---|---|---|---|---|
1911
+ | create | POST | `/studio/v1/works/{work}/reviewers` | no | no |
1912
+ | delete | DELETE | `/studio/v1/works/{work}/reviewers/{agent}` | no | no |
1913
+ | list | GET | `/studio/v1/works/{work}/reviewers` | no | no |
1914
+ | update | PATCH | `/studio/v1/works/{work}/reviewers/{agent}` | no | no |
1915
+
1916
+ ### studio.works.reviews
1917
+
1918
+ | Method | HTTP | Path | Streaming | Pagination |
1919
+ |---|---|---|---|---|
1920
+ | cancel | POST | `/studio/v1/works/{work}/reviews/{review}:cancel` | no | no |
1921
+ | create | POST | `/studio/v1/works/{work}/reviews` | no | no |
1922
+ | list | GET | `/studio/v1/works/{work}/reviews` | no | no |
1923
+ | retrieve | GET | `/studio/v1/works/{work}/reviews/{review}` | no | no |
1924
+
1840
1925
  ### studio.works.units
1841
1926
 
1842
1927
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1900,6 +1985,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1900
1985
  | Method | HTTP | Path | Streaming | Pagination |
1901
1986
  |---|---|---|---|---|
1902
1987
  | list | GET | `/ticket/v1/repositories` | no | no |
1988
+ | update | PATCH | `/ticket/v1/repositories/{id}` | no | no |
1903
1989
 
1904
1990
  ### ticket.tickets
1905
1991
 
@@ -2095,6 +2181,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2095
2181
  | media.libraries.setDefault | ADR-094 §9 names the default-library write libraries.setDefault; the URL has no library id because the organization owns one default library, so the path alone cannot say which. |
2096
2182
  | media.assets.edit | ADR-094 §9 names the edit write assets.edit; an edit acts on the addressed asset and returns a Job, so the URL nesting under a library is a mount rather than an SDK resource level. |
2097
2183
  | media.assets.lineage | ADR-094 §9 names the edit-tree read assets.lineage; lineage is the product verb and the URL nesting under a library is a mount, not an SDK resource level. |
2184
+ | media.speech.create | ADR-094 §1/§9 names speech synthesis speech.create; the URL says audio/speech because that is the artifact the caller gets back, and the path alone would derive a speech collection create under an audio level that is not an SDK resource. |
2098
2185
  | media.images.generate | ADR-094 §9 names image generation images.generate; the URL mounts it under a library, but generation is an operation on images and the path alone would derive a generations collection create. |
2099
2186
  | media.videos.generate | ADR-094 §2/§9 names video generation videos.generate beside images.generate; the URL mounts it under a library, but generation is an operation on videos and the path alone would derive a generations collection create. The unqualified videos resource is the video lane, distinct from the batch and legacy job resources. |
2100
2187
  | meta.docs.search | Documentation keyword search is an operation on docs, not a nested collection. |
@@ -2102,6 +2189,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2102
2189
  | sandbox.sandboxes.files.remove | Sandbox data operations use the E2B SDK verb while preserving URL resource nesting. |
2103
2190
  | sandbox.sandboxes.files.read | Sandbox data operations use the E2B SDK verb while preserving URL resource nesting. |
2104
2191
  | sandbox.sandboxes.files.write | Sandbox data operations use the E2B SDK verb while preserving URL resource nesting. |
2192
+ | studio.works.reviewSettings.retrieve | A work has one review-settings singleton; the segment ends in s only because English writes it that way, so the collection rule would derive reviewSettings.list for a read that returns the settings object itself. |
2105
2193
  | vault.oauth.retrieveClientMetadata | The literal .json filename otherwise introduces a dot inside a method identifier. |
2106
2194
 
2107
2195
  ## SDK parameter aliases
package/README.md CHANGED
@@ -122,7 +122,7 @@ conversation with it, on its own machine.
122
122
  ```ts
123
123
  const { sandboxes } = praxis.sandbox;
124
124
  const sandbox = await sandboxes.create({
125
- body: { templateID: 'base' },
125
+ body: { templateID: 'base', autoPause: false }, // ends at its timeout; autoPause: true keeps a long-lived computer
126
126
  });
127
127
  const result = await sandboxes.commands.run({
128
128
  path: { sandbox_id: sandbox.sandboxID },
@@ -1,7 +1,9 @@
1
1
  /**
2
- * Default credential chain for code running on a Praxis computer (ticket-5367):
3
- * PRAXIS_API_TOKEN environment variable, then ~/.praxis/credentials. Resolved at call time so a
4
- * token the platform renewed in the file is picked up by an already-running process.
2
+ * Default credential chain for code running on a Praxis computer (ticket-5367, ADR-098 §2):
3
+ * the PRAXIS_API_TOKEN environment variable, then the login file of the environment,
4
+ * `~/.praxis/cli/<env>.json` — the one file `praxis login` writes for a person and the platform writes
5
+ * for a managed login. Resolved at call time so a token the platform renewed in the file is picked up
6
+ * by an already-running process.
5
7
  */
6
8
  export interface ResolvedCredentials {
7
9
  token?: string;
@@ -9,6 +11,13 @@ export interface ResolvedCredentials {
9
11
  }
10
12
  type Env = Record<string, string | undefined>;
11
13
  type ReadFile = (path: string) => string | null;
14
+ /**
15
+ * Which environment's login file applies: PRAXIS_ENV when it names one, otherwise a `-develop.` host in
16
+ * PRAXIS_API_URL means develop and any other host production — the rule apps/cli/src/config/env.ts
17
+ * applies. A PRAXIS_ENV that is not a plain name is no environment at all and is ignored. Pure.
18
+ */
19
+ export declare function credentialsEnv(env: Env): string;
20
+ /** The one login file, the same path the CLI reads for this environment. Null without a home directory. Pure. */
12
21
  export declare function credentialsPath(env: Env): string | null;
13
22
  export declare function resolveDefaultCredentials(env?: Env, readFile?: ReadFile): ResolvedCredentials;
14
23
  export {};
@@ -8,9 +8,29 @@ function defaultReadFile(path) {
8
8
  return null;
9
9
  }
10
10
  }
11
+ /**
12
+ * Which environment's login file applies: PRAXIS_ENV when it names one, otherwise a `-develop.` host in
13
+ * PRAXIS_API_URL means develop and any other host production — the rule apps/cli/src/config/env.ts
14
+ * applies. A PRAXIS_ENV that is not a plain name is no environment at all and is ignored. Pure.
15
+ */
16
+ export function credentialsEnv(env) {
17
+ const declared = nonEmpty(env.PRAXIS_ENV);
18
+ if (declared && /^[A-Za-z0-9_-]+$/.test(declared))
19
+ return declared;
20
+ const apiUrl = nonEmpty(env.PRAXIS_API_URL);
21
+ if (apiUrl) {
22
+ try {
23
+ if (new URL(apiUrl).hostname.includes('-develop.'))
24
+ return 'develop';
25
+ }
26
+ catch { /* a malformed URL is not evidence of develop */ }
27
+ }
28
+ return 'production';
29
+ }
30
+ /** The one login file, the same path the CLI reads for this environment. Null without a home directory. Pure. */
11
31
  export function credentialsPath(env) {
12
32
  const home = nonEmpty(env.HOME) ?? nonEmpty(env.USERPROFILE);
13
- return home ? `${home.replace(/\/$/, '')}/.praxis/credentials` : null;
33
+ return home ? `${home.replace(/[/\\]+$/, '')}/.praxis/cli/${credentialsEnv(env)}.json` : null;
14
34
  }
15
35
  export function resolveDefaultCredentials(env = globalThis.process?.env ?? {}, readFile = defaultReadFile) {
16
36
  const envToken = nonEmpty(env.PRAXIS_API_TOKEN);
@@ -23,7 +43,7 @@ export function resolveDefaultCredentials(env = globalThis.process?.env ?? {}, r
23
43
  return envUrl ? { apiUrl: envUrl } : {};
24
44
  try {
25
45
  const file = JSON.parse(text);
26
- const token = nonEmpty(file.token);
46
+ const token = nonEmpty(file.access_token);
27
47
  const apiUrl = envUrl ?? nonEmpty(file.api_url);
28
48
  return { ...(token ? { token } : {}), ...(apiUrl ? { apiUrl } : {}) };
29
49
  }
@@ -1,6 +1,6 @@
1
1
  import { type SSEEvent } from './sse.js';
2
2
  export interface PraxisOptions {
3
- /** Explicit key. Omitted on a Praxis computer: PRAXIS_API_TOKEN, then ~/.praxis/credentials, are used. */
3
+ /** Explicit key. Omitted on a Praxis computer: PRAXIS_API_TOKEN, then the login file `~/.praxis/cli/<env>.json`, are used. */
4
4
  apiKey?: string;
5
5
  baseUrl?: string;
6
6
  timeoutMs?: number;