@agentoryhq/shared 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +29 -5
  2. package/package.json +6 -4
package/dist/index.d.ts CHANGED
@@ -38,6 +38,16 @@ export type Membership = {
38
38
  email: string;
39
39
  role: Role;
40
40
  };
41
+ /** 期望态规则条目:name = 规则名(节点侧落 .cursor/rules/<name>.mdc 文件名语义),body = markdown 正文整段透传(rules-desired-config Q3 裁决:不解构 frontmatter)。 */
42
+ export type DesiredRule = {
43
+ name: string;
44
+ body: string;
45
+ };
46
+ /** 规则发现上报条目:只报名字与内容 hash,正文不上传(会话流索引只读口径不变)。hash 契约 = sha256(body UTF-8 字节) hex。 */
47
+ export type LiveRuleBinding = {
48
+ name: string;
49
+ contentHash?: string;
50
+ };
41
51
  export type DesiredCatalog = {
42
52
  workspaceId: string;
43
53
  mcp: {
@@ -45,17 +55,21 @@ export type DesiredCatalog = {
45
55
  command?: string;
46
56
  }[];
47
57
  skills: string[];
58
+ rules: DesiredRule[];
48
59
  updatedAt: string;
49
60
  };
50
61
  export type AlignDiffAction = "add" | "update" | "keep" | "keep_live";
51
62
  export type AlignDiffItem = {
52
- kind: "mcp" | "skill";
63
+ kind: "mcp" | "skill" | "rule";
53
64
  name: string;
54
65
  action: AlignDiffAction;
55
66
  /** live 与 desired 冲突;写入时以期望态为准 */
56
67
  conflict: boolean;
57
68
  liveCommand?: string;
58
69
  desiredCommand?: string;
70
+ /** 规则维 hash 对照(kind="rule"):live 上报的内容 hash / desired 正文 hash */
71
+ liveHash?: string;
72
+ desiredHash?: string;
59
73
  note?: string;
60
74
  };
61
75
  export type AlignPatch = {
@@ -64,6 +78,8 @@ export type AlignPatch = {
64
78
  command?: string;
65
79
  }[];
66
80
  skills: string[];
81
+ /** 可选 = node↔api 版本偏差容忍:老节点收到无 rules 的 patch 按老形状执行 */
82
+ rules?: DesiredRule[];
67
83
  };
68
84
  export type AlignPlanStatus = "pending_confirm" | "confirmed" | "applied" | "failed" | "cancelled";
69
85
  export type AlignPlan = {
@@ -115,6 +131,8 @@ export type DiscoveredAgent = {
115
131
  displayName: string;
116
132
  mcp: LiveMcpBinding[];
117
133
  skills: string[];
134
+ /** 可选 = 老节点上报无 rules 字段零破坏;API 侧归一为 [] */
135
+ rules?: LiveRuleBinding[];
118
136
  };
119
137
  export type AgentRecord = DiscoveredAgent & {
120
138
  id: string;
@@ -132,26 +150,31 @@ export type NodeRecord = {
132
150
  /** ISO timestamp when Owner revoked; null = active */
133
151
  revokedAt: string | null;
134
152
  };
135
- /** Read-only Cursor session metadata (no message body). */
153
+ /** Read-only session metadata (no message body), any indexed runtime. */
136
154
  export type SessionIndexReportItem = {
137
155
  sourceKey: string;
138
156
  displayName: string;
139
157
  projectPath?: string;
140
158
  updatedAt: string;
159
+ /** runtime the item was discovered by; absent = legacy node payload → API defaults "cursor" */
160
+ runtime?: RuntimeKind;
141
161
  };
142
- /** Read-only memory/rules metadata (no file body). */
162
+ /** Read-only memory/rules metadata (no file body), any indexed runtime. */
143
163
  export type MemoryIndexReportItem = {
144
164
  sourceKey: string;
145
165
  kind: "memory" | "rules";
146
166
  pathLabel: string;
147
167
  projectPath?: string;
148
168
  updatedAt: string;
169
+ /** runtime the item was discovered by; absent = legacy node payload → API defaults "cursor" */
170
+ runtime?: RuntimeKind;
149
171
  };
150
172
  export type SessionIndexEntry = SessionIndexReportItem & {
151
173
  id: string;
152
174
  workspaceId: string;
153
175
  nodeId: string;
154
- runtime: "cursor";
176
+ /** runtime dimension since claude-session-index; widened from "cursor" literal */
177
+ runtime: RuntimeKind;
155
178
  discoveredAt: string;
156
179
  };
157
180
  /**
@@ -179,7 +202,8 @@ export type MemoryIndexEntry = MemoryIndexReportItem & {
179
202
  id: string;
180
203
  workspaceId: string;
181
204
  nodeId: string;
182
- runtime: "cursor";
205
+ /** runtime dimension since claude-session-index; widened from "cursor" literal */
206
+ runtime: RuntimeKind;
183
207
  discoveredAt: string;
184
208
  };
185
209
  export type AssetIndexFilter = {
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@agentoryhq/shared",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Agentory wire/DTO types for node adapters and control-plane clients",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
- "files": ["dist", "README.md"],
7
+ "files": [
8
+ "dist",
9
+ "README.md"
10
+ ],
8
11
  "exports": {
9
12
  ".": {
10
13
  "types": "./dist/index.d.ts",
@@ -16,8 +19,7 @@
16
19
  },
17
20
  "repository": {
18
21
  "type": "git",
19
- "url": "git+https://github.com/tunsuy/agentory-node.git",
20
- "directory": "packages/shared"
22
+ "url": "git+https://github.com/tunsuy/agentory-node.git"
21
23
  },
22
24
  "publishConfig": {
23
25
  "access": "public"