@deepraxis/sdk 0.1.1-dev.64696fb → 0.1.1-dev.6602a93

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.
@@ -626,6 +626,31 @@ export const computersFilesContent = (options) => (options.client ?? client).get
626
626
  url: '/agent/v1/computers/{computer_id}/files/content',
627
627
  ...options
628
628
  });
629
+ /**
630
+ * Write computer file content
631
+ *
632
+ * Write the bytes of one existing file on a computer, only if the file is still the version you read.
633
+ *
634
+ * Send the raw bytes as the body (at most 16 MiB) and the version you edited in `If-Match`: the `version` field of the file listing (`<size>-<mtimeMs>`). The file must already exist; the write replaces it whole and keeps its permissions. A request without `If-Match` answers 428 FILE_VERSION_REQUIRED and nothing is written. When the file has changed since that version, the answer is 412 FILE_VERSION_MISMATCH with `error.current_version`, and nothing is written: read the file again, redo the edit and write with the new version. The version is checked against the file's current size and modification time, then the content digest is bound into the write itself, so a change that lands while the bytes are being written is refused instead of overwritten. Paths under /attachments and /skills are read-only (403 READ_ONLY). A successful write answers the new path, size, mtime and version; use that version for the next write.
635
+ */
636
+ export const updateComputerFileContent = (options) => (options.client ?? client).put({
637
+ bodySerializer: null,
638
+ security: [{
639
+ key: 'BearerAuth',
640
+ scheme: 'bearer',
641
+ type: 'http'
642
+ }, {
643
+ key: 'ApiKeyAuth',
644
+ name: 'X-API-Key',
645
+ type: 'apiKey'
646
+ }],
647
+ url: '/agent/v1/computers/{computer_id}/files/content',
648
+ ...options,
649
+ headers: {
650
+ 'Content-Type': 'application/octet-stream',
651
+ ...options.headers
652
+ }
653
+ });
629
654
  /**
630
655
  * Preview a computer file
631
656
  *
@@ -4278,7 +4303,7 @@ export const getByodPairing = (options) => (options.client ?? client).get({
4278
4303
  /**
4279
4304
  * Claim a pairing and register the phone
4280
4305
  *
4281
- * The phone's own final step after the owner taps Allow: it registers the device and answers the device id, a one-time credential and the control socket url the app dials. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and never call it from server code. The claim is single use: the first successful call spends the code and a second call answers 404, as does an unknown or expired code, so the app must store the credential the moment it arrives because it is never shown again. Connect to socket_url with Authorization: Bearer <credential>; the socket speaks the phone channel (hello, ping/pong, act, result/error) and the device's one connection is replaced if the app reconnects. Example: POST /sandbox/v1/byod/pairings/K7M4PQRS/claim with {platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16'} returns {device_id:'byd_0123456789abcdefghijklmno',credential:'…',socket_url:'wss://49982-byd0123456789abcdefghijklmno--sbx-develop.praxisusercontent.com/'}.
4306
+ * The phone's own final step after the owner taps Allow: it registers the device and answers the device id, a one-time credential and the control socket url the app dials. This path carries no Praxis credential — the one-time code is what it is addressed by — so do not send an API key and never call it from server code. The claim is single use: the first successful call spends the code and a second call answers 404, as does an unknown or expired code, so the app must store the credential the moment it arrives because it is never shown again. Connect to socket_url with Authorization: Bearer <credential>; the socket speaks the phone channel (hello, ping/pong, act, result/error) and the device's one connection is replaced if the app reconnects. Example: POST /sandbox/v1/byod/pairings/K7M4PQRS/claim with {platform:'android',name:'Shelf phone',model:'23127PN0CC',os_version:'16'} returns {device_id:'byd_0123456789abcdefghijklmno',credential:'…',socket_url:'wss://49982-byd0123456789abcdefghijklmno.sandbox-develop.praxisusercontent.com/'}.
4282
4307
  */
