openmates 0.15.0-alpha.16 → 0.15.0-alpha.18
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/{chunk-WPH4ASSL.js → chunk-4VO4EPTS.js} +215 -18
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1338,9 +1338,11 @@ var OpenMatesWsClient = class {
|
|
|
1338
1338
|
const token = options.wsToken || options.refreshToken || "";
|
|
1339
1339
|
const query = new URLSearchParams({
|
|
1340
1340
|
sessionId: options.sessionId,
|
|
1341
|
-
token
|
|
1342
|
-
client_capabilities: "task_update_jobs"
|
|
1341
|
+
token
|
|
1343
1342
|
});
|
|
1343
|
+
if (options.taskUpdateJobs !== false) {
|
|
1344
|
+
query.set("client_capabilities", "task_update_jobs");
|
|
1345
|
+
}
|
|
1344
1346
|
const wsHeaders = {};
|
|
1345
1347
|
if (options.userAgent) {
|
|
1346
1348
|
wsHeaders["User-Agent"] = options.userAgent;
|
|
@@ -3980,6 +3982,13 @@ function taskUpdateJobBelongsToActiveTurn(job, activeChatId, taskEvents) {
|
|
|
3980
3982
|
void activeChatId;
|
|
3981
3983
|
return taskEvents.some((event) => event.task_update_job_id === job.job_id);
|
|
3982
3984
|
}
|
|
3985
|
+
function messageExplicitlyRequestsTasksAppSkill(message) {
|
|
3986
|
+
return /@skill:tasks:(create|search)\b/.test(message);
|
|
3987
|
+
}
|
|
3988
|
+
function isStaleTaskUpdateJobError(error) {
|
|
3989
|
+
if (!(error instanceof WebSocketProtocolError)) return false;
|
|
3990
|
+
return error.message.includes("Task update job already committed") || error.message.includes("Task update job expired") || error.message.includes("Task update job not found");
|
|
3991
|
+
}
|
|
3983
3992
|
function buildTaskUpdateJobPersistPayload(params) {
|
|
3984
3993
|
const encryptedTaskPayload = pruneAbsentTaskPersistFields(params.encryptedTaskPayload);
|
|
3985
3994
|
assertTaskPersistPayloadEncrypted(encryptedTaskPayload);
|
|
@@ -5928,7 +5937,10 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
5928
5937
|
}
|
|
5929
5938
|
}
|
|
5930
5939
|
}
|
|
5931
|
-
const
|
|
5940
|
+
const explicitTasksAppSkill = messageExplicitlyRequestsTasksAppSkill(params.message);
|
|
5941
|
+
const { ws, session, ownerId } = await this.openWsClient({
|
|
5942
|
+
taskUpdateJobs: !explicitTasksAppSkill
|
|
5943
|
+
});
|
|
5932
5944
|
if (!params.incognito && !ownerId) {
|
|
5933
5945
|
ws.close();
|
|
5934
5946
|
throw new Error("Authenticated user identity is required for saved chat recovery.");
|
|
@@ -5982,9 +5994,10 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
5982
5994
|
}
|
|
5983
5995
|
}
|
|
5984
5996
|
}
|
|
5997
|
+
const clientCapabilities = explicitTasksAppSkill ? [] : ["task_update_jobs"];
|
|
5985
5998
|
const messagePayload = {
|
|
5986
5999
|
chat_id: chatId,
|
|
5987
|
-
client_capabilities:
|
|
6000
|
+
client_capabilities: clientCapabilities,
|
|
5988
6001
|
is_incognito: Boolean(params.incognito),
|
|
5989
6002
|
message: {
|
|
5990
6003
|
message_id: messageId,
|
|
@@ -6724,11 +6737,20 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
6724
6737
|
(payload) => payload.job_id === job.job_id,
|
|
6725
6738
|
2e4
|
|
6726
6739
|
);
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6740
|
+
let claim;
|
|
6741
|
+
try {
|
|
6742
|
+
await params.ws.sendAsync("task_update_job_claim", {
|
|
6743
|
+
protocol_version: 1,
|
|
6744
|
+
job_id: job.job_id
|
|
6745
|
+
});
|
|
6746
|
+
claim = (await claimPromise).payload;
|
|
6747
|
+
} catch (error) {
|
|
6748
|
+
if (isStaleTaskUpdateJobError(error)) {
|
|
6749
|
+
handledJobIds.add(job.job_id);
|
|
6750
|
+
continue;
|
|
6751
|
+
}
|
|
6752
|
+
throw error;
|
|
6753
|
+
}
|
|
6732
6754
|
const privatePatch = claim.private_patch ?? {};
|
|
6733
6755
|
const safeMetadata = claim.safe_metadata ?? {};
|
|
6734
6756
|
const sourceChatId = claim.chat_id ?? job.chat_id ?? params.activeChatId;
|
|
@@ -8770,6 +8792,21 @@ Required: ${schema.required.join(", ")}`
|
|
|
8770
8792
|
const chatKeyBytes = await decryptBytesWithAesGcm(encChatKey, masterKey);
|
|
8771
8793
|
if (!chatKeyBytes)
|
|
8772
8794
|
throw new Error("Failed to decrypt chat key. Try logging in again.");
|
|
8795
|
+
const metadataResponse = await this.http.post(
|
|
8796
|
+
"/v1/share/chat/metadata",
|
|
8797
|
+
{
|
|
8798
|
+
chat_id: resolvedId,
|
|
8799
|
+
title: null,
|
|
8800
|
+
summary: null,
|
|
8801
|
+
share_cta_text: null,
|
|
8802
|
+
is_shared: true
|
|
8803
|
+
}
|
|
8804
|
+
);
|
|
8805
|
+
if (!metadataResponse.ok || metadataResponse.data.success !== true) {
|
|
8806
|
+
const detail = metadataResponse.data.detail;
|
|
8807
|
+
const message = typeof detail === "string" ? detail : `HTTP ${metadataResponse.status}`;
|
|
8808
|
+
throw new Error(`Failed to mark chat as shared: ${message}`);
|
|
8809
|
+
}
|
|
8773
8810
|
const blob = await generateChatShareBlob(
|
|
8774
8811
|
resolvedId,
|
|
8775
8812
|
chatKeyBytes,
|
|
@@ -9195,7 +9232,7 @@ Required: ${schema.required.join(", ")}`
|
|
|
9195
9232
|
}
|
|
9196
9233
|
return session;
|
|
9197
9234
|
}
|
|
9198
|
-
makeWsClient(session) {
|
|
9235
|
+
makeWsClient(session, options = {}) {
|
|
9199
9236
|
return new OpenMatesWsClient({
|
|
9200
9237
|
apiUrl: session.apiUrl,
|
|
9201
9238
|
sessionId: randomUUID5(),
|
|
@@ -9204,7 +9241,8 @@ Required: ${schema.required.join(", ")}`
|
|
|
9204
9241
|
// Same User-Agent as login so OS-based device fingerprint hash matches.
|
|
9205
9242
|
userAgent: this.getCliUserAgent(),
|
|
9206
9243
|
// Node.js ws library doesn't auto-send cookies on upgrade requests.
|
|
9207
|
-
cookies: session.cookies
|
|
9244
|
+
cookies: session.cookies,
|
|
9245
|
+
taskUpdateJobs: options.taskUpdateJobs
|
|
9208
9246
|
});
|
|
9209
9247
|
}
|
|
9210
9248
|
/**
|
|
@@ -9212,10 +9250,10 @@ Required: ${schema.required.join(", ")}`
|
|
|
9212
9250
|
* Combines refreshWsToken() + makeWsClient() + ws.open() into one call
|
|
9213
9251
|
* so every WebSocket usage gets a fresh HMAC token automatically.
|
|
9214
9252
|
*/
|
|
9215
|
-
async openWsClient() {
|
|
9253
|
+
async openWsClient(options = {}) {
|
|
9216
9254
|
const ownerId = await this.refreshWsToken();
|
|
9217
9255
|
const session = this.requireSession();
|
|
9218
|
-
const ws = this.makeWsClient(session);
|
|
9256
|
+
const ws = this.makeWsClient(session, options);
|
|
9219
9257
|
await ws.open();
|
|
9220
9258
|
return { ws, session, ownerId };
|
|
9221
9259
|
}
|
|
@@ -35072,6 +35110,49 @@ skill_id: "search"`,
|
|
|
35072
35110
|
}
|
|
35073
35111
|
};
|
|
35074
35112
|
|
|
35113
|
+
// ../ui/src/demo_chats/data/example_chats/example-chat-publishing-workflow.ts
|
|
35114
|
+
var exampleChatPublishingWorkflowChat = {
|
|
35115
|
+
chat_id: "example-example-chat-publishing-workflow",
|
|
35116
|
+
slug: "example-chat-publishing-workflow",
|
|
35117
|
+
title: "example_chats.example_chat_publishing_workflow.title",
|
|
35118
|
+
summary: "example_chats.example_chat_publishing_workflow.summary",
|
|
35119
|
+
icon: "workflow",
|
|
35120
|
+
category: "software_development",
|
|
35121
|
+
keywords: ["workflow automation", "example chats", "publishing checklist", "OpenMates workflows"],
|
|
35122
|
+
follow_up_suggestions: [],
|
|
35123
|
+
messages: [
|
|
35124
|
+
{
|
|
35125
|
+
"id": "5c8fc179-335f-4674-9eac-c889d086df5b",
|
|
35126
|
+
"role": "user",
|
|
35127
|
+
"content": "example_chats.example_chat_publishing_workflow.message_1",
|
|
35128
|
+
"created_at": 1784232219
|
|
35129
|
+
},
|
|
35130
|
+
{
|
|
35131
|
+
"id": "a46d1b5e-7150-582e-94a8-108d05ecc5ad",
|
|
35132
|
+
"role": "assistant",
|
|
35133
|
+
"content": "example_chats.example_chat_publishing_workflow.message_2",
|
|
35134
|
+
"created_at": 1784232234,
|
|
35135
|
+
"user_message_id": "5c8fc179-335f-4674-9eac-c889d086df5b",
|
|
35136
|
+
"category": "software_development",
|
|
35137
|
+
"model_name": "Gemini 3 Flash"
|
|
35138
|
+
}
|
|
35139
|
+
],
|
|
35140
|
+
embeds: [
|
|
35141
|
+
{
|
|
35142
|
+
"embed_id": "53d32845-0b88-47c0-ace0-db90ae95d89b",
|
|
35143
|
+
"type": "app_skill_use",
|
|
35144
|
+
"content": "app_id: workflows\nskill_id: create-or-modify\nresult_count: 0\nembed_ids[0]:\nstatus: finished\nembed_id: 53d32845-0b88-47c0-ace0-db90ae95d89b\ngraph_enabled: false\ngraph_nodes[4]{data_title,type,id}:\n Manual trigger,manual_trigger,trigger1\n verify the real CLI source chats,manual_action,step1\n scaffold the example chat files,manual_action,step2\n run the deployed example-chat Playwright check,manual_action,step3\ngraph_edges[3]{source,id,target}:\n trigger1,e1-2,step1\n step1,e2-3,step2\n step2,e3-4,step3\ntitle: Example chat publishing checklist",
|
|
35145
|
+
"parent_embed_id": null,
|
|
35146
|
+
"embed_ids": []
|
|
35147
|
+
}
|
|
35148
|
+
],
|
|
35149
|
+
metadata: {
|
|
35150
|
+
featured: true,
|
|
35151
|
+
order: 111,
|
|
35152
|
+
app_skill_examples: ["workflows.create-or-modify"]
|
|
35153
|
+
}
|
|
35154
|
+
};
|
|
35155
|
+
|
|
35075
35156
|
// ../ui/src/demo_chats/exampleChatData.ts
|
|
35076
35157
|
var ALL_EXAMPLE_CHATS = [
|
|
35077
35158
|
giganticAirplanesChat,
|
|
@@ -35165,7 +35246,8 @@ var ALL_EXAMPLE_CHATS = [
|
|
|
35165
35246
|
urbanSportsFitnessStudiosBerlinChat,
|
|
35166
35247
|
urbanSportsYogaClassesBerlinChat,
|
|
35167
35248
|
habitGardenWebApplicationChat,
|
|
35168
|
-
printableBenchyPhoneStandModelsChat
|
|
35249
|
+
printableBenchyPhoneStandModelsChat,
|
|
35250
|
+
exampleChatPublishingWorkflowChat
|
|
35169
35251
|
].sort((a, b) => a.metadata.order - b.metadata.order);
|
|
35170
35252
|
|
|
35171
35253
|
// ../ui/src/i18n/locales/en.json
|
|
@@ -37002,7 +37084,7 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
|
|
|
37002
37084
|
}
|
|
37003
37085
|
},
|
|
37004
37086
|
search: {
|
|
37005
|
-
text: "Search
|
|
37087
|
+
text: "Search",
|
|
37006
37088
|
description: {
|
|
37007
37089
|
text: "Find existing 3D models in public model catalogs."
|
|
37008
37090
|
}
|
|
@@ -39904,6 +39986,100 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
|
|
|
39904
39986
|
text: "Set up 2FA"
|
|
39905
39987
|
}
|
|
39906
39988
|
},
|
|
39989
|
+
inactive_account_deletion_reminder: {
|
|
39990
|
+
subject_14d: {
|
|
39991
|
+
text: "Your inactive OpenMates account will be deleted in 14 days"
|
|
39992
|
+
},
|
|
39993
|
+
headline_14d: {
|
|
39994
|
+
text: "Your account is scheduled for deletion"
|
|
39995
|
+
},
|
|
39996
|
+
deletion_time_14d: {
|
|
39997
|
+
text: "in 14 days"
|
|
39998
|
+
},
|
|
39999
|
+
wait_time_14d: {
|
|
40000
|
+
text: "14 days"
|
|
40001
|
+
},
|
|
40002
|
+
reminder_info_14d: {
|
|
40003
|
+
text: "If you take no action, you will be reminded again 7 days before deletion and 1 day before deletion."
|
|
40004
|
+
},
|
|
40005
|
+
subject_7d: {
|
|
40006
|
+
text: "Your inactive OpenMates account will be deleted in 7 days"
|
|
40007
|
+
},
|
|
40008
|
+
headline_7d: {
|
|
40009
|
+
text: "Your account will be deleted soon"
|
|
40010
|
+
},
|
|
40011
|
+
deletion_time_7d: {
|
|
40012
|
+
text: "in 7 days"
|
|
40013
|
+
},
|
|
40014
|
+
wait_time_7d: {
|
|
40015
|
+
text: "7 days"
|
|
40016
|
+
},
|
|
40017
|
+
reminder_info_7d: {
|
|
40018
|
+
text: "If you take no action, you will receive one final reminder 1 day before deletion."
|
|
40019
|
+
},
|
|
40020
|
+
subject_1d: {
|
|
40021
|
+
text: "Your inactive OpenMates account will be deleted tomorrow"
|
|
40022
|
+
},
|
|
40023
|
+
headline_1d: {
|
|
40024
|
+
text: "Final reminder before account deletion"
|
|
40025
|
+
},
|
|
40026
|
+
deletion_time_1d: {
|
|
40027
|
+
text: "tomorrow"
|
|
40028
|
+
},
|
|
40029
|
+
wait_time_1d: {
|
|
40030
|
+
text: "1 day"
|
|
40031
|
+
},
|
|
40032
|
+
greeting: {
|
|
40033
|
+
text: "Hey{greeting_name},"
|
|
40034
|
+
},
|
|
40035
|
+
intro: {
|
|
40036
|
+
text: "We noticed that this OpenMates account has been inactive and currently has no credits, no usage, no active payment state, and no saved chats."
|
|
40037
|
+
},
|
|
40038
|
+
scheduled: {
|
|
40039
|
+
text: "Your inactive account is scheduled for deletion {deletion_time_text}."
|
|
40040
|
+
},
|
|
40041
|
+
keep_account: {
|
|
40042
|
+
text: 'If you want to keep the account, log in to <a href="{finish_setup_link}" style="color: #4867CD; text-decoration: underline;">OpenMates.org</a> and start using it again before then. Adding credits, creating a chat, or using OpenMates will remove the account from this cleanup flow.'
|
|
40043
|
+
},
|
|
40044
|
+
delete_now: {
|
|
40045
|
+
text: 'If you do not want to keep the account, you can delete it now from your account settings: <a href="{direct_delete_account_link}" style="color: #4867CD; text-decoration: underline;">delete account</a>.'
|
|
40046
|
+
},
|
|
40047
|
+
signoff: {
|
|
40048
|
+
text: "Thank you,"
|
|
40049
|
+
},
|
|
40050
|
+
creator_title: {
|
|
40051
|
+
text: "Creator of OpenMates"
|
|
40052
|
+
}
|
|
40053
|
+
},
|
|
40054
|
+
inactive_account_deleted: {
|
|
40055
|
+
subject: {
|
|
40056
|
+
text: "Your inactive OpenMates account has been deleted"
|
|
40057
|
+
},
|
|
40058
|
+
header: {
|
|
40059
|
+
text: "Your OpenMates account was deleted"
|
|
40060
|
+
},
|
|
40061
|
+
greeting: {
|
|
40062
|
+
text: "Hey{greeting_name},"
|
|
40063
|
+
},
|
|
40064
|
+
deleted_notice: {
|
|
40065
|
+
text: "Your inactive OpenMates account has now been deleted because it remained inactive after the staged deletion reminders."
|
|
40066
|
+
},
|
|
40067
|
+
no_action: {
|
|
40068
|
+
text: "No further action is needed."
|
|
40069
|
+
},
|
|
40070
|
+
signup_again: {
|
|
40071
|
+
text: 'If you want to use OpenMates again later, you can create a new account at <a href="{signup_link}" style="color: #4867CD; text-decoration: underline;">OpenMates.org</a>.'
|
|
40072
|
+
},
|
|
40073
|
+
newsletter: {
|
|
40074
|
+
text: "This does not change your newsletter preferences. You can manage them anytime in the newsletter settings."
|
|
40075
|
+
},
|
|
40076
|
+
signoff: {
|
|
40077
|
+
text: "Thank you,"
|
|
40078
|
+
},
|
|
40079
|
+
creator_title: {
|
|
40080
|
+
text: "Creator of OpenMates"
|
|
40081
|
+
}
|
|
40082
|
+
},
|
|
39907
40083
|
incomplete_signup_deletion_reminder: {
|
|
39908
40084
|
subject_14d: {
|
|
39909
40085
|
text: "Complete your OpenMates signup before your account is deleted"
|
|
@@ -42632,6 +42808,20 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
|
|
|
42632
42808
|
text: "[ai] Analyze potential impacts on encryption and privacy"
|
|
42633
42809
|
}
|
|
42634
42810
|
},
|
|
42811
|
+
example_chat_publishing_workflow: {
|
|
42812
|
+
title: {
|
|
42813
|
+
text: "Example chat publishing workflow"
|
|
42814
|
+
},
|
|
42815
|
+
summary: {
|
|
42816
|
+
text: "Create a reusable manual workflow for publishing public OpenMates example chats."
|
|
42817
|
+
},
|
|
42818
|
+
message_1: {
|
|
42819
|
+
text: "@skill:workflows:create-or-modify Create exactly one disabled manual workflow titled Example chat publishing checklist. It should have a manual trigger and three manual steps: verify the real CLI source chats, scaffold the example chat files, and run the deployed example-chat Playwright check. After the workflow tool call, reply with exactly one sentence: Created the workflow. Do not include markdown links, embed links, bullets, next steps, reminders, schedules, or extra embeds."
|
|
42820
|
+
},
|
|
42821
|
+
message_2: {
|
|
42822
|
+
text: '```json\n{"type": "app_skill_use", "embed_id": "53d32845-0b88-47c0-ace0-db90ae95d89b", "app_id": "workflows", "skill_id": "create-or-modify"}\n```\n\nCreated the workflow.'
|
|
42823
|
+
}
|
|
42824
|
+
},
|
|
42635
42825
|
family_stays_kyoto: {
|
|
42636
42826
|
title: {
|
|
42637
42827
|
text: "Family Stays In Kyoto"
|
|
@@ -58915,12 +59105,19 @@ function extractAiAskContent(value) {
|
|
|
58915
59105
|
if (data && typeof data === "object") return extractAiAskContent(data);
|
|
58916
59106
|
return JSON.stringify(value);
|
|
58917
59107
|
}
|
|
59108
|
+
function extractApiKeyChatModelName(value, depth = 0) {
|
|
59109
|
+
if (!value || typeof value !== "object" || depth > 3) return null;
|
|
59110
|
+
const record = value;
|
|
59111
|
+
for (const key of ["model_name", "modelName", "model"]) {
|
|
59112
|
+
const field = record[key];
|
|
59113
|
+
if (typeof field === "string" && field) return field;
|
|
59114
|
+
}
|
|
59115
|
+
return extractApiKeyChatModelName(record.data, depth + 1) ?? extractApiKeyChatModelName(record.raw, depth + 1) ?? null;
|
|
59116
|
+
}
|
|
58918
59117
|
function normalizeApiKeyChatResponse(response) {
|
|
58919
59118
|
const chatId = typeof response.chat_id === "string" ? response.chat_id : null;
|
|
58920
59119
|
const category = typeof response.category === "string" ? response.category : null;
|
|
58921
|
-
const
|
|
58922
|
-
const rawModelName = raw && typeof raw === "object" ? typeof raw.model === "string" ? raw.model : typeof raw.model_name === "string" ? raw.model_name : null : null;
|
|
58923
|
-
const modelName = typeof response.model_name === "string" ? response.model_name : typeof response.modelName === "string" ? response.modelName : rawModelName;
|
|
59120
|
+
const modelName = typeof response.model_name === "string" ? response.model_name : typeof response.modelName === "string" ? response.modelName : extractApiKeyChatModelName(response.raw);
|
|
58924
59121
|
return {
|
|
58925
59122
|
status: "completed",
|
|
58926
59123
|
chatId,
|
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED