@proteos/sdk 0.58.0 → 0.59.1
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/dist/index.cjs +23 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -2
- package/dist/index.d.ts +24 -2
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/auth/platform-entities.ts +21 -1
- package/src/auth/shares.ts +5 -4
- package/src/conversation/types.ts +25 -2
package/package.json
CHANGED
|
@@ -83,6 +83,8 @@ export const PLATFORM_ENTITIES: readonly PlatformEntity[] = [
|
|
|
83
83
|
{ slug: 'glossary-terms', name: 'Glossary Terms' },
|
|
84
84
|
// Mistranscribed terms proposed by the post-transcription review pass.
|
|
85
85
|
{ slug: 'mistranscribed-terms', name: 'Mistranscribed Terms' },
|
|
86
|
+
// Live speech-to-text (the dictation stream) — `read` opens a stream.
|
|
87
|
+
{ slug: 'voice', name: 'Voice' },
|
|
86
88
|
// The person-level identity layer (contacts + addresses + merges + consent +
|
|
87
89
|
// erasure) — one grant governs the whole aggregate.
|
|
88
90
|
{ slug: 'contacts', name: 'Contacts' },
|
|
@@ -136,7 +138,25 @@ export const PLATFORM_ENTITY_SLUGS: readonly string[] = PLATFORM_ENTITIES.map(
|
|
|
136
138
|
* by it — so permission UIs only offer the scoped column for these. Extend as
|
|
137
139
|
* services adopt scoped enforcement.
|
|
138
140
|
*/
|
|
139
|
-
export const SCOPED_PLATFORM_ENTITY_SLUGS: readonly string[] = [
|
|
141
|
+
export const SCOPED_PLATFORM_ENTITY_SLUGS: readonly string[] = [
|
|
142
|
+
'knowledge-nodes',
|
|
143
|
+
// agent-service: sessions are owned by their starter; the six config
|
|
144
|
+
// resources by their creator. Scoped lists + /agents/v1/shares.
|
|
145
|
+
'agent-sessions',
|
|
146
|
+
'agents',
|
|
147
|
+
'prompts',
|
|
148
|
+
'skills',
|
|
149
|
+
'tools',
|
|
150
|
+
'toolsets',
|
|
151
|
+
'mcp-servers',
|
|
152
|
+
// conversation-service: a connection is owned by its owner (user-scoped) or
|
|
153
|
+
// open to the org through its org share (org-scoped); a conversation's rows
|
|
154
|
+
// are stamped once at creation from its connection / parent and extended by
|
|
155
|
+
// shares; messages inherit their conversation. /conversations/v1/shares.
|
|
156
|
+
'connections',
|
|
157
|
+
'conversations',
|
|
158
|
+
'messages',
|
|
159
|
+
]
|
|
140
160
|
|
|
141
161
|
/** True when `slug` belongs to a platform entity (reserved; can't be user-created). */
|
|
142
162
|
export function isPlatformEntity(slug: string): boolean {
|
package/src/auth/shares.ts
CHANGED
|
@@ -27,6 +27,7 @@ const PLATFORM_ENTITY_SERVICE: Readonly<Record<string, string>> = {
|
|
|
27
27
|
tools: '/agents',
|
|
28
28
|
toolsets: '/agents',
|
|
29
29
|
'mcp-servers': '/agents',
|
|
30
|
+
'agent-sessions': '/agents',
|
|
30
31
|
// Knowledge (knowledge-service)
|
|
31
32
|
'knowledge-spaces': '/knowledge',
|
|
32
33
|
'knowledge-nodes': '/knowledge',
|
|
@@ -38,11 +39,11 @@ const PLATFORM_ENTITY_SERVICE: Readonly<Record<string, string>> = {
|
|
|
38
39
|
/**
|
|
39
40
|
* The services that actually serve `/v1/shares` today.
|
|
40
41
|
*
|
|
41
|
-
* Deliberately separate from the map above:
|
|
42
|
-
*
|
|
43
|
-
*
|
|
42
|
+
* Deliberately separate from the map above: a service that has not adopted
|
|
43
|
+
* the endpoint yet must fail with a clear message rather than a bare 404 that
|
|
44
|
+
* reads like the record does not exist.
|
|
44
45
|
*/
|
|
45
|
-
const SERVICES_WITH_SHARING: ReadonlySet<string> = new Set(['/data', '/knowledge'])
|
|
46
|
+
const SERVICES_WITH_SHARING: ReadonlySet<string> = new Set(['/data', '/knowledge', '/agents', '/conversations'])
|
|
46
47
|
|
|
47
48
|
/** Records live in data-service; user-defined entities are the unlisted majority. */
|
|
48
49
|
const DEFAULT_SERVICE = '/data'
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* mirror of packages/go/model/conversation (snake_case, Is-prefixed booleans).
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type { PrincipalRef } from '../meta/types.js'
|
|
6
7
|
import type { FileRef } from '../types/common.js'
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -1612,6 +1613,11 @@ export interface ListConnectionsQuery extends PaginationQuery {
|
|
|
1612
1613
|
*/
|
|
1613
1614
|
owner_id?: string
|
|
1614
1615
|
status?: string
|
|
1616
|
+
/**
|
|
1617
|
+
* The caller's intent: `read` (default) lists every connection they reach;
|
|
1618
|
+
* `write` only those they may send through — the compose picker's question.
|
|
1619
|
+
*/
|
|
1620
|
+
permission?: 'read' | 'write'
|
|
1615
1621
|
}
|
|
1616
1622
|
|
|
1617
1623
|
/**
|
|
@@ -1716,7 +1722,13 @@ export type ConversationFilterType =
|
|
|
1716
1722
|
| 'internal_participant'
|
|
1717
1723
|
| 'internal_conversations'
|
|
1718
1724
|
| 'all'
|
|
1719
|
-
|
|
1725
|
+
/**
|
|
1726
|
+
* block drops the message; allow keeps it. restrict and share keep it too
|
|
1727
|
+
* (they rank as allow) and decide who sees the thread the message CREATES:
|
|
1728
|
+
* restrict writes only the rule's principals onto the new thread, share adds
|
|
1729
|
+
* them on top of what the thread inherits. Applied once, at creation.
|
|
1730
|
+
*/
|
|
1731
|
+
export type ConversationFilterAction = 'block' | 'allow' | 'restrict' | 'share'
|
|
1720
1732
|
/** Which side of the message address/domain rules test (default: sender). */
|
|
1721
1733
|
export type FilterMatchOn = 'sender' | 'any_participant'
|
|
1722
1734
|
/** Deterministic machine-mail header signals the automated filter matches. */
|
|
@@ -1783,7 +1795,11 @@ export interface ConversationFilter {
|
|
|
1783
1795
|
action: ConversationFilterAction
|
|
1784
1796
|
filter_config?: ConversationFilterConfig
|
|
1785
1797
|
is_enabled: boolean
|
|
1786
|
-
/**
|
|
1798
|
+
/** restrict / share only: who the created thread is opened to. */
|
|
1799
|
+
principals?: PrincipalRef[]
|
|
1800
|
+
/** restrict / share only: read or write (write implies read; the default). */
|
|
1801
|
+
permission?: 'read' | 'write'
|
|
1802
|
+
/** Read-only rollup: messages this rule matched in the last 30 days. */
|
|
1787
1803
|
recent_event_count?: number
|
|
1788
1804
|
created_at: string
|
|
1789
1805
|
created_by: UserRef
|
|
@@ -1802,6 +1818,8 @@ export interface ConversationFilterEvent {
|
|
|
1802
1818
|
sender_kind?: ContactAddressKind
|
|
1803
1819
|
sender_value?: string
|
|
1804
1820
|
external_message_id?: string
|
|
1821
|
+
/** The thread a restrict / share match applied to; empty on a drop. */
|
|
1822
|
+
conversation_id?: string
|
|
1805
1823
|
occurred_at: string
|
|
1806
1824
|
}
|
|
1807
1825
|
|
|
@@ -1811,6 +1829,9 @@ export interface CreateConversationFilterRequest {
|
|
|
1811
1829
|
action: ConversationFilterAction
|
|
1812
1830
|
filter_config?: Record<string, unknown>
|
|
1813
1831
|
is_enabled?: boolean
|
|
1832
|
+
/** Required for restrict / share, empty otherwise. */
|
|
1833
|
+
principals?: PrincipalRef[]
|
|
1834
|
+
permission?: 'read' | 'write'
|
|
1814
1835
|
/** Opts past the own-domain guard (self_domain_block). */
|
|
1815
1836
|
is_self_domain_acknowledged?: boolean
|
|
1816
1837
|
}
|
|
@@ -1821,6 +1842,8 @@ export interface UpdateConversationFilterRequest {
|
|
|
1821
1842
|
action?: ConversationFilterAction
|
|
1822
1843
|
filter_config?: Record<string, unknown>
|
|
1823
1844
|
is_enabled?: boolean
|
|
1845
|
+
principals?: PrincipalRef[]
|
|
1846
|
+
permission?: 'read' | 'write'
|
|
1824
1847
|
is_self_domain_acknowledged?: boolean
|
|
1825
1848
|
}
|
|
1826
1849
|
|