4283
4308
  export const claimByodPairing = (options) => (options.client ?? client).post({
4284
4309
  security: [{
@@ -5518,7 +5543,7 @@ export const applicationListGrants = (options) => (options.client ?? client).get
5518
5543
  /**
5519
5544
  * Create grant
5520
5545
  *
5521
- * Record access to an organization-owned database or knowledge base, all organization files (files, id *), or models (models, id *, read only). Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).
5546
+ * Record access to an organization-owned database, knowledge base or agent, all organization files (files, id *), or models (models, id *, read only). Once a Worker has any grant, its platform calls reach only what its grants name; an agent grant at read_write is what lets it issue that agent's customer grant codes. Each resource and optional alias must be unique within this Worker. Foreign and missing resources both return RESOURCE_NOT_FOUND (404); an unavailable resource service returns PROVIDER_CAPACITY (503, retryable).
5522
5547
  */
5523
5548
  export const applicationCreateGrant = (options) => (options.client ?? client).post({
5524
5549
  security: [{
@@ -9741,6 +9766,42 @@ export const devopsProjectsList = (options) => (options?.client ?? client).get({
9741
9766
  url: '/devops/v1/projects',
9742
9767
  ...options
9743
9768
  });
9769
+ /**
9770
+ * Create a project
9771
+ *
9772
+ * Create a delivery project and its two default environments (develop, production). The code lives in one of two places. Our own Git: pass provider platform and package, the id (pkg_...) of a git package in your organization's registry (the registry domain lists packages and creates git libraries); there is no install flow and no connection, the project records the provider, the package and the package's default branch, and from then on pull requests, the merge gate, changes and cloud workspaces use that package and DevOps merges a pull request itself. A package backs at most one project (REPOSITORY_ALREADY_BOUND) and a package that is not a git package of your organization is INVALID_ARGUMENT. If the package has no default branch yet, which is usual for a library imported from elsewhere, pass initialRef, an existing branch such as import: the default branch is created at its head while the project is created, and no change can be opened before it exists. If the default branch already exists the call is refused with DEFAULT_BRANCH_EXISTS, and a missing initialRef branch with REF_NOT_FOUND; neither leaves a project behind. For a package whose project already exists, use devops.projects.initializeDefaultBranch instead. GitHub (the default): pass the connection of a completed GitHub App install and the repository (owner/name) it can see; leave both out to create a project with no repository yet. A name must be kebab-case and unused in the organization (PROJECT_NAME_TAKEN).
9773
+ */
9774
+ export const devopsProjectsCreate = (options) => (options.client ?? client).post({
9775
+ security: [{
9776
+ key: 'devops-bearerAuth',
9777
+ scheme: 'bearer',
9778
+ type: 'http'
9779
+ }],
9780
+ url: '/devops/v1/projects',
9781
+ ...options,
9782
+ headers: {
9783
+ 'Content-Type': 'application/json',
9784
+ ...options.headers
9785
+ }
9786
+ });
9787
+ /**
9788
+ * Create a project's default branch
9789
+ *
9790
+ * Create the default branch of a project on our own Git, once. A git package imported from elsewhere can hold branches and no default branch, and every change is cut from the default branch, so until it exists no change can be opened. The default branch is protected and only DevOps holds the credential that may write it, so this call is the one way to create it: it points the default branch at the head of the existing branch named in from (for example import). It only creates: a default branch that already exists is refused with DEFAULT_BRANCH_EXISTS and is never moved, a from that is not a branch of the repository is REF_NOT_FOUND, and a GitHub project is INVALID_ARGUMENT because GitHub's branches are GitHub's. The push reaches the project like any other push to its default branch. Read the project first (devops.projects.retrieve) for the package's default branch name.
9791
+ */
9792
+ export const devopsProjectsInitializeDefaultBranch = (options) => (options.client ?? client).post({
9793
+ security: [{
9794
+ key: 'devops-bearerAuth',
9795
+ scheme: 'bearer',
9796
+ type: 'http'
9797
+ }],
9798
+ url: '/devops/v1/projects/{id}/default-branch:initialize',
9799
+ ...options,
9800
+ headers: {
9801
+ 'Content-Type': 'application/json',
9802
+ ...options.headers
9803
+ }
9804
+ });
9744
9805
  /**
9745
9806
  * Retrieve a project
9746
9807
  *
@@ -9951,6 +10012,20 @@ export const devopsPromotionsConclude = (options) => (options.client ?? client).
9951
10012
  ...options.headers
9952
10013
  }
9953
10014
  });
10015
+ /**
10016
+ * Get the checkout credential of a running promotion
10017
+ *
10018
+ * Issue the credential the deploy machine fetches a platform-Git project's code with. The caller is the deploy machine itself, during a run: its `devops/prepare` step sends the API key it already holds and receives the clone URL of the project's repository plus a pull-only credential for exactly that one repository. The credential lives 15 minutes and is issued again on every request, so it never sits in the run's stored input or log, and a leaked copy is useless almost at once. A run that needs the code later, such as an engine checkout after a long install, asks again. It answers only while the promotion is deploying (a rollback is a promotion and deploys too) or halted; a promotion that is queued, waiting for approval, observing or finished is refused with PROMOTION_NOT_RUNNING, because no machine should be fetching code for it. A project whose code is on GitHub is refused with SOURCE_NOT_PLATFORM: its checkout uses the GitHub App token, not this. The key must belong to the promotion's organization, the same check as reading the promotion with `praxis api devops promotion get <id>`. People do not need this call: to read a platform project's code use the code browser calls instead.
10019
+ */
10020
+ export const devopsPromotionsCheckoutCredential = (options) => (options.client ?? client).post({
10021
+ security: [{
10022
+ key: 'devops-bearerAuth',
10023
+ scheme: 'bearer',
10024
+ type: 'http'
10025
+ }],
10026
+ url: '/devops/v1/promotions/{id}:checkoutCredential',
10027
+ ...options
10028
+ });
9954
10029
  /**
9955
10030
  * List a promotion's rollouts
9956
10031
  *
@@ -10530,7 +10605,7 @@ export const devopsPullRequestsRerunGate = (options) => (options.client ?? clien
10530
10605
  /**
10531
10606
  * Merge a pull request through its gate
10532
10607
  *
10533
- * Land a pull request by having DevOps call GitHub, so the merge goes through the platform's own merge gate instead of around it. The gate is the permission: while the gate is pending or failed the merge is refused with GATE_NOT_PASSED, and a pull request that is already merged or closed is refused with PULL_REQUEST_NOT_OPEN. Only the commit the gate decided on may land — that commit is sent to GitHub as the merge sha, so a head that moved underneath is refused with HEAD_MOVED rather than merged untested — and GitHub's own refusal, such as a conflict, comes back as MERGE_REFUSED carrying its words. method picks the merge shape and defaults to merge. queue true does not merge now: it puts the pull request into its (project, base) merge queue, where the commit that eventually lands is one GitHub built from the current base and a test run proved. Send requestId to make a retry safe — a retry that reaches a pull request DevOps itself already merged answers that merge without calling GitHub again; it does not make the merge wait. Merging something already merged by somebody else stays a refusal rather than a replay.
10608
+ * Land a pull request by having DevOps call GitHub, so the merge goes through the platform's own merge gate instead of around it. The gate is the permission: while the gate is pending or failed the merge is refused with GATE_NOT_PASSED, and a pull request that is already merged or closed is refused with PULL_REQUEST_NOT_OPEN. Only the commit the gate decided on may land — that commit is sent to GitHub as the merge sha, so a head that moved underneath is refused with HEAD_MOVED rather than merged untested — and GitHub's own refusal, such as a conflict, comes back as MERGE_REFUSED carrying its words. method picks the merge shape; on GitHub it defaults to rebase. A project on our own Git (provider platform) merges by squash only: no method means squash, and rebase or merge is refused with INVALID_ARGUMENT naming squash. queue true does not merge now: it puts the pull request into its (project, base) merge queue, where the commit that eventually lands is one GitHub built from the current base and a test run proved. Send requestId to make a retry safe — a retry that reaches a pull request DevOps itself already merged answers that merge without calling GitHub again; it does not make the merge wait. Merging something already merged by somebody else stays a refusal rather than a replay.
10534
10609
  */
10535
10610
  export const devopsPullRequestsMerge = (options) => (options.client ?? client).post({
10536
10611
  security: [{
@@ -10546,9 +10621,9 @@ export const devopsPullRequestsMerge = (options) => (options.client ?? client).p
10546
10621
  }
10547
10622
  });
10548
10623
  /**
10549
- * Record a gatekeeper's verdict on a direct change
10624
+ * Record a review verdict on a pull request
10550
10625
  *
10551
- * A gatekeeper's judgement of a change declared direct — the one gate check a person answers, because a direct change has no flag to hold it back. Send result passed to let it through, or failed to hold it, with reason saying in a sentence a reviewer can act on why; the reason becomes the message of the gate's exposure-judged check. The verdict is about ONE commit: headSha must be the pull request's current head, and a verdict for any other commit is refused with INVALID_ARGUMENT rather than applied, because a judgement of a version nobody reviewed must never pass the version that is there now — so a recorded verdict stops applying the moment the head moves, and the new head must be judged on its own. Recording it decides the gate again, so a passed verdict makes the gate passed once every other check has too, and the answer is the pull request with the gate it now reaches. A passed verdict for a change whose tests have not run leaves the gate pending: a person's judgement never outvotes a missing test.
10626
+ * Record a reviewer's verdict on a pull request, after the fact (Sean 2026-11-24). The merge gate no longer waits for it: exposure-judged is decided by machine from the declaration for every kind of exposure, so a pull request merges without any verdict. This call is the review record — send result passed or failed with reason saying in a sentence a reviewer can act on why. It is stored on the pull request as review and announced with the event devops.pullRequest.reviewed. A failed verdict on an already merged pull request is a finding for follow-up (the event says finding true): the merge stands, nothing is un-merged, and a rollback or a fix is asked for on the ticket. headSha must be the pull request's head, and a verdict for another commit is refused with INVALID_ARGUMENT. List the merged pull requests nobody reviewed with pullRequests.list reviewed=false.
10552
10627
  */
10553
10628
  export const devopsPullRequestsRecordVerdict = (options) => (options.client ?? client).post({
10554
10629
  security: [{
@@ -10744,7 +10819,7 @@ export const devopsTestRunsRetryFailed = (options) => (options.client ?? client)
10744
10819
  /**
10745
10820
  * List a project's stage workspaces
10746
10821
  *
10747
- * List the project's three stage workspaces — development, integration and runtime — in that order. Each row says how a machine of that stage is built and how long it lives; it is configuration, not a machine, so listing never opens one. A project whose rows do not exist yet gets all three materialized on this call with the defaults (size medium, prebuild on, idle timeout 30 minutes, retention 7 days), and a later call reads those same rows back rather than replacing them. Read one stage with the workspace retrieve; the machines actually running are units.
10822
+ * List the project's three stage workspaces — development, integration and release — in that order. Each row says how a machine of that stage is built and how long it lives; it is configuration, not a machine, so listing never opens one. A project whose rows do not exist yet gets all three materialized on this call with the defaults (size medium, prebuild on, idle timeout 30 minutes, retention 7 days), and a later call reads those same rows back rather than replacing them. Read one stage with the workspace retrieve; the machines actually running are units.
10748
10823
  */
10749
10824
  export const devopsWorkspacesList = (options) => (options.client ?? client).get({
10750
10825
  security: [{
@@ -10819,6 +10894,20 @@ export const devopsUnitsCreate = (options) => (options.client ?? client).post({
10819
10894
  ...options.headers
10820
10895
  }
10821
10896
  });
10897
+ /**
10898
+ * List a project's cleanup ledger
10899
+ *
10900
+ * List what the daily cleanup job removed or archived for the project, newest decision first: merged branches deleted when their pull request merged, stopped units deleted after the project's window, test evidence past its age, and prebuilds beyond the kept versions. Each row names the kind of thing, which one, whether it was archived (the record stays, the heavy content goes) or deleted, the reason and when it was decided and done; error is set while the last attempt failed and the job will try again. The ledger is read-only: the job is its only writer, and a project changes what is kept through settings.retention on devops.projects.update. A project with no row has had nothing cleaned.
10901
+ */
10902
+ export const devopsCleanupsList = (options) => (options.client ?? client).get({
10903
+ security: [{
10904
+ key: 'devops-bearerAuth',
10905
+ scheme: 'bearer',
10906
+ type: 'http'
10907
+ }],
10908
+ url: '/devops/v1/projects/{project}/cleanups',
10909
+ ...options
10910
+ });
10822
10911
  /**
10823
10912
  * Delete a unit
10824
10913
  *
@@ -12459,7 +12548,7 @@ export const registryPackagesVersionsCreate = (options) => (options.client ?? cl
12459
12548
  /**
12460
12549
  * Create a git credential
12461
12550
  *
12462
- * 给一个 git 包换一个短期的 git 凭据,用来 git clone / git push。access 选 pull(只读,用来克隆和拉取)或 push(推分支);一个 push 凭据只能推,克隆要另取 pull 凭据。push-protected(更新受保护分支)暂不发放,请推到别的分支再合并,请求它返回 400。ttl_seconds 是有效秒数,1-3600,默认 3600;到期后重新调用本接口,不要缓存过期的凭据。返回的 password 是敏感信息,只出现这一次,不要写进日志或提交。用法:git clone https://x-access-token:$PASSWORD@host/git/组织/库/包.git,或把 url 里的地址配上 http.extraHeader。组织未开放 git 功能返回 409;另一个组织的包、已被删除的包和 oci 包都返回 404。同一个 package_id 可以多次取,每次是一个新凭据,互不影响。
12551
+ * 给一个 git 包换一个短期的 git 凭据,用来 git clone / git push。access 选 pull(只读,用来克隆和拉取)或 push(推分支,同时可以克隆和拉取)。push-protected(更新受保护分支)暂不发放,请推到别的分支再合并,请求它返回 400。ttl_seconds 是有效秒数,1-3600,默认 3600;到期后重新调用本接口,不要缓存过期的凭据。返回的 password 是敏感信息,只出现这一次,不要写进日志或提交。用法:git clone https://x-access-token:$PASSWORD@host/git/组织/库/包.git,或把 url 里的地址配上 http.extraHeader。组织未开放 git 功能返回 409;另一个组织的包、已被删除的包和 oci 包都返回 404。同一个 package_id 可以多次取,每次是一个新凭据,互不影响。
12463
12552
  */
12464
12553
  export const registryPackagesGitCredentialCreate = (options) => (options.client ?? client).post({
12465
12554
  security: [{
@@ -15635,7 +15724,7 @@ export const vaultListTemplates = (options) => (options?.client ?? client).get({
15635
15724
  /**
15636
15725
  * Create authorization
15637
15726
  *
15638
- * Connect an OAuth service to an active vault using either an OAuth template or a resource URL. Unlike Anthropic mcp_oauth credential creation, this flow obtains tokens through user consent rather than accepting an auth token bundle; compatible mcp_oauth creation and updates return 501. Open connect_url, then poll praxis.vault.authorizations.retrieve until completed, failed or expired; only completed supplies the resulting secret_id. This stores a credential but does not enable vault-backed MCP authentication in Agent sessions.
15727
+ * Connect an OAuth service to an active vault using either an OAuth template or a resource URL. Unlike Anthropic mcp_oauth credential creation, this flow obtains tokens through user consent rather than accepting an auth token bundle; compatible mcp_oauth creation and updates return 501. Open connect_url, then poll praxis.vault.authorizations.retrieve until completed, failed or expired; only completed supplies the resulting secret_id. The resulting oauth secret serves vault-backed MCP authentication — an Agent session or deployment whose vault_ids include this vault sends it to the MCP server whose URL equals this authorization's resource URL (normalized), and the platform refreshes the token once when that server answers 401.
15639
15728
  */
15640
15729
  export const vaultCreateAuthorization = (options) => (options.client ?? client).post({
15641
15730
  security: [{