@nyte-ai/sdk 0.0.0-stage → 0.0.19
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/LICENSE +21 -0
- package/THIRD-PARTY-NOTICES.md +866 -0
- package/dist/chunks/capability-2q3s96kg.js +57 -0
- package/dist/chunks/capability-9747w1b1.js +55 -0
- package/dist/chunks/capability-agj3gwwv.js +134 -0
- package/dist/chunks/capability-artgq59v.js +232 -0
- package/dist/chunks/capability-b52hty54.js +17 -0
- package/dist/chunks/capability-ctnsbfx9.js +203 -0
- package/dist/chunks/capability-ec663cyt.js +208 -0
- package/dist/chunks/capability-ke5yk1as.js +165 -0
- package/dist/chunks/capability-mr5m2wn2.js +6 -0
- package/dist/chunks/capability-nh422cp0.js +35 -0
- package/dist/chunks/capability-swbs68d8.js +32 -0
- package/dist/chunks/capability-t9k5jy3d.js +96 -0
- package/dist/chunks/capability-xavf3m2f.js +243 -0
- package/dist/src/capability.d.ts +2 -0
- package/dist/src/capability.js +6 -0
- package/dist/src/client.d.ts +13 -0
- package/dist/src/client.js +14 -0
- package/dist/src/connect.d.ts +2 -0
- package/dist/src/connect.js +15 -0
- package/dist/src/history.d.ts +14 -0
- package/dist/src/history.js +7 -0
- package/dist/src/index.client.d.ts +10 -0
- package/dist/src/index.client.js +57 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.js +58 -0
- package/dist/src/index.web.d.ts +8 -0
- package/dist/src/index.web.js +63 -0
- package/dist/src/journal.d.ts +15 -0
- package/dist/src/journal.js +9 -0
- package/dist/src/login.d.ts +8 -0
- package/dist/src/login.js +6 -0
- package/dist/src/paint-spans.d.ts +11 -0
- package/dist/src/paint-spans.js +6 -0
- package/dist/src/part.d.ts +4 -0
- package/dist/src/part.js +6 -0
- package/dist/src/receipts.d.ts +9 -0
- package/dist/src/receipts.js +16 -0
- package/dist/src/rows.d.ts +37 -0
- package/dist/src/rows.js +12 -0
- package/dist/src/surface.d.ts +12 -0
- package/dist/src/surface.js +39 -0
- package/dist/src/watch.d.ts +26 -0
- package/dist/src/watch.js +14 -0
- package/dist/src/workspace.d.ts +4 -0
- package/dist/src/workspace.js +9 -0
- package/package.json +59 -3
- package/README.md +0 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ByteReader, Disposer, HostView, Json, OutputFrame, RequestOptions } from "@nyte-ai/schema";
|
|
2
|
+
import type { ByteName, CallName, Declarations, FrameName, OperationInput, OperationName, OperationOutput, Transport } from "@nyte-ai/protocol";
|
|
3
|
+
type LinkState = HostView["link"];
|
|
4
|
+
type RetryName = {
|
|
5
|
+
[N in OperationName]: Declarations[N] extends {
|
|
6
|
+
readonly wait: true;
|
|
7
|
+
} ? N : Declarations[N] extends {
|
|
8
|
+
readonly recovery: "replay";
|
|
9
|
+
} ? OperationInput<N> extends {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
} ? N : never : never;
|
|
12
|
+
}[OperationName];
|
|
13
|
+
export interface Link {
|
|
14
|
+
current(): LinkState;
|
|
15
|
+
lost(): void;
|
|
16
|
+
restored(): void;
|
|
17
|
+
close(reason: "client" | "revoked" | "host-gone"): void;
|
|
18
|
+
subscribe(listener: (state: LinkState) => void): Disposer;
|
|
19
|
+
readonly signal: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
export interface Rows {
|
|
22
|
+
readonly link: Link;
|
|
23
|
+
operations(): string | null;
|
|
24
|
+
call<N extends CallName>(name: N, input: OperationInput<N>, options?: RequestOptions): Promise<OperationOutput<N>>;
|
|
25
|
+
wait<N extends RetryName>(name: N, input: OperationInput<N>, options?: RequestOptions): Promise<OperationOutput<N>>;
|
|
26
|
+
upload<N extends CallName>(name: N, input: OperationInput<N>, body: Uint8Array): Promise<OperationOutput<N>>;
|
|
27
|
+
bytes<N extends ByteName>(name: N, input: OperationInput<N>, options?: RequestOptions): Promise<ByteReader>;
|
|
28
|
+
frames<N extends FrameName>(name: N, input: OperationInput<N>): AsyncIterable<OperationOutput<N>>;
|
|
29
|
+
/** Frames that resume across link losses; `opened` is a stream of this watch already open, read before any is opened. */
|
|
30
|
+
watch<N extends FrameName>(name: N, input: OperationInput<N>, opened?: AsyncIterator<Json>): AsyncIterable<OperationOutput<N>>;
|
|
31
|
+
output(input: OperationInput<"job.output">): AsyncIterable<OutputFrame>;
|
|
32
|
+
}
|
|
33
|
+
export declare function createLink(): Link;
|
|
34
|
+
export declare function createRows(transport: Transport, link: Link): Rows;
|
|
35
|
+
export declare function retryDelay(attempts: number): number;
|
|
36
|
+
export declare function backoff(link: Link, ms: number, signal: AbortSignal): Promise<void>;
|
|
37
|
+
export {};
|
package/dist/src/rows.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { ActionContext, ActionOutput, ActionSchemas, Agent, Available, BrowserApi, ClientApi, Command, ConnectOptions, Connection, ContributionTable, Decide, Declared, Durable, EnvironmentProvider, EnvironmentWrap, ExecutionEnv, FileBatch, FilesApi, GitApi, GitHubAccountApi, GitHubApi, Head, HookEntry, HookHandler, HookName, HookTable, Host, Job, Jobs, Keybinding, ListenOptions, Listener, Login, McpApi, ModelContextPolicy, ModelsApi, ObjectStore, Observe, OpenOptions, Page, Part, PartActions, PartDefinition, PartState, Plugin, PluginApi, PluginFile, PluginsApi, PluginStorage, PrincipalsApi, PromptSection, Receipt, RefStore, Registries, Registry, RegistryDraft, Renderer, RequestJournal, Resources, Row, Run, SendReceipt, Session, Sessions, Setting, SettingDefinition, SettingsApi, Side, SideTable, Skill, SnapshotsApi, Store, StoreConnection, ToolDefinition, ToolInvocation, Transform, Workspace, Workspaces, } from "@nyte-ai/core";
|
|
2
|
+
export type { ActOutcome, Activation, AddOutcome, AdvanceReport, AgentInfo, Authority, Availability, Awaitable, BackgroundItem, BatchOutcome, BlameView, BlobId, ByteReader, CallId, Capability, CatalogGeneration, ChangeSet, ChangeSource, CommandCompletion, CommandInfo, CommandOutcome, CommitBody, CommitId, CompactionPlan, Configuration, ConfigurationPatch, ConfigureOutcome, ConsoleEntry, ContextView, CreateHeadOutcome, CredentialSource, Cursor, Decision, Declaration, DecodedObjectView, Delivery, DiffOptions, Disposer, DocumentRevision, DurableEvent, EndReason, EnvironmentIdentity, ExcerptSource, Execution, Failure, ExecutionCoverage, FileDocument, FileEntryView, FileEvent, FileStatus, FileVersion, ForgetOutcome, FormatOutcome, GitCommitId, GitOutcome, GitRefsView, GitRevision, GitScope, GitStatus, GitWrite, GitHubAccount, GitHubAccountState, GitHubCheck, GitHubDeviceCode, GitHubPullRequest, GitHubPullRequestContext, GitHubPullRequestInput, GitHubPullRequestOutcome, GitHubRepository, GitHubState, HeadInfo, HeadName, HostDescription, HostId, HostView, Hunk, Id, IdentityChallenge, Infer, IntegrityReport, JobEnd, JobId, JobKey, JobState, JobView, JournalEntry, Json, LineStat, LoginMethod, McpChange, McpExposure, McpExposureName, McpOAuthConfig, McpScope, McpServerConfig, McpServerState, McpServerView, McpToolView, McpView, MergeOutcome, Message, MessageId, MessageSource, ModelAccount, ModelCatalogView, ModelInfo, ModelListing, ModelRef, ModelRequest, ModelRequestInput, ModelRequestOutcome, MoveOptions, MoveOutcome, ObjectId, OutputFrame, Owned, PageId, PageOutcome, PageSnapshot, PageView, Paged, ParentFilter, PartId, PartStatus, PartView, PatchEntry, PatchEvent, PatchSet, Placement, PluginCheckReport, PluginLoadOutcome, PluginReplacementReport, Position, PrincipalId, PrincipalView, PromptOverride, ProviderUsage, ReceiptId, Ref, RefUpdate, RemoveHeadOutcome, RemoveSessionOutcome, RepairPage, RequestOptions, Revision, RunEnd, RunId, RunView, ScanFrame, Schedule, SdkErrorCode, Schema, SearchFrame, SearchInput, SendOptions, Seq, SessionCatalogView, SessionEvent, SessionId, SessionInfo, SessionView, SetOutcome, SettingInfo, SettingOutcome, SkillInfo, SnapshotId, StopOutcome, Submission, SubmitDraft, Thinking, ToolCall, ToolClass, ToolContent, ToolInfo, ToolOutcome, ToolPartState, ToolProgress, ToolResult, Transcript, TreeNode, TreeView, TurnId, TurnInfo, UpdateOutcome, Usage, UserContent, UserStatus, ValidationIssue, ViewOptions, WaitOutcome, WaitTarget, WorkspaceCatalogView, WorkspaceCommandOutcome, WorkspaceId, WorkspaceInfo, WorkspaceInspection, WorkspaceTarget, WriteOutcome, } from "@nyte-ai/schema";
|
|
3
|
+
export { dev, watchStore } from "@nyte-ai/core";
|
|
4
|
+
export type { WatchStore } from "@nyte-ai/core";
|
|
5
|
+
export { clearSpans, enableTracing, followTrace, followedTrace, readSpans, SPAN_NAMES, startSpan, traced, tracing, } from "@nyte-ai/core";
|
|
6
|
+
export type { EndSpan, Span, SpanDetail, SpanName } from "@nyte-ai/core";
|
|
7
|
+
export { SdkError } from "@nyte-ai/schema";
|
|
8
|
+
export { operationsDigest } from "@nyte-ai/protocol";
|
|
9
|
+
export { pagedViews } from "./history.ts";
|
|
10
|
+
export { tracePaints } from "./paint-spans.ts";
|
|
11
|
+
export type { PagedViews } from "./history.ts";
|
|
12
|
+
export type { DevRow } from "@nyte-ai/core";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dev2,
|
|
3
|
+
watchStore2,
|
|
4
|
+
clearSpans2,
|
|
5
|
+
enableTracing2,
|
|
6
|
+
followTrace2,
|
|
7
|
+
followedTrace2,
|
|
8
|
+
readSpans2,
|
|
9
|
+
SPAN_NAMES2,
|
|
10
|
+
startSpan2,
|
|
11
|
+
traced2,
|
|
12
|
+
tracing2,
|
|
13
|
+
SdkError2,
|
|
14
|
+
operationsDigest2
|
|
15
|
+
} from "../chunks/capability-b52hty54.js";
|
|
16
|
+
import {
|
|
17
|
+
tracePaints2
|
|
18
|
+
} from "../chunks/capability-swbs68d8.js";
|
|
19
|
+
import {
|
|
20
|
+
pagedViews2
|
|
21
|
+
} from "../chunks/capability-t9k5jy3d.js";
|
|
22
|
+
import"../chunks/capability-ctnsbfx9.js";
|
|
23
|
+
export {
|
|
24
|
+
SPAN_NAMES2 as SPAN_NAMES,
|
|
25
|
+
SdkError2 as SdkError,
|
|
26
|
+
clearSpans2 as clearSpans,
|
|
27
|
+
dev2 as dev,
|
|
28
|
+
enableTracing2 as enableTracing,
|
|
29
|
+
followTrace2 as followTrace,
|
|
30
|
+
followedTrace2 as followedTrace,
|
|
31
|
+
operationsDigest2 as operationsDigest,
|
|
32
|
+
pagedViews2 as pagedViews,
|
|
33
|
+
readSpans2 as readSpans,
|
|
34
|
+
startSpan2 as startSpan,
|
|
35
|
+
tracePaints2 as tracePaints,
|
|
36
|
+
traced2 as traced,
|
|
37
|
+
tracing2 as tracing,
|
|
38
|
+
watchStore2 as watchStore
|
|
39
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Disposer, HeadName, HostView, Json, Message, SessionId, SessionView, ViewOptions } from "@nyte-ai/schema";
|
|
2
|
+
import type { JournalLoop } from "./journal.ts";
|
|
3
|
+
import type { Rows } from "./rows.ts";
|
|
4
|
+
export type Sink<T> = {
|
|
5
|
+
next(value: T): void;
|
|
6
|
+
end(): void;
|
|
7
|
+
fail(error: Error): void;
|
|
8
|
+
};
|
|
9
|
+
interface ViewHold {
|
|
10
|
+
view(): SessionView | null;
|
|
11
|
+
subscribe(sink: Sink<SessionView>): Disposer;
|
|
12
|
+
}
|
|
13
|
+
export interface HeadViews {
|
|
14
|
+
acquire(session: SessionId, head: HeadName, options?: ViewOptions): ViewHold;
|
|
15
|
+
}
|
|
16
|
+
export declare function createHeadViews(rows: Rows): HeadViews;
|
|
17
|
+
export declare function watchHead(views: HeadViews, journal: JournalLoop, input: {
|
|
18
|
+
readonly session: SessionId;
|
|
19
|
+
readonly head: HeadName;
|
|
20
|
+
readonly options?: ViewOptions;
|
|
21
|
+
}): AsyncIterable<SessionView>;
|
|
22
|
+
export declare function watchHost(rows: Rows, opened?: AsyncIterator<Json>): AsyncIterable<HostView>;
|
|
23
|
+
/** Returns `view` with the sends the journal still holds: one the view carries replaces its message there, one it does not carry joins its messages, and one that is the view's `leadingPrompt` is left to it. */
|
|
24
|
+
export declare function withUnsent(view: SessionView, unsent: readonly Message[]): SessionView;
|
|
25
|
+
export declare function pushed<T>(start: (sink: Sink<T>) => () => void): AsyncIterable<T>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createHeadViews2,
|
|
3
|
+
watchHead2,
|
|
4
|
+
watchHost2,
|
|
5
|
+
withUnsent2,
|
|
6
|
+
pushed2
|
|
7
|
+
} from "../chunks/capability-ctnsbfx9.js";
|
|
8
|
+
export {
|
|
9
|
+
createHeadViews2 as createHeadViews,
|
|
10
|
+
pushed2 as pushed,
|
|
11
|
+
watchHead2 as watchHead,
|
|
12
|
+
watchHost2 as watchHost,
|
|
13
|
+
withUnsent2 as withUnsent
|
|
14
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyte-ai/sdk",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.19",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/interfaces-lab/nyte.git",
|
|
9
|
+
"directory": "packages/sdk"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"THIRD-PARTY-NOTICES.md"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"react-native": {
|
|
20
|
+
"types": "./dist/src/index.web.d.ts",
|
|
21
|
+
"import": "./dist/src/index.web.js"
|
|
22
|
+
},
|
|
23
|
+
"browser": {
|
|
24
|
+
"types": "./dist/src/index.web.d.ts",
|
|
25
|
+
"import": "./dist/src/index.web.js"
|
|
26
|
+
},
|
|
27
|
+
"default": {
|
|
28
|
+
"types": "./dist/src/index.d.ts",
|
|
29
|
+
"import": "./dist/src/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./client": {
|
|
33
|
+
"types": "./dist/src/index.client.d.ts",
|
|
34
|
+
"import": "./dist/src/index.client.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public",
|
|
39
|
+
"provenance": true
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@nyte-ai/core": "0.0.19",
|
|
43
|
+
"@nyte-ai/host": "0.0.19",
|
|
44
|
+
"@nyte-ai/protocol": "0.0.19",
|
|
45
|
+
"@nyte-ai/schema": "0.0.19"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@nyte-ai/bench": "0.0.0",
|
|
49
|
+
"@types/node": "^26.6.5",
|
|
50
|
+
"typescript": "6.0.3",
|
|
51
|
+
"vitest": "^5.0.5"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=26.4.0"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"clean": "rm -rf node_modules .turbo",
|
|
58
|
+
"typecheck": "tsrs --noEmit && tsrs --noEmit -p tsconfig.web.json",
|
|
59
|
+
"test": "vitest --run",
|
|
60
|
+
"build:package": "bun ../../scripts/sdk-packages.mjs build sdk"
|
|
61
|
+
}
|
|
6
62
|
}
|
package/README.md
DELETED