@llmnative/agentico 0.25.0 → 0.26.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.
@@ -11,7 +11,11 @@ export type AgenticoMe = {
11
11
  project: string;
12
12
  tenant?: string;
13
13
  namespace: string; /** The namespace has a runner to work on. */
14
- hasRunner?: boolean;
14
+ hasRunner?: boolean; /** What this person administers (CR-027, CR-028). */
15
+ administers?: {
16
+ runners: boolean;
17
+ memories: boolean;
18
+ };
15
19
  };
16
20
  export type AgenticoMemory = {
17
21
  id: string;
@@ -15,6 +15,11 @@ export interface RunnerRecord {
15
15
  /** The id of the platform key on the runner, to revoke it when the runner is removed. */
16
16
  keyId?: string;
17
17
  hostFingerprint?: string;
18
+ /**
19
+ * CR-028: the namespaces that administer it (a tenant's own runner; several: shared). None: a runner of the
20
+ * project, administered by the platform, that any namespace may be put on.
21
+ */
22
+ owners?: string[];
18
23
  createdAt: number;
19
24
  updatedAt: number;
20
25
  }
@@ -25,7 +30,19 @@ export type RunnerEntry = {
25
30
  url: string;
26
31
  isDefault: boolean;
27
32
  draining: boolean;
33
+ owners?: string[];
28
34
  };
35
+ /** Who looks at the runners: the platform (all of them), or the admin of a namespace (its own). */
36
+ export type RunnerViewer = {
37
+ platform: true;
38
+ } | {
39
+ platform: false;
40
+ namespace: string;
41
+ };
42
+ /** Whether a viewer administers a runner. */
43
+ export declare const administersRunner: (viewer: RunnerViewer, record: Pick<RunnerRecord, 'owners'>) => boolean;
44
+ /** Whether a namespace may work on a runner: one of the project, or one it owns. */
45
+ export declare const usableBy: (namespace: string, record: Pick<RunnerRecord, 'owners'>) => boolean;
29
46
  /** Which runner and memory a namespace uses. */
30
47
  export interface NamespaceRecord {
31
48
  id: string;
@@ -100,7 +117,13 @@ export type RunnerTarget = {
100
117
  key: string;
101
118
  };
102
119
  export declare function createFleet(deps: FleetDeps): {
103
- list(): Promise<RunnerEntry[]>;
120
+ /** The runners a viewer administers (all of them without a viewer). */
121
+ list(viewer?: RunnerViewer): Promise<RunnerEntry[]>;
122
+ /** Whether a namespace has a runner to work on (its own, or one of the project). */
123
+ hasRunnerFor(namespace: string): Promise<boolean>;
124
+ /** A namespace becomes an owner of a runner (shared), or stops being one. */
125
+ share(id: string, namespace: string): Promise<void>;
126
+ unshare(id: string, namespace: string): Promise<void>;
104
127
  /** Connects a runner with a pairing code (the key it gives, of this project, stays here). */
105
128
  add(input: {
106
129
  name?: string;
@@ -109,12 +132,12 @@ export declare function createFleet(deps: FleetDeps): {
109
132
  key?: string;
110
133
  }, extra?: {
111
134
  hostFingerprint?: string;
112
- }): Promise<RunnerEntry>;
135
+ }, owner?: string): Promise<RunnerEntry>;
113
136
  /** Asks a runner to connect (device flow, with the project): its admin approves in its console. */
114
137
  startPairing(input: {
115
138
  name?: string;
116
139
  url: string;
117
- }, startedBy: string): Promise<{
140
+ }, startedBy: string, owner?: string): Promise<{
118
141
  id: string;
119
142
  code: string;
120
143
  approveUrl: string;
@@ -131,10 +154,10 @@ export declare function createFleet(deps: FleetDeps): {
131
154
  name?: string;
132
155
  isDefault?: boolean;
133
156
  draining?: boolean;
134
- }): Promise<void>;
157
+ }, viewer?: RunnerViewer): Promise<void>;
135
158
  /** Only a runner no namespace uses: its people would lose their chats and subscriptions there. */
