@mitralab.io/sdk-core 0.2.9-beta.1 → 0.2.10-beta.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/CHANGELOG.md +18 -0
- package/README.md +9 -1
- package/contracts/README.md +9 -0
- package/contracts/manifest.json +11 -1
- package/contracts/v0.2.10-beta.0/sdk-parity.json +2902 -0
- package/contracts/v0.2.9/sdk-parity.json +2902 -0
- package/dist/index.cjs +59 -0
- package/dist/index.d.cts +48 -1
- package/dist/index.d.ts +48 -1
- package/dist/index.js +59 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.2.10-beta.0
|
|
6
|
+
|
|
7
|
+
- `agentCredentials.usage(provider, { scope })` reads the last subscription reading a chat on that
|
|
8
|
+
credential reported (`GET /api/v1/credentials/{provider}/usage`), with no chat open:
|
|
9
|
+
`{ harness, observedAt, status, windows: [{ kind, usedPercent, resetsAt, windowSeconds }] }`.
|
|
10
|
+
`windows` carries every window the provider reports (Claude: `FIVE_HOUR`, `WEEKLY`,
|
|
11
|
+
`WEEKLY_OPUS` and any other it sends; Codex: its primary and secondary, named by duration) and
|
|
12
|
+
`status` is the provider's own (Claude: `allowed`, `allowed_warning`, `rejected`; Codex: the
|
|
13
|
+
limit it reports reached, or null). It resolves to `null` while no turn on the provider's
|
|
14
|
+
subscription login has reported one (the Copilot's `CREDENTIAL_USAGE_NOT_FOUND`); any other
|
|
15
|
+
failure, a plain 404 included, still rejects.
|
|
16
|
+
- `agentConnections.usage(id, provider)` reads the same for an app connection
|
|
17
|
+
(`GET /api/v1/connections/{id}/providers/{provider}/usage`).
|
|
18
|
+
- The Agent session emits `providerUsage`, in the same shape, when the chat's box reports the
|
|
19
|
+
reading during a turn. It comes only on the direct channel of a business agent chat, never on
|
|
20
|
+
the Copilot stream a chat falls back to. A reading that does not parse is dropped, never an
|
|
21
|
+
error.
|
|
22
|
+
|
|
5
23
|
## 0.2.9-beta.1
|
|
6
24
|
|
|
7
25
|
- Only a business agent's chat (one with an `agentId`) is created with `runtime: "T3"` and asks
|
package/README.md
CHANGED
|
@@ -32,7 +32,8 @@ The package contains:
|
|
|
32
32
|
- Function scheduling composed into single-Function create, patch, get, and list
|
|
33
33
|
- business agents and workflows
|
|
34
34
|
- integration configs, resources, templates, tests, proxying, and executions
|
|
35
|
-
- Copilot tasks, messages, credentials, models,
|
|
35
|
+
- Copilot tasks, messages, credentials and the last subscription window each one reported, models,
|
|
36
|
+
and app connections
|
|
36
37
|
- an Agent task live-session state machine with bounded queue and `sendAndWait`, and the direct
|
|
37
38
|
channel to the chat's box
|
|
38
39
|
- Messenger notifications and composed safe app context
|
|
@@ -95,6 +96,13 @@ receives the box log. A new business agent's chat is created with `runtime: "T3"
|
|
|
95
96
|
on its box, unless the session names a runtime; the Copilot refuses T3 for any other chat
|
|
96
97
|
(`RUNTIME_REQUIRES_AGENT_APP`).
|
|
97
98
|
|
|
99
|
+
`session({ taskId })` reads the task before it opens anything, so the same rule holds for an
|
|
100
|
+
existing chat: with no `agentId` it never asks for `/channel`; with an `agentId` it asks and the
|
|
101
|
+
Copilot decides. A chat the Copilot will not serve on its box (not on T3, answered for example
|
|
102
|
+
with `RUNTIME_NOT_T3`) is a raw `channelDeclined` with `reason: "unavailable"` and the Copilot's
|
|
103
|
+
message, and the session goes on through the event source and REST inputs, with no `error`
|
|
104
|
+
event for the app.
|
|
105
|
+
|
|
98
106
|
- **Transport.** `websocket` uses the box socket. `http` uses the box's HTTP routes next to the
|
|
99
107
|
socket path: `POST .../api/mitra/chat/messages` to send and `GET .../api/mitra/chat/events`
|
|
100
108
|
(SSE, from a sequence) to read, keeping the `grant` and `ticket` query of the channel URL.
|
package/contracts/README.md
CHANGED
|
@@ -24,6 +24,15 @@ publishes.
|
|
|
24
24
|
|
|
25
25
|
## Versions
|
|
26
26
|
|
|
27
|
+
- `0.2.10-beta.0` is the `0.2.9` parity surface republished with the subscription usage:
|
|
28
|
+
`agentCredentials.usage`, `agentConnections.usage` and the `providerUsage` session event, every
|
|
29
|
+
window with the provider status, which the parity cases do not cover. Same parity cases; the
|
|
30
|
+
version exists so a consumer pinning the package can pin a corpus with the same number.
|
|
31
|
+
|
|
32
|
+
- `0.2.9` is the stable release of the `0.2.9-beta.1` surface: the direct box channel on the
|
|
33
|
+
Agent session, limited to business agent chats. Same parity cases; the version exists so a
|
|
34
|
+
consumer pinning the stable package can pin a corpus with the same number.
|
|
35
|
+
|
|
27
36
|
- `0.2.9-beta.1` is the `0.2.9-beta.0` parity surface republished with the direct channel
|
|
28
37
|
limited to business agent chats and the box refusals of the final contract. Same parity
|
|
29
38
|
cases; the version exists so a consumer pinning the package can pin a corpus with the same number.
|
package/contracts/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contract": "SDK-PARITY-001",
|
|
3
|
-
"current": "0.2.
|
|
3
|
+
"current": "0.2.10-beta.0",
|
|
4
4
|
"versions": [
|
|
5
5
|
{
|
|
6
6
|
"version": "0.1.0",
|
|
@@ -80,6 +80,16 @@
|
|
|
80
80
|
"version": "0.2.9-beta.1",
|
|
81
81
|
"path": "v0.2.9-beta.1/sdk-parity.json",
|
|
82
82
|
"sha256": "f0ec4130c399f7102ad20b6dc54ed50da957003d19d3ab811d013ce89b5cde06"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"version": "0.2.9",
|
|
86
|
+
"path": "v0.2.9/sdk-parity.json",
|
|
87
|
+
"sha256": "aa81d033dc4bf7ccd30d712568e6bccf1319a208e9072c40369a86b090bc5c13"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"version": "0.2.10-beta.0",
|
|
91
|
+
"path": "v0.2.10-beta.0/sdk-parity.json",
|
|
92
|
+
"sha256": "f52f93de7457bef2c1dff6f3817d32cea473434d1ad7f9906c5c5d6682db410f"
|
|
83
93
|
}
|
|
84
94
|
]
|
|
85
95
|
}
|