@agent-native/core 0.7.2 → 0.7.4

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 (153) hide show
  1. package/dist/client/FeedbackButton.d.ts +3 -1
  2. package/dist/client/FeedbackButton.d.ts.map +1 -1
  3. package/dist/client/FeedbackButton.js +115 -40
  4. package/dist/client/FeedbackButton.js.map +1 -1
  5. package/dist/client/index.d.ts +1 -0
  6. package/dist/client/index.d.ts.map +1 -1
  7. package/dist/client/index.js +1 -0
  8. package/dist/client/index.js.map +1 -1
  9. package/dist/client/settings/SecretsSection.d.ts +12 -0
  10. package/dist/client/settings/SecretsSection.d.ts.map +1 -0
  11. package/dist/client/settings/SecretsSection.js +148 -0
  12. package/dist/client/settings/SecretsSection.js.map +1 -0
  13. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  14. package/dist/client/settings/SettingsPanel.js +100 -2
  15. package/dist/client/settings/SettingsPanel.js.map +1 -1
  16. package/dist/client/settings/index.d.ts +1 -0
  17. package/dist/client/settings/index.d.ts.map +1 -1
  18. package/dist/client/settings/index.js +1 -0
  19. package/dist/client/settings/index.js.map +1 -1
  20. package/dist/client/sharing/ShareButton.d.ts +14 -0
  21. package/dist/client/sharing/ShareButton.d.ts.map +1 -0
  22. package/dist/client/sharing/ShareButton.js +43 -0
  23. package/dist/client/sharing/ShareButton.js.map +1 -0
  24. package/dist/client/sharing/ShareDialog.d.ts +15 -0
  25. package/dist/client/sharing/ShareDialog.d.ts.map +1 -0
  26. package/dist/client/sharing/ShareDialog.js +209 -0
  27. package/dist/client/sharing/ShareDialog.js.map +1 -0
  28. package/dist/client/sharing/VisibilityBadge.d.ts +11 -0
  29. package/dist/client/sharing/VisibilityBadge.d.ts.map +1 -0
  30. package/dist/client/sharing/VisibilityBadge.js +20 -0
  31. package/dist/client/sharing/VisibilityBadge.js.map +1 -0
  32. package/dist/client/sharing/index.d.ts +4 -0
  33. package/dist/client/sharing/index.d.ts.map +1 -0
  34. package/dist/client/sharing/index.js +4 -0
  35. package/dist/client/sharing/index.js.map +1 -0
  36. package/dist/client/use-action.d.ts.map +1 -1
  37. package/dist/client/use-action.js +7 -2
  38. package/dist/client/use-action.js.map +1 -1
  39. package/dist/db/schema.d.ts +1 -0
  40. package/dist/db/schema.d.ts.map +1 -1
  41. package/dist/db/schema.js +4 -0
  42. package/dist/db/schema.js.map +1 -1
  43. package/dist/deploy/build.js +22 -3
  44. package/dist/deploy/build.js.map +1 -1
  45. package/dist/index.d.ts +1 -0
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +4 -0
  48. package/dist/index.js.map +1 -1
  49. package/dist/onboarding/default-steps.d.ts.map +1 -1
  50. package/dist/onboarding/default-steps.js +5 -0
  51. package/dist/onboarding/default-steps.js.map +1 -1
  52. package/dist/org/accept-pending.d.ts +22 -0
  53. package/dist/org/accept-pending.d.ts.map +1 -0
  54. package/dist/org/accept-pending.js +75 -0
  55. package/dist/org/accept-pending.js.map +1 -0
  56. package/dist/org/handlers.d.ts +2 -0
  57. package/dist/org/handlers.d.ts.map +1 -1
  58. package/dist/org/handlers.js +52 -1
  59. package/dist/org/handlers.js.map +1 -1
  60. package/dist/org/index.d.ts +2 -0
  61. package/dist/org/index.d.ts.map +1 -1
  62. package/dist/org/index.js +1 -0
  63. package/dist/org/index.js.map +1 -1
  64. package/dist/secrets/index.d.ts +15 -0
  65. package/dist/secrets/index.d.ts.map +1 -0
  66. package/dist/secrets/index.js +15 -0
  67. package/dist/secrets/index.js.map +1 -0
  68. package/dist/secrets/onboarding.d.ts +18 -0
  69. package/dist/secrets/onboarding.d.ts.map +1 -0
  70. package/dist/secrets/onboarding.js +87 -0
  71. package/dist/secrets/onboarding.js.map +1 -0
  72. package/dist/secrets/register.d.ts +63 -0
  73. package/dist/secrets/register.d.ts.map +1 -0
  74. package/dist/secrets/register.js +55 -0
  75. package/dist/secrets/register.js.map +1 -0
  76. package/dist/secrets/routes.d.ts +67 -0
  77. package/dist/secrets/routes.d.ts.map +1 -0
  78. package/dist/secrets/routes.js +275 -0
  79. package/dist/secrets/routes.js.map +1 -0
  80. package/dist/secrets/schema.d.ts +154 -0
  81. package/dist/secrets/schema.d.ts.map +1 -0
  82. package/dist/secrets/schema.js +41 -0
  83. package/dist/secrets/schema.js.map +1 -0
  84. package/dist/secrets/storage.d.ts +54 -0
  85. package/dist/secrets/storage.d.ts.map +1 -0
  86. package/dist/secrets/storage.js +181 -0
  87. package/dist/secrets/storage.js.map +1 -0
  88. package/dist/server/action-discovery.d.ts +18 -0
  89. package/dist/server/action-discovery.d.ts.map +1 -1
  90. package/dist/server/action-discovery.js +95 -0
  91. package/dist/server/action-discovery.js.map +1 -1
  92. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  93. package/dist/server/agent-chat-plugin.js +12 -0
  94. package/dist/server/agent-chat-plugin.js.map +1 -1
  95. package/dist/server/app-name.d.ts +13 -0
  96. package/dist/server/app-name.d.ts.map +1 -0
  97. package/dist/server/app-name.js +41 -0
  98. package/dist/server/app-name.js.map +1 -0
  99. package/dist/server/app-url.d.ts +24 -0
  100. package/dist/server/app-url.d.ts.map +1 -0
  101. package/dist/server/app-url.js +68 -0
  102. package/dist/server/app-url.js.map +1 -0
  103. package/dist/server/better-auth-instance.d.ts.map +1 -1
  104. package/dist/server/better-auth-instance.js +38 -9
  105. package/dist/server/better-auth-instance.js.map +1 -1
  106. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  107. package/dist/server/core-routes-plugin.js +29 -0
  108. package/dist/server/core-routes-plugin.js.map +1 -1
  109. package/dist/server/email-template.d.ts +51 -0
  110. package/dist/server/email-template.d.ts.map +1 -0
  111. package/dist/server/email-template.js +146 -0
  112. package/dist/server/email-template.js.map +1 -0
  113. package/dist/server/index.d.ts +5 -1
  114. package/dist/server/index.d.ts.map +1 -1
  115. package/dist/server/index.js +5 -1
  116. package/dist/server/index.js.map +1 -1
  117. package/dist/sharing/access.d.ts +56 -0
  118. package/dist/sharing/access.d.ts.map +1 -0
  119. package/dist/sharing/access.js +149 -0
  120. package/dist/sharing/access.js.map +1 -0
  121. package/dist/sharing/actions/list-resource-shares.d.ts +3 -0
  122. package/dist/sharing/actions/list-resource-shares.d.ts.map +1 -0
  123. package/dist/sharing/actions/list-resource-shares.js +38 -0
  124. package/dist/sharing/actions/list-resource-shares.js.map +1 -0
  125. package/dist/sharing/actions/set-resource-visibility.d.ts +3 -0
  126. package/dist/sharing/actions/set-resource-visibility.d.ts.map +1 -0
  127. package/dist/sharing/actions/set-resource-visibility.js +24 -0
  128. package/dist/sharing/actions/set-resource-visibility.js.map +1 -0
  129. package/dist/sharing/actions/share-resource.d.ts +3 -0
  130. package/dist/sharing/actions/share-resource.d.ts.map +1 -0
  131. package/dist/sharing/actions/share-resource.js +64 -0
  132. package/dist/sharing/actions/share-resource.js.map +1 -0
  133. package/dist/sharing/actions/unshare-resource.d.ts +3 -0
  134. package/dist/sharing/actions/unshare-resource.d.ts.map +1 -0
  135. package/dist/sharing/actions/unshare-resource.js +24 -0
  136. package/dist/sharing/actions/unshare-resource.js.map +1 -0
  137. package/dist/sharing/index.d.ts +11 -0
  138. package/dist/sharing/index.d.ts.map +1 -0
  139. package/dist/sharing/index.js +11 -0
  140. package/dist/sharing/index.js.map +1 -0
  141. package/dist/sharing/registry.d.ts +44 -0
  142. package/dist/sharing/registry.d.ts.map +1 -0
  143. package/dist/sharing/registry.js +54 -0
  144. package/dist/sharing/registry.js.map +1 -0
  145. package/dist/sharing/schema.d.ts +202 -0
  146. package/dist/sharing/schema.d.ts.map +1 -0
  147. package/dist/sharing/schema.js +88 -0
  148. package/dist/sharing/schema.js.map +1 -0
  149. package/dist/vite/action-types-plugin.d.ts +5 -0
  150. package/dist/vite/action-types-plugin.d.ts.map +1 -1
  151. package/dist/vite/action-types-plugin.js +129 -28
  152. package/dist/vite/action-types-plugin.js.map +1 -1
  153. package/package.json +12 -4