136
- remove(id: string): Promise<void>;
137
- status(id: string): Promise<RunnerStatus>;
159
+ remove(id: string, viewer?: RunnerViewer): Promise<void>;
160
+ status(id: string, viewer?: RunnerViewer): Promise<RunnerStatus>;
138
161
  /**
139
162
  * Puts a namespace on a runner: the tenant there (made if missing) and a key of its own, kept as a secret.
140
163
  * Moving it, the key on the runner before is revoked unless `keepBefore` (chats still going there).
@@ -164,7 +187,7 @@ export declare function createFleet(deps: FleetDeps): {
164
187
  domain: string;
165
188
  access: SshTarget;
166
189
  version?: string;
167
- }, startedBy: string, onProgress?: (progress: InstallProgress) => void): Promise<{
190
+ }, startedBy: string, onProgress?: (progress: InstallProgress) => void, owner?: string): Promise<{
168
191
  installId: string;
169
192
  done: Promise<RunnerEntry>;
170
193
  }>;
@@ -2,7 +2,7 @@ import { type RunnerStatus } from '@llmnative/runner/client';
2
2
  import { type AdapterFactory } from './connections';
3
3
  import { type MemoryEntry, type MemoryViewer } from './memories';
4
4
  import type { AgenticoIdentity, AgenticoKnownTenant, AgenticoRecords, AgenticoSecrets } from './ports';
5
- import { createFleet, type RunnerConnection, type RunnerEntry } from './runners';
5
+ import { createFleet, type RunnerConnection, type RunnerEntry, type RunnerViewer } from './runners';
6
6
  export type AgenticoServerOptions = {
7
7
  /** Who asks, from the sign-in of the host; null: not signed in (401). */
8
8
  identity: (request: Request) => Promise<AgenticoIdentity | null>;
@@ -17,6 +17,15 @@ export type AgenticoServerOptions = {
17
17
  * requests. The session must not be in `authorization` there, which is the provider's.
18
18
  */
19
19
  sessionHeaders?: string[];
20
+ /**
21
+ * Whether the admin of a namespace connects and administers runners and memories of its own (CR-027, CR-028), as
22
+ * in Playbook where every organization keeps its own. Absent: they are the platform's (the CMS, where assigning the
23
+ * infrastructure to a tenant is a platform action), and an admin only uses them.
24
+ */
25
+ tenantOwned?: {
26
+ runners?: boolean;
27
+ memories?: boolean;
28
+ };
20
29
  /** The path the handler is mounted on (e.g. `/api/agentico`): stripped from every request. */
21
30
  basePath?: string;
22
31
  adapter?: AdapterFactory;
@@ -83,7 +92,10 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
83
92
  }>;
84
93
  };
85
94
  fleet: (project: string) => {
86
- list(): Promise<RunnerEntry[]>;
95
+ list(viewer?: RunnerViewer): Promise<RunnerEntry[]>;
96
+ hasRunnerFor(namespace: string): Promise<boolean>;
97
+ share(id: string, namespace: string): Promise<void>;
98
+ unshare(id: string, namespace: string): Promise<void>;
87
99
  add(input: {
88
100
  name?: string;
89
101
  url: string;
@@ -91,11 +103,11 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
91
103
  key?: string;
92
104
  }, extra?: {
93
105
  hostFingerprint?: string;
94
- }): Promise<RunnerEntry>;
106
+ }, owner?: string): Promise<RunnerEntry>;
95
107
  startPairing(input: {
96
108
  name?: string;
97
109
  url: string;
98
- }, startedBy: string): Promise<{
110
+ }, startedBy: string, owner?: string): Promise<{
99
111
  id: string;
100
112
  code: string;
101
113
  approveUrl: string;
@@ -111,9 +123,9 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
111
123
  name?: string;
112
124
  isDefault?: boolean;
113
125
  draining?: boolean;
114
- }): Promise<void>;
115
- remove(id: string): Promise<void>;
116
- status(id: string): Promise<RunnerStatus>;
126
+ }, viewer?: RunnerViewer): Promise<void>;
127
+ remove(id: string, viewer?: RunnerViewer): Promise<void>;
128
+ status(id: string, viewer?: RunnerViewer): Promise<RunnerStatus>;
117
129
  assign(namespace: string, runnerId: string, options?: {
118
130
  keepBefore?: boolean;
119
131
  name?: string;
@@ -130,7 +142,7 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
130
142
  domain: string;
131
143
  access: import("@llmnative/runner/setup").SshTarget;
132
144
  version?: string;
133
- }, startedBy: string, onProgress?: (progress: import("@llmnative/runner/setup").InstallProgress) => void): Promise<{
145
+ }, startedBy: string, onProgress?: (progress: import("@llmnative/runner/setup").InstallProgress) => void, owner?: string): Promise<{
134
146
  installId: string;
135
147
  done: Promise<RunnerEntry>;
136
148
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmnative/agentico",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Agentic chat orchestrator for @llmnative/react apps: a persistent panel that talks with the user and hands the work to host-registered subagents.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -59,7 +59,7 @@
59
59
  "zod": "^3.24.1"
60
60
  },
61
61
  "dependencies": {
62
- "@llmnative/runner": "^1.2.0",
62
+ "@llmnative/runner": "^1.3.0",
63
63
  "zod-to-json-schema": "^3.24.1"
64
64
  },
65
65
  "devDependencies": {