crewly 1.20.228 → 1.20.230
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/config/skills/agent/core/app-comments/SKILL.md +39 -5
- package/config/skills/agent/core/app-comments/execute.sh +9 -4
- package/config/skills/agent/core/app-comments/execute.test.sh +9 -0
- package/config/skills/agent/core/publish-app/SKILL.md +3 -1
- package/config/skills/agent/core/publish-app/execute.sh +14 -1
- package/config/skills/agent/core/publish-app/execute.test.sh +7 -0
- package/config/skills/orchestrator/transfer-app/SKILL.md +40 -0
- package/config/skills/orchestrator/transfer-app/execute.sh +16 -0
- package/dist/backend/backend/src/constants.d.ts +29 -0
- package/dist/backend/backend/src/constants.d.ts.map +1 -1
- package/dist/backend/backend/src/constants.js +29 -0
- package/dist/backend/backend/src/constants.js.map +1 -1
- package/dist/backend/backend/src/controllers/apps/apps.controller.d.ts +2 -0
- package/dist/backend/backend/src/controllers/apps/apps.controller.d.ts.map +1 -1
- package/dist/backend/backend/src/controllers/apps/apps.controller.js +6 -0
- package/dist/backend/backend/src/controllers/apps/apps.controller.js.map +1 -1
- package/dist/backend/backend/src/controllers/apps/apps.routes.d.ts +1 -0
- package/dist/backend/backend/src/controllers/apps/apps.routes.d.ts.map +1 -1
- package/dist/backend/backend/src/controllers/apps/apps.routes.js +3 -1
- package/dist/backend/backend/src/controllers/apps/apps.routes.js.map +1 -1
- package/dist/backend/backend/src/services/apps/app-roster.service.d.ts +86 -0
- package/dist/backend/backend/src/services/apps/app-roster.service.d.ts.map +1 -0
- package/dist/backend/backend/src/services/apps/app-roster.service.js +119 -0
- package/dist/backend/backend/src/services/apps/app-roster.service.js.map +1 -0
- package/dist/backend/backend/src/services/apps/app-wake-message.d.ts +24 -1
- package/dist/backend/backend/src/services/apps/app-wake-message.d.ts.map +1 -1
- package/dist/backend/backend/src/services/apps/app-wake-message.js +62 -5
- package/dist/backend/backend/src/services/apps/app-wake-message.js.map +1 -1
- package/dist/backend/backend/src/services/apps/app-wake.service.d.ts +56 -0
- package/dist/backend/backend/src/services/apps/app-wake.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/apps/app-wake.service.js +211 -8
- package/dist/backend/backend/src/services/apps/app-wake.service.js.map +1 -1
- package/dist/backend/backend/src/services/apps/apps-registry.service.d.ts +33 -0
- package/dist/backend/backend/src/services/apps/apps-registry.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/apps/apps-registry.service.js +44 -0
- package/dist/backend/backend/src/services/apps/apps-registry.service.js.map +1 -1
- package/dist/backend/backend/src/services/apps/apps.service.d.ts +88 -0
- package/dist/backend/backend/src/services/apps/apps.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/apps/apps.service.js +106 -6
- package/dist/backend/backend/src/services/apps/apps.service.js.map +1 -1
- package/dist/backend/backend/src/services/apps/apps.wiring.d.ts +21 -1
- package/dist/backend/backend/src/services/apps/apps.wiring.d.ts.map +1 -1
- package/dist/backend/backend/src/services/apps/apps.wiring.js +46 -1
- package/dist/backend/backend/src/services/apps/apps.wiring.js.map +1 -1
- package/dist/backend/backend/src/services/slack/slack-team-channel.service.d.ts +5 -3
- package/dist/backend/backend/src/services/slack/slack-team-channel.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/slack/slack-team-channel.service.js +48 -22
- package/dist/backend/backend/src/services/slack/slack-team-channel.service.js.map +1 -1
- package/dist/backend/backend/src/services/slack/slack-thread-context.service.d.ts +1 -1
- package/dist/backend/backend/src/services/slack/slack-thread-context.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/slack/slack-thread-context.service.js +9 -4
- package/dist/backend/backend/src/services/slack/slack-thread-context.service.js.map +1 -1
- package/dist/backend/build-info.json +2 -2
- package/dist/cli/backend/src/constants.d.ts +29 -0
- package/dist/cli/backend/src/constants.d.ts.map +1 -1
- package/dist/cli/backend/src/constants.js +29 -0
- package/dist/cli/backend/src/constants.js.map +1 -1
- package/dist/cli/backend/src/services/slack/slack-team-channel.service.d.ts +5 -3
- package/dist/cli/backend/src/services/slack/slack-team-channel.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/slack/slack-team-channel.service.js +48 -22
- package/dist/cli/backend/src/services/slack/slack-team-channel.service.js.map +1 -1
- package/dist/cli/backend/src/services/slack/slack-thread-context.service.d.ts +1 -1
- package/dist/cli/backend/src/services/slack/slack-thread-context.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/slack/slack-thread-context.service.js +9 -4
- package/dist/cli/backend/src/services/slack/slack-thread-context.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -41,6 +41,13 @@ export interface VisitorWakeState {
|
|
|
41
41
|
/** Visitor submissions counted but not delivered (over the cap), not yet reported to the agent */
|
|
42
42
|
skipped: number;
|
|
43
43
|
}
|
|
44
|
+
/** Read position in this instance's @mention inbox (Cloud `GET /mentions`). */
|
|
45
|
+
export interface MentionProgress {
|
|
46
|
+
/** Last inbox seq handled; null until the poller first reads the head */
|
|
47
|
+
cursor: number | null;
|
|
48
|
+
/** Seqs above `cursor` already delivered (another mention is still pending) */
|
|
49
|
+
delivered: number[];
|
|
50
|
+
}
|
|
44
51
|
/** What to look an app up by when publishing. */
|
|
45
52
|
export interface AppLookup {
|
|
46
53
|
appId?: string;
|
|
@@ -91,6 +98,19 @@ export declare class AppsRegistryService {
|
|
|
91
98
|
* @returns The stored entry
|
|
92
99
|
*/
|
|
93
100
|
upsert(appId: string, patch: Partial<Omit<AppRegistryEntry, 'appId'>>): Promise<AppRegistryEntry>;
|
|
101
|
+
/**
|
|
102
|
+
* Hand an app to another agent (a transfer between agents or teams): the
|
|
103
|
+
* wake/comment deliveries, team ownership checks and thumbnails all read
|
|
104
|
+
* `agentSession`, so they follow the new publisher.
|
|
105
|
+
*
|
|
106
|
+
* @param appId - App id
|
|
107
|
+
* @param session - The new publisher's agent session
|
|
108
|
+
* @returns The previous and the stored entry, or null for an unknown app
|
|
109
|
+
*/
|
|
110
|
+
setPublisher(appId: string, session: string): Promise<{
|
|
111
|
+
previous: string | null;
|
|
112
|
+
entry: AppRegistryEntry;
|
|
113
|
+
} | null>;
|
|
94
114
|
/**
|
|
95
115
|
* Store the poller's progress: the cursor and the seqs above it that were
|
|
96
116
|
* already delivered (no-op for an unknown app or no change).
|
|
@@ -115,6 +135,19 @@ export declare class AppsRegistryService {
|
|
|
115
135
|
* @param state - Day, wakes that day, submissions skipped and not yet reported
|
|
116
136
|
*/
|
|
117
137
|
setVisitorWakes(appId: string, state: VisitorWakeState): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Where the poller is in this instance's @mention inbox.
|
|
140
|
+
*
|
|
141
|
+
* @returns Cursor (null = never read) and delivered seqs above it
|
|
142
|
+
*/
|
|
143
|
+
getMentionProgress(): Promise<MentionProgress>;
|
|
144
|
+
/**
|
|
145
|
+
* Store the @mention inbox position (no-op when unchanged).
|
|
146
|
+
*
|
|
147
|
+
* @param cursor - Safe cursor (before every undelivered mention)
|
|
148
|
+
* @param delivered - Delivered seqs above the cursor
|
|
149
|
+
*/
|
|
150
|
+
setMentionProgress(cursor: number, delivered: number[]): Promise<void>;
|
|
118
151
|
/**
|
|
119
152
|
* Mark an app gone from Cloud.
|
|
120
153
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps-registry.service.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/apps/apps-registry.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,uFAAuF;IACvF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gFAAgF;IAChF,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uHAAuH;IACvH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,gHAAgH;IAChH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,6GAA6G;IAC7G,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC;AAED,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,OAAO,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"apps-registry.service.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/apps/apps-registry.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,uFAAuF;IACvF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gFAAgF;IAChF,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uHAAuH;IACvH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,gHAAgH;IAChH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,6GAA6G;IAC7G,YAAY,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;IAwBjG;;;;;;;;OAQG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,gBAAgB,CAAA;KAAE,GAAG,IAAI,CAAC;IAWlH;;;;;;;OAOG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAepF;;;;;;OAMG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO9E;;;;;OAKG;IACG,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5E;;;;OAIG;IACG,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC;IAKpD;;;;;OAKG;IACG,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAS5E;;;;OAIG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAShD"}
|
|
@@ -120,6 +120,26 @@ export class AppsRegistryService {
|
|
|
120
120
|
return { ...next };
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Hand an app to another agent (a transfer between agents or teams): the
|
|
125
|
+
* wake/comment deliveries, team ownership checks and thumbnails all read
|
|
126
|
+
* `agentSession`, so they follow the new publisher.
|
|
127
|
+
*
|
|
128
|
+
* @param appId - App id
|
|
129
|
+
* @param session - The new publisher's agent session
|
|
130
|
+
* @returns The previous and the stored entry, or null for an unknown app
|
|
131
|
+
*/
|
|
132
|
+
setPublisher(appId, session) {
|
|
133
|
+
return this.mutate((d) => {
|
|
134
|
+
const e = d.apps[appId];
|
|
135
|
+
if (!e)
|
|
136
|
+
return null;
|
|
137
|
+
const previous = e.agentSession ?? null;
|
|
138
|
+
e.agentSession = session;
|
|
139
|
+
e.updatedAt = new Date().toISOString();
|
|
140
|
+
return { previous, entry: { ...e } };
|
|
141
|
+
});
|
|
142
|
+
}
|
|
123
143
|
/**
|
|
124
144
|
* Store the poller's progress: the cursor and the seqs above it that were
|
|
125
145
|
* already delivered (no-op for an unknown app or no change).
|
|
@@ -174,6 +194,30 @@ export class AppsRegistryService {
|
|
|
174
194
|
e.visitorWakes = { day: state.day, count: state.count, skipped: state.skipped };
|
|
175
195
|
});
|
|
176
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Where the poller is in this instance's @mention inbox.
|
|
199
|
+
*
|
|
200
|
+
* @returns Cursor (null = never read) and delivered seqs above it
|
|
201
|
+
*/
|
|
202
|
+
async getMentionProgress() {
|
|
203
|
+
const m = (await this.load()).mentions;
|
|
204
|
+
return { cursor: typeof m?.cursor === 'number' ? m.cursor : null, delivered: Array.isArray(m?.delivered) ? [...m.delivered] : [] };
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Store the @mention inbox position (no-op when unchanged).
|
|
208
|
+
*
|
|
209
|
+
* @param cursor - Safe cursor (before every undelivered mention)
|
|
210
|
+
* @param delivered - Delivered seqs above the cursor
|
|
211
|
+
*/
|
|
212
|
+
async setMentionProgress(cursor, delivered) {
|
|
213
|
+
const sorted = [...delivered].filter((n) => n > cursor).sort((a, b) => a - b);
|
|
214
|
+
const cur = (await this.load()).mentions;
|
|
215
|
+
if (cur && cur.cursor === cursor && JSON.stringify(cur.delivered ?? []) === JSON.stringify(sorted))
|
|
216
|
+
return;
|
|
217
|
+
await this.mutate((d) => {
|
|
218
|
+
d.mentions = { cursor, delivered: sorted };
|
|
219
|
+
});
|
|
220
|
+
}
|
|
177
221
|
/**
|
|
178
222
|
* Mark an app gone from Cloud.
|
|
179
223
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps-registry.service.js","sourceRoot":"","sources":["../../../../../../backend/src/services/apps/apps-registry.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"apps-registry.service.js","sourceRoot":"","sources":["../../../../../../backend/src/services/apps/apps-registry.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AA0D7E;;GAEG;AACH,MAAM,OAAO,mBAAmB;IACb,IAAI,CAAS;IACtB,IAAI,GAAwB,IAAI,CAAC;IACjC,KAAK,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC;IAEpD;;OAEG;IACH,YAAY,UAAkB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,qBAAqB,CAAC,YAAY,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC7G,CAAC;IAEO,KAAK,CAAC,IAAI;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,GAAG,GAAG,MAAM,YAAY,CAAe,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YACtE,IAAI,CAAC,IAAI,GAAG,GAAG,I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C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9E,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC;QACzC,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YAAE,OAAO;QAC3G,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YACtB,CAAC,CAAC,QAAQ,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAAC,KAAa;QAC7B,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YACtB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxB,IAAI,CAAC,EAAE,CAAC;gBACN,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC;gBACjB,CAAC,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACzC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -142,6 +142,32 @@ export interface AppCardPoster {
|
|
|
142
142
|
/** Post where the agent's conversation with the owner is (P2 path) */
|
|
143
143
|
postReply(agentSession: string, text: string): Promise<CardPostResult>;
|
|
144
144
|
}
|
|
145
|
+
/** An agent that can publish apps: a member of a team on this machine. */
|
|
146
|
+
export interface AppsMember {
|
|
147
|
+
session: string;
|
|
148
|
+
name: string;
|
|
149
|
+
team: string | null;
|
|
150
|
+
}
|
|
151
|
+
/** Team lookups the transfer needs. */
|
|
152
|
+
export interface AppsDirectory {
|
|
153
|
+
/** The member of an existing, non-archived team with this session; null otherwise */
|
|
154
|
+
member(session: string): Promise<AppsMember | null>;
|
|
155
|
+
/** Whether `lead` leads the team that `publisher` is a member of */
|
|
156
|
+
leadsTeamOf(lead: string, publisher: string): Promise<boolean>;
|
|
157
|
+
}
|
|
158
|
+
/** Result of {@link AppsService.transfer}. */
|
|
159
|
+
export interface TransferResult {
|
|
160
|
+
appId: string;
|
|
161
|
+
name: string | null;
|
|
162
|
+
/** The new publisher */
|
|
163
|
+
publisher: string;
|
|
164
|
+
/** The previous publisher (null = the orchestrator / none) */
|
|
165
|
+
previous: string | null;
|
|
166
|
+
/** False when `toSession` already was the publisher: nothing changed */
|
|
167
|
+
changed: boolean;
|
|
168
|
+
/** Which agents were told */
|
|
169
|
+
notified: string[];
|
|
170
|
+
}
|
|
145
171
|
/** Constructor dependencies. */
|
|
146
172
|
export interface AppsServiceDeps {
|
|
147
173
|
client: AppsCloudClient;
|
|
@@ -149,10 +175,20 @@ export interface AppsServiceDeps {
|
|
|
149
175
|
cards?: AppCardPoster;
|
|
150
176
|
/** Whether two agent sessions are in the same team (data access for the publisher's team) */
|
|
151
177
|
sameTeam?: (a: string, b: string) => Promise<boolean>;
|
|
178
|
+
/** Who may receive and hand over an app (transfer); absent = transfers are refused */
|
|
179
|
+
directory?: AppsDirectory;
|
|
180
|
+
/** Tell an agent something (transfer notes); `activate` = start it first when it is down */
|
|
181
|
+
notifyAgent?: (session: string, text: string, activate: boolean) => Promise<boolean>;
|
|
152
182
|
/** Captures the portal thumbnail after a publish (background, never fails the publish) */
|
|
153
183
|
thumbnails?: {
|
|
154
184
|
schedule(appId: string, agent?: string | null): void;
|
|
155
185
|
};
|
|
186
|
+
/** Pushes this instance's agent roster (who the owner can @mention) after a publish */
|
|
187
|
+
roster?: {
|
|
188
|
+
pushIfChanged(): Promise<boolean>;
|
|
189
|
+
};
|
|
190
|
+
/** This instance's Cloud id (a mention names the instance its agent runs on) */
|
|
191
|
+
instanceId?: () => Promise<string | null>;
|
|
156
192
|
}
|
|
157
193
|
/**
|
|
158
194
|
* Check an app id's shape.
|
|
@@ -162,6 +198,28 @@ export interface AppsServiceDeps {
|
|
|
162
198
|
* @throws AppsCloudError validation
|
|
163
199
|
*/
|
|
164
200
|
export declare function requireAppId(appId: unknown): string;
|
|
201
|
+
/** The parts of a Cloud comment thread the mention check reads. */
|
|
202
|
+
interface ThreadMentions {
|
|
203
|
+
mentions?: Array<{
|
|
204
|
+
session?: string;
|
|
205
|
+
instanceId?: string;
|
|
206
|
+
}>;
|
|
207
|
+
replies?: Array<{
|
|
208
|
+
mentions?: Array<{
|
|
209
|
+
session?: string;
|
|
210
|
+
instanceId?: string;
|
|
211
|
+
}>;
|
|
212
|
+
}>;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Whether the owner @mentioned `session` (on this instance) anywhere in a thread.
|
|
216
|
+
*
|
|
217
|
+
* @param t - Thread from Cloud
|
|
218
|
+
* @param session - Agent session
|
|
219
|
+
* @param instanceId - This instance's id (null = unknown: any instance)
|
|
220
|
+
* @returns True when mentioned in the comment or one of its replies
|
|
221
|
+
*/
|
|
222
|
+
export declare function threadMentions(t: ThreadMentions | null | undefined, session: string, instanceId: string | null): boolean;
|
|
165
223
|
/**
|
|
166
224
|
* The app's plain URL (what agents see; opens the sign-in page without a session).
|
|
167
225
|
*
|
|
@@ -360,6 +418,22 @@ export declare class AppsService {
|
|
|
360
418
|
* @returns Versions
|
|
361
419
|
*/
|
|
362
420
|
versions(appId: unknown, caller: AppsCaller): Promise<CloudVersionView[]>;
|
|
421
|
+
/**
|
|
422
|
+
* Transfer an app to another agent, so a new team can publish it.
|
|
423
|
+
*
|
|
424
|
+
* Allowed: the owner, the orchestrator, the current publisher, or a lead of
|
|
425
|
+
* the publisher's team. The target must be a member of an existing,
|
|
426
|
+
* non-archived team on this machine. Cloud is updated first (the portal's
|
|
427
|
+
* publisher), then the local registry, which wake deliveries, team ownership
|
|
428
|
+
* checks and thumbnails all read. The old and new publisher are told.
|
|
429
|
+
*
|
|
430
|
+
* @param appId - App id
|
|
431
|
+
* @param toSession - New publisher's session
|
|
432
|
+
* @param caller - Agent or owner
|
|
433
|
+
* @returns What changed
|
|
434
|
+
* @throws AppsCloudError validation / 403 not_your_app / 404 not_found
|
|
435
|
+
*/
|
|
436
|
+
transfer(appId: unknown, toSession: unknown, caller: AppsCaller): Promise<TransferResult>;
|
|
363
437
|
/**
|
|
364
438
|
* Agents may manage (publish, roll back, list versions of) apps they or a
|
|
365
439
|
* teammate published — so a lead can hand app work to a member (owner
|
|
@@ -470,6 +544,19 @@ export declare class AppsService {
|
|
|
470
544
|
* @returns The thread
|
|
471
545
|
*/
|
|
472
546
|
getComment(appId: unknown, commentId: unknown, caller: AppsCaller): Promise<unknown>;
|
|
547
|
+
/**
|
|
548
|
+
* Who may read, reply to and resolve one thread: the publisher's team (as
|
|
549
|
+
* for the app's data), or an agent the owner @mentioned in that thread on
|
|
550
|
+
* this instance (crewly-services apps/SPEC.md §12.1), even outside the
|
|
551
|
+
* team. Listing all comments and managing the app stay team-only.
|
|
552
|
+
*
|
|
553
|
+
* @param appId - App id
|
|
554
|
+
* @param path - Cloud path of the thread
|
|
555
|
+
* @param caller - Agent or owner
|
|
556
|
+
* @returns The thread when it had to be fetched for the check, else undefined
|
|
557
|
+
* @throws AppsCloudError 403 not_your_app
|
|
558
|
+
*/
|
|
559
|
+
private assertCommentAccess;
|
|
473
560
|
/**
|
|
474
561
|
* Reply in a thread (shown to the owner in the app's comments).
|
|
475
562
|
*
|
|
@@ -508,4 +595,5 @@ export declare class AppsService {
|
|
|
508
595
|
private docPath;
|
|
509
596
|
private validateFiles;
|
|
510
597
|
}
|
|
598
|
+
export {};
|
|
511
599
|
//# sourceMappingURL=apps.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.service.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/apps/apps.service.ts"],"names":[],"mappings":"AAAA;;;;;;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AE,SAAS,GAAG,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAM9H,OAAO,CAAC,WAAW;IAMnB;;;;;;;;;;;;OAYG;YACW,WAAW;IAIzB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,aAAa;CAetB"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module services/apps/apps.service
|
|
9
9
|
*/
|
|
10
10
|
import path from 'path';
|
|
11
|
-
import { CREWLY_APPS_CONSTANTS } from '../../constants.js';
|
|
11
|
+
import { CREWLY_APPS_CONSTANTS, ORCHESTRATOR_SESSION_NAME } from '../../constants.js';
|
|
12
12
|
import { AppsCloudError } from './apps-cloud.client.js';
|
|
13
13
|
import { toOpenLinkInfos, usableMintedLink } from './app-open-link.js';
|
|
14
14
|
import { sanitizeAppData } from './app-wake-message.js';
|
|
@@ -45,6 +45,23 @@ function requireDocId(id) {
|
|
|
45
45
|
function notYourApp() {
|
|
46
46
|
return new AppsCloudError(403, C.ERROR_CODES.NOT_YOUR_APP, 'This app was published by another agent. Only its publisher can publish or roll it back, and only the publisher and its team can use its data. Ask the owner if you need it.');
|
|
47
47
|
}
|
|
48
|
+
function notMentioned() {
|
|
49
|
+
return new AppsCloudError(403, C.ERROR_CODES.NOT_YOUR_APP, 'This app was published by an agent outside your team, and the owner did not @mention you in this comment. Only the publisher\'s team and agents mentioned in a thread can use it.');
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Whether the owner @mentioned `session` (on this instance) anywhere in a thread.
|
|
53
|
+
*
|
|
54
|
+
* @param t - Thread from Cloud
|
|
55
|
+
* @param session - Agent session
|
|
56
|
+
* @param instanceId - This instance's id (null = unknown: any instance)
|
|
57
|
+
* @returns True when mentioned in the comment or one of its replies
|
|
58
|
+
*/
|
|
59
|
+
export function threadMentions(t, session, instanceId) {
|
|
60
|
+
if (!t)
|
|
61
|
+
return false;
|
|
62
|
+
const lists = [t.mentions ?? [], ...(t.replies ?? []).map((r) => r.mentions ?? [])];
|
|
63
|
+
return lists.some((l) => Array.isArray(l) && l.some((m) => m?.session === session && (!instanceId || !m.instanceId || m.instanceId === instanceId)));
|
|
64
|
+
}
|
|
48
65
|
function requireData(data) {
|
|
49
66
|
if (!data || typeof data !== 'object' || Array.isArray(data))
|
|
50
67
|
throw validation('data must be a JSON object.');
|
|
@@ -302,6 +319,8 @@ export class AppsService {
|
|
|
302
319
|
catch {
|
|
303
320
|
/* best effort */
|
|
304
321
|
}
|
|
322
|
+
// Who the owner can @mention in this app's comments (background; only sent when it changed).
|
|
323
|
+
void this.deps.roster?.pushIfChanged().catch(() => false);
|
|
305
324
|
// crewly-services #33: a new version of a public app takes it private
|
|
306
325
|
// with a pending re-approval. Re-read the app (one GET, only when it was public).
|
|
307
326
|
let publicPaused = false;
|
|
@@ -560,6 +579,59 @@ export class AppsService {
|
|
|
560
579
|
await this.assertPublisher(id, caller);
|
|
561
580
|
return this.deps.client.request('GET', `/apps/${id}/versions`, { agent: caller.agentSession });
|
|
562
581
|
}
|
|
582
|
+
/**
|
|
583
|
+
* Transfer an app to another agent, so a new team can publish it.
|
|
584
|
+
*
|
|
585
|
+
* Allowed: the owner, the orchestrator, the current publisher, or a lead of
|
|
586
|
+
* the publisher's team. The target must be a member of an existing,
|
|
587
|
+
* non-archived team on this machine. Cloud is updated first (the portal's
|
|
588
|
+
* publisher), then the local registry, which wake deliveries, team ownership
|
|
589
|
+
* checks and thumbnails all read. The old and new publisher are told.
|
|
590
|
+
*
|
|
591
|
+
* @param appId - App id
|
|
592
|
+
* @param toSession - New publisher's session
|
|
593
|
+
* @param caller - Agent or owner
|
|
594
|
+
* @returns What changed
|
|
595
|
+
* @throws AppsCloudError validation / 403 not_your_app / 404 not_found
|
|
596
|
+
*/
|
|
597
|
+
async transfer(appId, toSession, caller) {
|
|
598
|
+
const id = requireAppId(appId);
|
|
599
|
+
if (typeof toSession !== 'string' || !/^[A-Za-z0-9_.@:-]{1,128}$/.test(toSession)) {
|
|
600
|
+
throw validation('toSession must be the session name of the agent that takes the app over.');
|
|
601
|
+
}
|
|
602
|
+
const entry = await this.deps.registry.get(id);
|
|
603
|
+
if (!entry || entry.deleted)
|
|
604
|
+
throw new AppsCloudError(404, 'not_found', 'No such app on this machine.');
|
|
605
|
+
const me = caller.agentSession;
|
|
606
|
+
const current = entry.agentSession ?? null;
|
|
607
|
+
if (me && me !== ORCHESTRATOR_SESSION_NAME && me !== current) {
|
|
608
|
+
const lead = !!current && !!this.deps.directory && (await this.deps.directory.leadsTeamOf(me, current).catch(() => false));
|
|
609
|
+
if (!lead) {
|
|
610
|
+
throw new AppsCloudError(403, C.ERROR_CODES.NOT_YOUR_APP, 'Only the owner, the orchestrator, the app\'s publisher or the lead of the publisher\'s team can transfer an app.');
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
const target = this.deps.directory ? await this.deps.directory.member(toSession) : null;
|
|
614
|
+
if (!target)
|
|
615
|
+
throw validation(`${toSession} is not a member of an active team on this machine, so it cannot take over an app.`);
|
|
616
|
+
if (current === toSession)
|
|
617
|
+
return { appId: id, name: entry.name, publisher: toSession, previous: current, changed: false, notified: [] };
|
|
618
|
+
await this.deps.client.request('PUT', `/apps/${id}/publisher`, { body: { session: toSession }, agent: me });
|
|
619
|
+
const moved = await this.deps.registry.setPublisher(id, toSession);
|
|
620
|
+
const previous = moved?.previous ?? current;
|
|
621
|
+
const notified = [];
|
|
622
|
+
const tell = async (session, text, activate) => {
|
|
623
|
+
if (!session || session === me || !this.deps.notifyAgent)
|
|
624
|
+
return;
|
|
625
|
+
if (await this.deps.notifyAgent(session, text, activate).catch(() => false))
|
|
626
|
+
notified.push(session);
|
|
627
|
+
};
|
|
628
|
+
const label = entry.name ? `"${entry.name}" (${id})` : id;
|
|
629
|
+
const who = me ? `${me}` : 'the owner';
|
|
630
|
+
await tell(toSession, `[Crewly Apps] ${who} transferred the app ${label} to you. You are now its publisher: new versions, rollbacks, data and comments are yours. ` +
|
|
631
|
+
`Publish with: publish-app --app ${id} --dir <your project directory>${entry.source ? ` (it was last published from ${entry.source})` : ''}.`, true);
|
|
632
|
+
await tell(previous, `[Crewly Apps] The app ${label} was transferred to ${toSession} by ${who}. You can no longer publish, roll back or use its data; its comments and changes now go to ${toSession}.`, false);
|
|
633
|
+
return { appId: id, name: entry.name, publisher: toSession, previous, changed: true, notified };
|
|
634
|
+
}
|
|
563
635
|
/**
|
|
564
636
|
* Agents may manage (publish, roll back, list versions of) apps they or a
|
|
565
637
|
* teammate published — so a lead can hand app work to a member (owner
|
|
@@ -716,7 +788,8 @@ export class AppsService {
|
|
|
716
788
|
}
|
|
717
789
|
// -------------------------------------------------------------------------
|
|
718
790
|
// Comments (crewly#1056): the owner comments on an element in the app; the
|
|
719
|
-
// publisher (or its team) lists, replies and resolves
|
|
791
|
+
// publisher (or its team) lists, replies and resolves; an agent the owner
|
|
792
|
+
// @mentioned in a thread may get, reply to and resolve that thread. Only the owner can
|
|
720
793
|
// start a comment (in the app). Answers are sanitised like app data: the
|
|
721
794
|
// comment text is the owner's, the anchor comes from the app's page.
|
|
722
795
|
// -------------------------------------------------------------------------
|
|
@@ -746,8 +819,35 @@ export class AppsService {
|
|
|
746
819
|
*/
|
|
747
820
|
async getComment(appId, commentId, caller) {
|
|
748
821
|
const path = this.commentPath(appId, commentId);
|
|
749
|
-
await this.
|
|
750
|
-
return this.dataRequest('GET', path, { agent: caller.agentSession });
|
|
822
|
+
const thread = await this.assertCommentAccess(appId, path, caller);
|
|
823
|
+
return thread !== undefined ? sanitizeAppData(thread) : this.dataRequest('GET', path, { agent: caller.agentSession });
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Who may read, reply to and resolve one thread: the publisher's team (as
|
|
827
|
+
* for the app's data), or an agent the owner @mentioned in that thread on
|
|
828
|
+
* this instance (crewly-services apps/SPEC.md §12.1), even outside the
|
|
829
|
+
* team. Listing all comments and managing the app stay team-only.
|
|
830
|
+
*
|
|
831
|
+
* @param appId - App id
|
|
832
|
+
* @param path - Cloud path of the thread
|
|
833
|
+
* @param caller - Agent or owner
|
|
834
|
+
* @returns The thread when it had to be fetched for the check, else undefined
|
|
835
|
+
* @throws AppsCloudError 403 not_your_app
|
|
836
|
+
*/
|
|
837
|
+
async assertCommentAccess(appId, path, caller) {
|
|
838
|
+
try {
|
|
839
|
+
await this.assertDataAccess(appId, caller);
|
|
840
|
+
return undefined;
|
|
841
|
+
}
|
|
842
|
+
catch (err) {
|
|
843
|
+
if (!(err instanceof AppsCloudError) || err.code !== C.ERROR_CODES.NOT_YOUR_APP || !caller.agentSession)
|
|
844
|
+
throw err;
|
|
845
|
+
}
|
|
846
|
+
const thread = await this.deps.client.request('GET', path, { agent: caller.agentSession });
|
|
847
|
+
const instanceId = this.deps.instanceId ? await this.deps.instanceId().catch(() => null) : null;
|
|
848
|
+
if (!threadMentions(thread, caller.agentSession, instanceId))
|
|
849
|
+
throw notMentioned();
|
|
850
|
+
return thread;
|
|
751
851
|
}
|
|
752
852
|
/**
|
|
753
853
|
* Reply in a thread (shown to the owner in the app's comments).
|
|
@@ -764,7 +864,7 @@ export class AppsService {
|
|
|
764
864
|
throw validation('text is required.');
|
|
765
865
|
if (text.length > C.COMMENTS.MAX_BODY_CHARS)
|
|
766
866
|
throw validation(`A reply is at most ${C.COMMENTS.MAX_BODY_CHARS} characters.`);
|
|
767
|
-
await this.
|
|
867
|
+
await this.assertCommentAccess(appId, path, caller);
|
|
768
868
|
return this.dataRequest('POST', `${path}/replies`, { body: { body: text.trim() }, agent: caller.agentSession });
|
|
769
869
|
}
|
|
770
870
|
/**
|
|
@@ -778,7 +878,7 @@ export class AppsService {
|
|
|
778
878
|
*/
|
|
779
879
|
async setCommentStatus(appId, commentId, action, caller) {
|
|
780
880
|
const path = this.commentPath(appId, commentId);
|
|
781
|
-
await this.
|
|
881
|
+
await this.assertCommentAccess(appId, path, caller);
|
|
782
882
|
return this.dataRequest('POST', `${path}/${action}`, { agent: caller.agentSession });
|
|
783
883
|
}
|
|
784
884
|
commentPath(appId, commentId) {
|