@@ -0,0 +1,202 @@
1
+ /**
2
+ * Schema factories for sharing/ownership.
3
+ *
4
+ * Templates make a resource table "ownable" by spreading `ownableColumns()` into
5
+ * the table definition and declaring a companion shares table via
6
+ * `createSharesTable()`. The shares table carries per-principal grants; the
7
+ * parent table's `visibility` column is the coarse default (private / org /
8
+ * public).
9
+ *
10
+ * import { table, text, ownableColumns, createSharesTable } from
11
+ * "@agent-native/core/db/schema";
12
+ *
13
+ * export const decks = table("decks", {
14
+ * id: text("id").primaryKey(),
15
+ * title: text("title").notNull(),
16
+ * data: text("data").notNull(),
17
+ * ...ownableColumns(),
18
+ * });
19
+ *
20
+ * export const deckShares = createSharesTable("deck_shares");
21
+ *
22
+ * The share row `role` supports `viewer | editor | admin`. `admin` is a
23
+ * share-level capability — it lets non-owners manage shares. The single
24
+ * `owner_email` column on the resource remains the ground truth for ownership.
25
+ */
26
+ /**
27
+ * Columns any ownable resource should include. Spread into the table definition.
28
+ *
29
+ * - `ownerEmail` — the creator. Auto-filled by write actions from the request context.
30
+ * - `orgId` — owner's active org at creation time. Used for `visibility = 'org'` checks.
31
+ * - `visibility`— coarse default: `'private' | 'org' | 'public'`. Default `'private'`.
32
+ */
33
+ export declare function ownableColumns(): {
34
+ ownerEmail: import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/sqlite-core").SQLiteTextBuilderInitial<"owner_email", [string, ...string[]], number>>>;
35
+ orgId: import("drizzle-orm/sqlite-core").SQLiteTextBuilderInitial<"org_id", [string, ...string[]], number>;
36
+ visibility: import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/sqlite-core").SQLiteTextBuilderInitial<"visibility", ["private", "org", "public"], number>>>;
37
+ };
38
+ /**
39
+ * Create a companion shares table for an ownable resource. Call this right
40
+ * after defining the parent table.
41
+ *
42
+ * Columns:
43
+ * - `id` — share row id (generated by the share action)
44
+ * - `resourceId` — id of the parent resource
45
+ * - `principalType` — `'user' | 'org'`
46
+ * - `principalId` — email (for user) or org id (for org)
47
+ * - `role` — `'viewer' | 'editor' | 'admin'`
48
+ * - `createdBy` — email of the user who created the share
49
+ * - `createdAt` — ISO timestamp
50
+ *
51
+ * Uniqueness across `(resource_id, principal_type, principal_id)` is enforced
52
+ * at the action layer via upsert-style logic. A composite DB-level unique
53
+ * index can be added per template if desired — omitted here to keep the
54
+ * factory dialect-agnostic.
55
+ */
56
+ export declare function createSharesTable(tableName: string): import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
57
+ name: string;
58
+ schema: undefined;
59
+ columns: {
60
+ id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
61
+ name: "id";
62
+ tableName: string;
63
+ dataType: "string";
64
+ columnType: "SQLiteText";
65
+ data: string;
66
+ driverParam: string;
67
+ notNull: true;
68
+ hasDefault: false;
69
+ isPrimaryKey: true;
70
+ isAutoincrement: false;
71
+ hasRuntimeDefault: false;
72
+ enumValues: [string, ...string[]];
73
+ baseColumn: never;
74
+ identity: undefined;
75
+ generated: undefined;
76
+ }, {}, {
77
+ length: number;
78
+ }>;
79
+ resourceId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
80
+ name: "resource_id";
81
+ tableName: string;
82
+ dataType: "string";
83
+ columnType: "SQLiteText";
84
+ data: string;
85
+ driverParam: string;
86
+ notNull: true;
87
+ hasDefault: false;
88
+ isPrimaryKey: false;
89
+ isAutoincrement: false;
90
+ hasRuntimeDefault: false;
91
+ enumValues: [string, ...string[]];
92
+ baseColumn: never;
93
+ identity: undefined;
94
+ generated: undefined;
95
+ }, {}, {
96
+ length: number;
97
+ }>;
98
+ principalType: import("drizzle-orm/sqlite-core").SQLiteColumn<{
99
+ name: "principal_type";
100
+ tableName: string;
101
+ dataType: "string";
102
+ columnType: "SQLiteText";
103
+ data: "user" | "org";
104
+ driverParam: string;
105
+ notNull: true;
106
+ hasDefault: false;
107
+ isPrimaryKey: false;
108
+ isAutoincrement: false;
109
+ hasRuntimeDefault: false;
110
+ enumValues: ["user", "org"];
111
+ baseColumn: never;
112
+ identity: undefined;
113
+ generated: undefined;
114
+ }, {}, {
115
+ length: number;
116
+ }>;
117
+ principalId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
118
+ name: "principal_id";
119
+ tableName: string;
120
+ dataType: "string";
121
+ columnType: "SQLiteText";
122
+ data: string;
123
+ driverParam: string;
124
+ notNull: true;
125
+ hasDefault: false;
126
+ isPrimaryKey: false;
127
+ isAutoincrement: false;
128
+ hasRuntimeDefault: false;
129
+ enumValues: [string, ...string[]];
130
+ baseColumn: never;
131
+ identity: undefined;
132
+ generated: undefined;
133
+ }, {}, {
134
+ length: number;
135
+ }>;
136
+ role: import("drizzle-orm/sqlite-core").SQLiteColumn<{
137
+ name: "role";
138
+ tableName: string;
139
+ dataType: "string";
140
+ columnType: "SQLiteText";
141
+ data: "admin" | "viewer" | "editor";
142
+ driverParam: string;
143
+ notNull: true;
144
+ hasDefault: true;
145
+ isPrimaryKey: false;
146
+ isAutoincrement: false;
147
+ hasRuntimeDefault: false;
148
+ enumValues: ["viewer", "editor", "admin"];
149
+ baseColumn: never;
150
+ identity: undefined;
151
+ generated: undefined;
152
+ }, {}, {
153
+ length: number;
154
+ }>;
155
+ createdBy: import("drizzle-orm/sqlite-core").SQLiteColumn<{
156
+ name: "created_by";
157
+ tableName: string;
158
+ dataType: "string";
159
+ columnType: "SQLiteText";
160
+ data: string;
161
+ driverParam: string;
162
+ notNull: true;
163
+ hasDefault: false;
164
+ isPrimaryKey: false;
165
+ isAutoincrement: false;
166
+ hasRuntimeDefault: false;
167
+ enumValues: [string, ...string[]];
168
+ baseColumn: never;
169
+ identity: undefined;
170
+ generated: undefined;
171
+ }, {}, {
172
+ length: number;
173
+ }>;
174
+ createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
175
+ name: "created_at";
176
+ tableName: string;
177
+ dataType: "string";
178
+ columnType: "SQLiteText";
179
+ data: string;
180
+ driverParam: string;
181
+ notNull: true;
182
+ hasDefault: true;
183
+ isPrimaryKey: false;
184
+ isAutoincrement: false;
185
+ hasRuntimeDefault: false;
186
+ enumValues: [string, ...string[]];
187
+ baseColumn: never;
188
+ identity: undefined;
189
+ generated: undefined;
190
+ }, {}, {
191
+ length: number;
192
+ }>;
193
+ };
194
+ dialect: "sqlite";
195
+ }>;
196
+ export type Visibility = "private" | "org" | "public";
197
+ export type ShareRole = "viewer" | "editor" | "admin";
198
+ export type PrincipalType = "user" | "org";
199
+ /** Role precedence — higher number = stronger capability. */
200
+ export declare const ROLE_RANK: Record<ShareRole | "owner", number>;
201
+ export declare function roleSatisfies(actual: ShareRole | "owner", minimum: ShareRole | "owner"): boolean;
202
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/sharing/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH;;;;;;GAMG;AACH,wBAAgB,cAAc;;;;EAU7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAclD;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,CAAC;AACtD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AACtD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,CAAC;AAE3C,6DAA6D;AAC7D,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,OAAO,EAAE,MAAM,CAKzD,CAAC;AAEF,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,GAAG,OAAO,EAC3B,OAAO,EAAE,SAAS,GAAG,OAAO,GAC3B,OAAO,CAET"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Schema factories for sharing/ownership.
3
+ *
4
+ * Templates make a resource table "ownable" by spreading `ownableColumns()` into
5
+ * the table definition and declaring a companion shares table via
6
+ * `createSharesTable()`. The shares table carries per-principal grants; the
7
+ * parent table's `visibility` column is the coarse default (private / org /
8
+ * public).
9
+ *
10
+ * import { table, text, ownableColumns, createSharesTable } from
11
+ * "@agent-native/core/db/schema";
12
+ *
13
+ * export const decks = table("decks", {
14
+ * id: text("id").primaryKey(),
15
+ * title: text("title").notNull(),
16
+ * data: text("data").notNull(),
17
+ * ...ownableColumns(),
18
+ * });
19
+ *
20
+ * export const deckShares = createSharesTable("deck_shares");
21
+ *
22
+ * The share row `role` supports `viewer | editor | admin`. `admin` is a
23
+ * share-level capability — it lets non-owners manage shares. The single
24
+ * `owner_email` column on the resource remains the ground truth for ownership.
25
+ */
26
+ import { table, text, now } from "../db/schema.js";
27
+ /**
28
+ * Columns any ownable resource should include. Spread into the table definition.
29
+ *
30
+ * - `ownerEmail` — the creator. Auto-filled by write actions from the request context.
31
+ * - `orgId` — owner's active org at creation time. Used for `visibility = 'org'` checks.
32
+ * - `visibility`— coarse default: `'private' | 'org' | 'public'`. Default `'private'`.
33
+ */
34
+ export function ownableColumns() {
35
+ return {
36
+ ownerEmail: text("owner_email").notNull().default("local@localhost"),
37
+ orgId: text("org_id"),
38
+ visibility: text("visibility", {
39
+ enum: ["private", "org", "public"],
40
+ })
41
+ .notNull()
42
+ .default("private"),
43
+ };
44
+ }
45
+ /**
46
+ * Create a companion shares table for an ownable resource. Call this right
47
+ * after defining the parent table.
48
+ *
49
+ * Columns:
50
+ * - `id` — share row id (generated by the share action)
51
+ * - `resourceId` — id of the parent resource
52
+ * - `principalType` — `'user' | 'org'`
53
+ * - `principalId` — email (for user) or org id (for org)
54
+ * - `role` — `'viewer' | 'editor' | 'admin'`
55
+ * - `createdBy` — email of the user who created the share
56
+ * - `createdAt` — ISO timestamp
57
+ *
58
+ * Uniqueness across `(resource_id, principal_type, principal_id)` is enforced
59
+ * at the action layer via upsert-style logic. A composite DB-level unique
60
+ * index can be added per template if desired — omitted here to keep the
61
+ * factory dialect-agnostic.
62
+ */
63
+ export function createSharesTable(tableName) {
64
+ return table(tableName, {
65
+ id: text("id").primaryKey(),
66
+ resourceId: text("resource_id").notNull(),
67
+ principalType: text("principal_type", {
68
+ enum: ["user", "org"],
69
+ }).notNull(),
70
+ principalId: text("principal_id").notNull(),
71
+ role: text("role", { enum: ["viewer", "editor", "admin"] })
72
+ .notNull()
73
+ .default("viewer"),
74
+ createdBy: text("created_by").notNull(),
75
+ createdAt: text("created_at").notNull().default(now()),
76
+ });
77
+ }
78
+ /** Role precedence — higher number = stronger capability. */
79
+ export const ROLE_RANK = {
80
+ viewer: 1,
81
+ editor: 2,
82
+ admin: 3,
83
+ owner: 4,
84
+ };
85
+ export function roleSatisfies(actual, minimum) {
86
+ return ROLE_RANK[actual] >= ROLE_RANK[minimum];
87
+ }
88
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/sharing/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC;QACpE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;QACrB,UAAU,EAAE,IAAI,CAAC,YAAY,EAAE;YAC7B,IAAI,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC;SACnC,CAAC;aACC,OAAO,EAAE;aACT,OAAO,CAAC,SAAS,CAAC;KACtB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,OAAO,KAAK,CAAC,SAAS,EAAE;QACtB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;QAC3B,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;QACzC,aAAa,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACpC,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;SACtB,CAAC,CAAC,OAAO,EAAE;QACZ,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;QAC3C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;aACxD,OAAO,EAAE;aACT,OAAO,CAAC,QAAQ,CAAC;QACpB,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;QACvC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;KACvD,CAAC,CAAC;AACL,CAAC;AAMD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,SAAS,GAAwC;IAC5D,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,UAAU,aAAa,CAC3B,MAA2B,EAC3B,OAA4B;IAE5B,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC"}
@@ -10,4 +10,9 @@ import type { Plugin } from "vite";
10
10
  * ```
11
11
  */
12
12
  export declare function actionTypesPlugin(): Plugin;
13
+ /**
14
+ * Public helper to regenerate the types + registry from a non-Vite context
15
+ * (e.g. the Nitro deploy build, where Vite plugins don't run).
16
+ */
17
+ export declare function generateActionRegistryForProject(projectRoot: string): void;
13
18
  //# sourceMappingURL=action-types-plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action-types-plugin.d.ts","sourceRoot":"","sources":["../../src/vite/action-types-plugin.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAmFnC;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAgC1C"}
1
+ {"version":3,"file":"action-types-plugin.d.ts","sourceRoot":"","sources":["../../src/vite/action-types-plugin.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAiLnC;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAgC1C;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAG1E"}
@@ -1,14 +1,18 @@
1
1
  /**
2
- * Vite plugin that generates end-to-end type-safe action types.
2
+ * Vite plugin that generates end-to-end type-safe action types AND a runtime
3
+ * registry of static imports so bundlers (Nitro on Netlify/Vercel/AWS-Lambda,
4
+ * Rolldown, etc.) include every action file in the server bundle.
3
5
  *
4
- * Watches the `actions/` directory and emits `.generated/action-types.d.ts`,
5
- * which augments the `ActionRegistry` interface in `@agent-native/core/client`.
6
- * This gives `useActionQuery` and `useActionMutation` full type inference
7
- * for action names, parameters, and return types — similar to tRPC.
8
- *
9
- * The generated file uses `typeof import()` to reference action source files,
10
- * so TypeScript resolves the actual types at type-check time without any
11
- * runtime cost or complex AST parsing.
6
+ * Watches the `actions/` directory and emits:
7
+ * - `.generated/action-types.d.ts` type-only module that augments the
8
+ * `ActionRegistry` interface in `@agent-native/core/client`, giving
9
+ * `useActionQuery`/`useActionMutation` full inference.
10
+ * - `.generated/actions-registry.ts` — runtime registry keyed by action
11
+ * name, with static `import` statements for every action. Templates
12
+ * import this file from their `server/plugins/agent-chat.ts` so Nitro
13
+ * bundles the actions into the server function; without it the runtime
14
+ * `fs.readdirSync` inside `autoDiscoverActions` finds nothing in a
15
+ * bundled serverless function and every action route 404s.
12
16
  */
13
17
  import path from "path";
14
18
  import fs from "fs";
@@ -21,18 +25,41 @@ const SKIP_FILES = new Set([
21
25
  "registry",
22
26
  ]);
23
27
  /**
24
- * Scan the actions directory and emit a `.generated/action-types.d.ts` file.
25
- * Only writes if the content has changed, to avoid triggering unnecessary rebuilds.
28
+ * Framework-level sharing actions that must ALWAYS be in the generated
29
+ * registry, even when the template's `actions/` directory doesn't contain
30
+ * them. Each entry maps the action name to the bare-specifier import path so
31
+ * bundlers see a static import and pull the module into the server bundle.
32
+ *
33
+ * Order matters: templates can override by defining a same-named file in
34
+ * their own `actions/` directory — the merge below is skip-existing.
26
35
  */
27
- function generateActionTypes(actionsDir, projectRoot) {
36
+ const CORE_SHARING_ACTIONS = [
37
+ {
38
+ name: "share-resource",
39
+ specifier: "@agent-native/core/sharing/actions/share-resource",
40
+ },
41
+ {
42
+ name: "unshare-resource",
43
+ specifier: "@agent-native/core/sharing/actions/unshare-resource",
44
+ },
45
+ {
46
+ name: "list-resource-shares",
47
+ specifier: "@agent-native/core/sharing/actions/list-resource-shares",
48
+ },
49
+ {
50
+ name: "set-resource-visibility",
51
+ specifier: "@agent-native/core/sharing/actions/set-resource-visibility",
52
+ },
53
+ ];
54
+ function scanActionFiles(actionsDir) {
28
55
  let files;
29
56
  try {
30
57
  files = fs.readdirSync(actionsDir);
31
58
  }
32
59
  catch {
33
- return; // No actions directory — nothing to generate
60
+ return [];
34
61
  }
35
- const actionFiles = files.filter((f) => {
62
+ return files.filter((f) => {
36
63
  if (!f.endsWith(".ts") && !f.endsWith(".js"))
37
64
  return false;
38
65
  const name = f.replace(/\.(ts|js)$/, "");
@@ -40,17 +67,48 @@ function generateActionTypes(actionsDir, projectRoot) {
40
67
  return false;
41
68
  if (SKIP_FILES.has(name))
42
69
  return false;
70
+ // Only include files that actually call defineAction. CLI scripts or
71
+ // example templates that live in actions/ but don't export a defineAction
72
+ // would otherwise drag their own (often app/, browser-only, or fs-only)
73
+ // imports into the serverless bundle and fail to resolve.
74
+ try {
75
+ const content = fs.readFileSync(path.join(actionsDir, f), "utf-8");
76
+ if (!content.includes("defineAction"))
77
+ return false;
78
+ }
79
+ catch {
80
+ return false;
81
+ }
43
82
  return true;
44
83
  });
45
- // Compute relative path from .generated/ to actions/
84
+ }
85
+ function toIdent(name) {
86
+ return "a_" + name.replace(/[^a-zA-Z0-9_]/g, "_");
87
+ }
88
+ function writeIfChanged(outFile, content) {
89
+ const existing = fs.existsSync(outFile)
90
+ ? fs.readFileSync(outFile, "utf-8")
91
+ : "";
92
+ if (existing !== content) {
93
+ fs.mkdirSync(path.dirname(outFile), { recursive: true });
94
+ fs.writeFileSync(outFile, content);
95
+ }
96
+ }
97
+ /**
98
+ * Scan the actions directory and emit the types + runtime registry files.
99
+ * Only writes files whose content has changed, to avoid triggering rebuilds.
100
+ */
101
+ function generateActionArtifacts(actionsDir, projectRoot) {
46
102
  const outDir = path.resolve(projectRoot, ".generated");
47
103
  const relActionsDir = path.relative(outDir, actionsDir).replace(/\\/g, "/");
48
- const entries = actionFiles.map((f) => {
104
+ const actionFiles = scanActionFiles(actionsDir);
105
+ // --- types file ---------------------------------------------------------
106
+ const typeEntries = actionFiles.map((f) => {
49
107
  const name = f.replace(/\.(ts|js)$/, "");
50
108
  const relPath = `${relActionsDir}/${name}`;
51
109
  return ` "${name}": ActionEntry<typeof import("${relPath}")>;`;
52
110
  });
53
- const content = `// AUTO-GENERATED by @agent-native/core — do not edit manually.
111
+ const typesContent = `// AUTO-GENERATED by @agent-native/core — do not edit manually.
54
112
  // Regenerated when files in actions/ change.
55
113
  // This file augments the ActionRegistry interface so that useActionQuery and
56
114
  // useActionMutation infer the correct types from your action definitions.
@@ -65,20 +123,55 @@ type ActionEntry<T> = T extends { default: { run: (...args: infer A) => infer R
65
123
 
66
124
  declare module "@agent-native/core/client" {
67
125
  interface ActionRegistry {
68
- ${entries.join("\n")}
126
+ ${typeEntries.join("\n")}
69
127
  }
70
128
  }
71
129
 
72
130
  export {};
73
131
  `;
