@llmnative/agentico 0.24.1 → 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.
@@ -10,7 +10,12 @@ export type AgenticoMe = {
10
10
  role: AgenticoRole;
11
11
  project: string;
12
12
  tenant?: string;
13
- namespace: string;
13
+ namespace: string; /** The namespace has a runner to work on. */
14
+ hasRunner?: boolean; /** What this person administers (CR-027, CR-028). */
15
+ administers?: {
16
+ runners: boolean;
17
+ memories: boolean;
18
+ };
14
19
  };
15
20
  export type AgenticoMemory = {
16
21
  id: string;
@@ -7,5 +7,5 @@ export { createConnections, defaultAdapterFactory, CONNECTIONS } from './connect
7
7
  export type { AdapterFactory, Connections, ConnectionsSnapshot, ConnectionResult } from './connections';
8
8
  export { createFleet, FleetError, normalizeRunnerUrl, NAMESPACE_KEY_PERMISSIONS, RUNNERS, NAMESPACES } from './runners';
9
9
  export type { Fleet, RunnerEntry, RunnerRecord, NamespaceRecord, RunnerConnection, RunnerTarget } from './runners';
10
- export { createMemories, MemoryError, MEMORIES } from './memories';
11
- export type { Memories, MemoryEntry, MemoryCheck, MemoryHit } from './memories';
10
+ export { createMemories, MemoryError, MEMORIES, administers } from './memories';
11
+ export type { Memories, MemoryEntry, MemoryCheck, MemoryHit, MemoryRecord, MemoryViewer } from './memories';
@@ -7,9 +7,23 @@ export interface MemoryRecord {
7
7
  apiUrl: string;
8
8
  /** The MCP server the agents and the IDE connect to. */
9
9
  mcpUrl?: string;
10
+ /**
11
+ * CR-027: the namespaces that administer it (a tenant's own memory; several: shared, e.g. the memory of a runner
12
+ * its organizations use). None: a memory of the project, administered by the platform.
13
+ */
14
+ owners?: string[];
10
15
  createdAt: number;
11
16
  }
12
17
  export type MemoryEntry = Omit<MemoryRecord, 'createdAt'>;
18
+ /** Who looks at the memories: the platform (all of them), or the admin of a namespace (its own). */
19
+ export type MemoryViewer = {
20
+ platform: true;
21
+ } | {
22
+ platform: false;
23
+ namespace: string;
24
+ };
25
+ /** Whether a viewer administers a memory. */
26
+ export declare const administers: (viewer: MemoryViewer, record: Pick<MemoryRecord, 'owners'>) => boolean;
13
27
  export type MemoryCheck = {
14
28
  ok: true;
15
29
  } | {
@@ -36,26 +50,46 @@ export type MemoriesDeps = {
36
50
  now?: () => number;
37
51
  };
38
52
  export declare function createMemories(deps: MemoriesDeps): {
39
- list(): Promise<MemoryEntry[]>;
53
+ /** The memories a viewer administers (all of them without a viewer). */
54
+ list(viewer?: MemoryViewer): Promise<MemoryEntry[]>;
55
+ /** A memory the viewer administers, or not found (another tenant's looks the same as none). */
56
+ of(id: string, viewer?: MemoryViewer): Promise<MemoryRecord>;
40
57
  /** Whether a memory answers with these credentials: a search that finds nothing is fine. */
41
58
  check(input: {
42
59
  apiUrl: string;
43
60
  key: string;
44
61
  }): Promise<MemoryCheck>;
45
- /** Adds a memory once it answers with its key. */
62
+ /**
63
+ * Adds a memory once it answers with its key; `owner`: the namespace of the admin who adds it (a memory of the
64
+ * project without). The same address twice only under different owners (each tenant its own key).
65
+ */
46
66
  add(input: {
47
67
  name?: string;
48
68
  apiUrl: string;
49
69
  mcpUrl?: string;
50
70
  key: string;
51
- }): Promise<MemoryEntry>;
71
+ }, owner?: string): Promise<MemoryEntry>;
52
72
  /** Name and MCP address; a new key only when given (it is checked first). */
53
73
  update(id: string, patch: {
54
74
  name?: string;
55
75
  mcpUrl?: string | null;
56
76
  key?: string;
57
- }): Promise<MemoryEntry>;
58
- remove(id: string, inUse: boolean): Promise<void>;
77
+ }, viewer?: MemoryViewer): Promise<MemoryEntry>;
78
+ /**
79
+ * Removes a memory no namespace uses. An admin of one of several owners only leaves it to the others; the last
80
+ * owner (or the platform) removes it.
81
+ */
82
+ remove(id: string, inUse: boolean, viewer?: MemoryViewer): Promise<void>;
83
+ /** A namespace becomes an owner of a memory (a memory shared, e.g. the one of a runner its tenants use). */
84
+ share(id: string, namespace: string): Promise<void>;
85
+ /** A namespace stops owning a memory; the memory stays for its other owners (or the platform). */
86
+ unshare(id: string, namespace: string): Promise<void>;
87
+ /** Keeps a memory as given (a host taking over its memories): its key as a secret, its record as it is. */
88
+ put(record: Omit<MemoryRecord, 'createdAt'> & {
89
+ createdAt?: number;
90
+ }, key?: string): Promise<void>;
91
+ /** The key of a memory, for the host's own use on the server (a package of the IDE): never for a browser. */
92
+ keyOf(id: string): Promise<string | null>;
59
93
  /** The passages of a namespace that answer a query, best first. */