74
- fs.mkdirSync(outDir, { recursive: true });
75
- const outFile = path.join(outDir, "action-types.d.ts");
76
- const existing = fs.existsSync(outFile)
77
- ? fs.readFileSync(outFile, "utf-8")
78
- : "";
79
- if (existing !== content) {
80
- fs.writeFileSync(outFile, content);
132
+ writeIfChanged(path.join(outDir, "action-types.d.ts"), typesContent);
133
+ // --- runtime registry ---------------------------------------------------
134
+ // Static imports of each action's default export so bundlers see every
135
+ // action and include it in the server bundle. Normalization matches
136
+ // `loadActionsIntoRegistry` in server/action-discovery.ts.
137
+ const imports = [];
138
+ const entries = [];
139
+ const templateActionNames = new Set();
140
+ for (const f of actionFiles) {
141
+ const name = f.replace(/\.(ts|js)$/, "");
142
+ templateActionNames.add(name);
143
+ const ident = toIdent(name);
144
+ const relPath = `${relActionsDir}/${name}`;
145
+ imports.push(`import * as ${ident} from "${relPath}";`);
146
+ entries.push(` ${JSON.stringify(name)}: ${ident},`);
81
147
  }
148
+ // Framework-level sharing actions — only added when the template hasn't
149
+ // provided a same-named file (skip-existing merge). Static imports ensure
150
+ // bundlers pull these modules into the server bundle so
151
+ // `/_agent-native/actions/share-resource` (etc.) always resolve.
152
+ for (const entry of CORE_SHARING_ACTIONS) {
153
+ if (templateActionNames.has(entry.name))
154
+ continue;
155
+ const ident = toIdent(entry.name);
156
+ imports.push(`import * as ${ident} from "${entry.specifier}";`);
157
+ entries.push(` ${JSON.stringify(entry.name)}: ${ident},`);
158
+ }
159
+ const registryContent = `// AUTO-GENERATED by @agent-native/core — do not edit manually.
160
+ // Static-import registry of every action file. Bundlers (Nitro, Rolldown)
161
+ // see these imports and include the action modules in the server bundle.
162
+ // The agent-chat plugin normalizes each module into an ActionEntry shape.
163
+ ${imports.join("\n")}
164
+
165
+ const modules: Record<string, unknown> = {
166
+ ${entries.join("\n")}
167
+ };
168
+
169
+ export default modules;
170
+ `;
171
+ // Always write the registry — even when the template has no actions/ files
172
+ // we still emit imports for the framework-level sharing actions so they get
173
+ // mounted on every template that consumes the registry.
174
+ writeIfChanged(path.join(outDir, "actions-registry.ts"), registryContent);
82
175
  // Ensure .generated/ is in .gitignore
83
176
  const gitignorePath = path.join(projectRoot, ".gitignore");
84
177
  if (fs.existsSync(gitignorePath)) {
@@ -108,16 +201,16 @@ export function actionTypesPlugin() {
108
201
  actionsDir = path.resolve(projectRoot, "actions");
109
202
  },
110
203
  buildStart() {
111
- generateActionTypes(actionsDir, projectRoot);
204
+ generateActionArtifacts(actionsDir, projectRoot);
112
205
  },
113
206
  configureServer(server) {
114
207
  // Generate on startup
115
- generateActionTypes(actionsDir, projectRoot);
208
+ generateActionArtifacts(actionsDir, projectRoot);
116
209
  // Watch for changes in actions/
117
210
  const watcher = server.watcher;
118
211
  const handleChange = (file) => {
119
212
  if (file.startsWith(actionsDir) && /\.(ts|js)$/.test(file)) {
120
- generateActionTypes(actionsDir, projectRoot);
213
+ generateActionArtifacts(actionsDir, projectRoot);
121
214
  }
122
215
  };
123
216
  watcher.add(actionsDir);
@@ -129,4 +222,12 @@ export function actionTypesPlugin() {
129
222
  },
130
223
  };
131
224
  }
225
+ /**
226
+ * Public helper to regenerate the types + registry from a non-Vite context
227
+ * (e.g. the Nitro deploy build, where Vite plugins don't run).
228
+ */
229
+ export function generateActionRegistryForProject(projectRoot) {
230
+ const actionsDir = path.resolve(projectRoot, "actions");
231
+ generateActionArtifacts(actionsDir, projectRoot);
232
+ }
132
233
  //# sourceMappingURL=action-types-plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"action-types-plugin.js","sourceRoot":"","sources":["../../src/vite/action-types-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,oEAAoE;AACpE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,SAAS;IACT,KAAK;IACL,Y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,CAAC,CAAC;QACpD,CAAC;QACD,UAAU;YACR,mBAAmB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAC/C,CAAC;QACD,eAAe,CAAC,MAAM;YACpB,sBAAsB;YACtB,mBAAmB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;YAE7C,gCAAgC;YAChC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;YAC/B,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;gBACpC,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC3D,mBAAmB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;gBAC/C,CAAC;YACH,CAAC,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YAChC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACnC,qEAAqE;YACrE,uEAAuE;YACvE,6CAA6C;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"action-types-plugin.js","sourceRoot":"","sources":["../../src/vite/action-types-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,oEAAoE;AACpE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,SAAS;IACT,KAAK;IACL,YAAY;IACZ,WAAW;IACX,UAAU;CACX,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,oBAAoB,GAA+C;IACvE;QACE,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,mDAAmD;KAC/D;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,qDAAqD;KACjE;IACD;QACE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UAAU,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC3D,uBAAuB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;gBACnD,CAAC;YACH,CAAC,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YAChC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACnC,qEAAqE;YACrE,uEAAuE;YACvE,6CAA6C;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAAC,WAAmB;IAClE,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACxD,uBAAuB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "type": "module",
5
5
  "description": "Framework for agent-native application development — where AI agents and UI share state via files",
6
6
  "license": "MIT",
@@ -37,8 +37,15 @@
37
37
  "./resources/store": "./dist/resources/store.js",
38
38
  "./resources/metadata": "./dist/resources/metadata.js",
39
39
  "./oauth-tokens": "./dist/oauth-tokens/index.js",
40
+ "./secrets": "./dist/secrets/index.js",
40
41
  "./org": "./dist/org/index.js",
41
42
  "./client/org": "./dist/client/org/index.js",
43
+ "./sharing": "./dist/sharing/index.js",
44
+ "./sharing/actions/share-resource": "./dist/sharing/actions/share-resource.js",
45
+ "./sharing/actions/unshare-resource": "./dist/sharing/actions/unshare-resource.js",
46
+ "./sharing/actions/list-resource-shares": "./dist/sharing/actions/list-resource-shares.js",
47
+ "./sharing/actions/set-resource-visibility": "./dist/sharing/actions/set-resource-visibility.js",
48
+ "./client/sharing": "./dist/client/sharing/index.js",
42
49
  "./adapters/cli": "./dist/adapters/cli/index.js",
43
50
  "./router": "./dist/router/index.js",
44
51
  "./collab": "./dist/collab/index.js",
@@ -70,7 +77,7 @@
70
77
  "@clack/prompts": "^1.2.0",
71
78
  "@libsql/client": "^0.15.0",
72
79
  "@modelcontextprotocol/sdk": "^1.29.0",
73
- "@neondatabase/serverless": "^1.0.2",
80
+ "@neondatabase/serverless": "^1.1.0",
74
81
  "@radix-ui/react-popover": "^1.1.15",
75
82
  "@radix-ui/react-select": "^2.2.6",
76
83
  "@radix-ui/react-tooltip": "^1.2.8",
@@ -91,7 +98,7 @@
91
98
  "cron-parser": "^5.5.0",
92
99
  "diff-match-patch": "^1.0.5",
93
100
  "dotenv": "^17.2.1",
94
- "drizzle-orm": "^0.44.0",
101
+ "drizzle-orm": "^0.45.2",
95
102
  "h3": "^2.0.1-rc.20",
96
103
  "isbot": "^5",
97
104
  "jose": "^6.2.2",
@@ -105,7 +112,8 @@
105
112
  "tailwind-merge": "^2.6.0",
106
113
  "tiptap-markdown": "^0.9.0",
107
114
  "y-protocols": "^1.0.7",
108
- "yjs": "^13.6.30"
115
+ "yjs": "^13.6.30",
116
+ "zod": "^3.24.0"
109
117
  },
110
118
  "peerDependencies": {
111
119
  "@ai-sdk/anthropic": ">=1",