60
94
  search(id: string, namespace: string, query: string, limit?: number): Promise<MemoryHit[]>;
61
95
  /** Writes a document in a namespace; the same `documentId` replaces it. */
@@ -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
  }>;
@@ -1,8 +1,8 @@
1
1
  import { type RunnerStatus } from '@llmnative/runner/client';
2
2
  import { type AdapterFactory } from './connections';
3
- import { type MemoryEntry } from './memories';
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;
@@ -44,7 +53,8 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
44
53
  }): Promise<import("@llmnative/react/server").ServerCredentialResolution>;
45
54
  };
46
55
  memories: {
47
- list(): Promise<MemoryEntry[]>;
56
+ list(viewer?: MemoryViewer): Promise<MemoryEntry[]>;
57
+ of(id: string, viewer?: MemoryViewer): Promise<import("./memories").MemoryRecord>;
48
58
  check(input: {
49
59
  apiUrl: string;
50
60
  key: string;
@@ -54,13 +64,19 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
54
64
  apiUrl: string;
55
65
  mcpUrl?: string;
56
66
  key: string;
57
- }): Promise<MemoryEntry>;
67
+ }, owner?: string): Promise<MemoryEntry>;
58
68
  update(id: string, patch: {
59
69
  name?: string;
60
70
  mcpUrl?: string | null;
61
71
  key?: string;
62
- }): Promise<MemoryEntry>;
63
- remove(id: string, inUse: boolean): Promise<void>;
72
+ }, viewer?: MemoryViewer): Promise<MemoryEntry>;
73
+ remove(id: string, inUse: boolean, viewer?: MemoryViewer): Promise<void>;
74
+ share(id: string, namespace: string): Promise<void>;
75
+ unshare(id: string, namespace: string): Promise<void>;
76
+ put(record: Omit<import("./memories").MemoryRecord, 'createdAt'> & {
77
+ createdAt?: number;
78
+ }, key?: string): Promise<void>;
79
+ keyOf(id: string): Promise<string | null>;
64
80
  search(id: string, namespace: string, query: string, limit?: number): Promise<import("./memories").MemoryHit[]>;
65
81
  write(id: string, namespace: string, input: {
66
82
  title: string;
@@ -76,7 +92,10 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
76
92
  }>;
77
93
  };
78
94
  fleet: (project: string) => {
79
- 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>;
80
99
  add(input: {
81
100
  name?: string;
82
101
  url: string;
@@ -84,11 +103,11 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
84
103
  key?: string;
85
104
  }, extra?: {
86
105
  hostFingerprint?: string;
87
- }): Promise<RunnerEntry>;
106
+ }, owner?: string): Promise<RunnerEntry>;
88
107
  startPairing(input: {
89
108
  name?: string;
90
109
  url: string;
91
- }, startedBy: string): Promise<{
110
+ }, startedBy: string, owner?: string): Promise<{
92
111
  id: string;
93
112
  code: string;
94
113
  approveUrl: string;
@@ -104,9 +123,9 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
104
123
  name?: string;
105
124
  isDefault?: boolean;
106
125
  draining?: boolean;
107
- }): Promise<void>;
108
- remove(id: string): Promise<void>;
109
- 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>;
110
129
  assign(namespace: string, runnerId: string, options?: {
111
130
  keepBefore?: boolean;
112
131
  name?: string;
@@ -123,7 +142,7 @@ export declare function createAgenticoServer(options: AgenticoServerOptions): {
123
142
  domain: string;
124
143
  access: import("@llmnative/runner/setup").SshTarget;
125
144
  version?: string;
126
- }, 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<{
127
146
  installId: string;
128
147
  done: Promise<RunnerEntry>;
129
148
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmnative/agentico",
3
- "version": "0.24.1",
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": {