jowork 0.2.4 → 0.3.0

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 (38) hide show
  1. package/dist/{chunk-ROIINI33.js → chunk-4PIT2GZ4.js} +13 -1
  2. package/dist/{chunk-XLYRHKG6.js → chunk-54SD5GBF.js} +1 -1
  3. package/dist/chunk-63AMINQC.js +156 -0
  4. package/dist/{chunk-XAEGXSEO.js → chunk-74AHY7X6.js} +4 -0
  5. package/dist/{chunk-7U3SXINY.js → chunk-ATAUWJYD.js} +320 -50
  6. package/dist/chunk-DQW74UCN.js +671 -0
  7. package/dist/chunk-EYP6WMFF.js +153 -0
  8. package/dist/{chunk-JSTXMDXI.js → chunk-FCFZCZHR.js} +1 -1
  9. package/dist/chunk-FX6Z3QHV.js +34 -0
  10. package/dist/chunk-HENAABEL.js +419 -0
  11. package/dist/chunk-OXWWOKC7.js +201 -0
  12. package/dist/chunk-QGHJ45PL.js +661 -0
  13. package/dist/chunk-RO3KK5RC.js +132 -0
  14. package/dist/{chunk-JE6TOU7W.js → chunk-TFMF3EXE.js} +2 -7
  15. package/dist/{chunk-TN327MDF.js → chunk-VX662YLA.js} +3 -3
  16. package/dist/cli.js +338 -149
  17. package/dist/{config-AI6UIJJN.js → config-FH2XLN7A.js} +2 -2
  18. package/dist/content-reader-VPGTR2SF.js +10 -0
  19. package/dist/context-ZNI3WOB7.js +10 -0
  20. package/dist/{credential-store-ZRZCSRPC.js → credential-store-OS5ZY4OW.js} +2 -2
  21. package/dist/{feishu-A6YVFKEN.js → feishu-XW5T6ER2.js} +8 -3
  22. package/dist/{git-manager-N35XSG4Y.js → git-manager-RVWV2GSV.js} +2 -1
  23. package/dist/github-PQKAYTLO.js +11 -0
  24. package/dist/{paths-JXOMBYIT.js → paths-FFRET6F7.js} +7 -3
  25. package/dist/{server-5GVWN2NB.js → server-WEADPUST.js} +59 -66
  26. package/dist/{setup-IDQDPCEJ.js → setup-S2S2CHB2.js} +91 -32
  27. package/dist/sync-SRLFR5NA.js +21 -0
  28. package/dist/transport.js +6 -4
  29. package/package.json +1 -1
  30. package/src/dashboard/public/app.js +34 -8
  31. package/src/dashboard/public/style.css +14 -0
  32. package/dist/chunk-AIXKXEYS.js +0 -547
  33. package/dist/chunk-L5ZR7TSK.js +0 -82
  34. package/dist/chunk-LS2AJM5A.js +0 -163
  35. package/dist/chunk-QMOFQX7X.js +0 -612
  36. package/dist/chunk-YJWTKFWX.js +0 -451
  37. package/dist/github-SHWUFNYB.js +0 -10
  38. package/dist/sync-7V54N62M.js +0 -18
@@ -0,0 +1,132 @@
1
+ // src/sync/formatters.ts
2
+ function formatMessages(chatName, chatId, date, messages) {
3
+ const frontmatter = `---
4
+ source: feishu
5
+ type: messages
6
+ chat: ${chatName}
7
+ chat_id: ${chatId}
8
+ date: ${date}
9
+ ---
10
+
11
+ `;
12
+ const body = messages.map((m) => `## ${m.time} \u2014 ${m.sender}
13
+ ${m.content}`).join("\n\n");
14
+ return frontmatter + body + "\n";
15
+ }
16
+ function formatIssue(opts) {
17
+ return [
18
+ "---",
19
+ `source: ${opts.source}`,
20
+ `type: issue`,
21
+ `repo: ${opts.repo}`,
22
+ `number: ${opts.number}`,
23
+ `state: ${opts.state}`,
24
+ `author: ${opts.author}`,
25
+ `labels: [${opts.labels.join(", ")}]`,
26
+ `created: ${opts.created}`,
27
+ `uri: ${opts.uri}`,
28
+ "---",
29
+ "",
30
+ `# ${opts.repo}#${opts.number}: ${opts.title}`,
31
+ "",
32
+ opts.body || "(no description)",
33
+ ""
34
+ ].join("\n");
35
+ }
36
+ function formatPullRequest(opts) {
37
+ const branchLine = opts.sourceBranch && opts.targetBranch ? `branch: ${opts.sourceBranch} -> ${opts.targetBranch}
38
+ ` : "";
39
+ return [
40
+ "---",
41
+ `source: ${opts.source}`,
42
+ `type: pull_request`,
43
+ `repo: ${opts.repo}`,
44
+ `number: ${opts.number}`,
45
+ `state: ${opts.state}`,
46
+ `author: ${opts.author}`,
47
+ `labels: [${opts.labels.join(", ")}]`,
48
+ `created: ${opts.created}`,
49
+ `uri: ${opts.uri}`,
50
+ branchLine ? `${branchLine.trim()}` : null,
51
+ "---",
52
+ "",
53
+ `# ${opts.repo}#${opts.number}: ${opts.title}`,
54
+ "",
55
+ opts.body || "(no description)",
56
+ ""
57
+ ].filter((line) => line !== null).join("\n");
58
+ }
59
+ function formatCalendarEvent(opts) {
60
+ return [
61
+ "---",
62
+ `source: ${opts.source}`,
63
+ `type: calendar_event`,
64
+ `title: ${opts.title}`,
65
+ `start: ${opts.startTime}`,
66
+ `end: ${opts.endTime}`,
67
+ `attendees: [${opts.attendees.join(", ")}]`,
68
+ `uri: ${opts.uri}`,
69
+ "---",
70
+ "",
71
+ `# ${opts.title}`,
72
+ "",
73
+ `**Time:** ${opts.startTime} \u2014 ${opts.endTime}`,
74
+ `**Attendees:** ${opts.attendees.join(", ") || "none"}`,
75
+ "",
76
+ opts.description || "(no description)",
77
+ ""
78
+ ].join("\n");
79
+ }
80
+ function formatApproval(opts) {
81
+ const fieldRows = opts.fields.map((f) => `| ${f.name} | ${f.value} |`).join("\n");
82
+ const table = opts.fields.length > 0 ? `| Field | Value |
83
+ |-------|-------|
84
+ ${fieldRows}
85
+ ` : "";
86
+ return [
87
+ "---",
88
+ `source: ${opts.source}`,
89
+ `type: approval`,
90
+ `name: ${opts.name}`,
91
+ `status: ${opts.status}`,
92
+ `submitter: ${opts.submitter}`,
93
+ `uri: ${opts.uri}`,
94
+ "---",
95
+ "",
96
+ `# ${opts.name}`,
97
+ "",
98
+ `**Status:** ${opts.status}`,
99
+ `**Submitter:** ${opts.submitter}`,
100
+ "",
101
+ table,
102
+ ""
103
+ ].join("\n");
104
+ }
105
+ function formatDocument(opts) {
106
+ return [
107
+ "---",
108
+ `source: ${opts.source}`,
109
+ `type: document`,
110
+ `title: ${opts.title}`,
111
+ `uri: ${opts.uri}`,
112
+ "---",
113
+ "",
114
+ `# ${opts.title}`,
115
+ "",
116
+ opts.body || "(no content)",
117
+ ""
118
+ ].join("\n");
119
+ }
120
+ function formatAnalytics(data) {
121
+ return JSON.stringify(data, null, 2) + "\n";
122
+ }
123
+
124
+ export {
125
+ formatMessages,
126
+ formatIssue,
127
+ formatPullRequest,
128
+ formatCalendarEvent,
129
+ formatApproval,
130
+ formatDocument,
131
+ formatAnalytics
132
+ };
@@ -131,15 +131,11 @@ var objects = sqliteTable("objects", {
131
131
  tags: text("tags"),
132
132
  docMap: text("doc_map"),
133
133
  contentHash: text("content_hash"),
134
+ filePath: text("file_path"),
135
+ linksProcessed: integer("links_processed").default(0),
134
136
  lastSyncedAt: integer("last_synced_at"),
135
137
  createdAt: integer("created_at")
136
138
  });
137
- var objectBodies = sqliteTable("object_bodies", {
138
- objectId: text("object_id").primaryKey().references(() => objects.id),
139
- content: text("content").notNull(),
140
- contentType: text("content_type"),
141
- fetchedAt: integer("fetched_at")
142
- });
143
139
  var syncCursors = sqliteTable("sync_cursors", {
144
140
  connectorId: text("connector_id").primaryKey(),
145
141
  cursor: text("cursor"),
@@ -3891,7 +3887,6 @@ i18n.init({
3891
3887
  export {
3892
3888
  connectorConfigs,
3893
3889
  objects,
3894
- objectBodies,
3895
3890
  memories,
3896
3891
  createId,
3897
3892
  buildFtsQuery,
@@ -1,9 +1,9 @@
1
- import {
2
- createId
3
- } from "./chunk-JE6TOU7W.js";
4
1
  import {
5
2
  logInfo
6
3
  } from "./chunk-MYDK7MWB.js";
4
+ import {
5
+ createId
6
+ } from "./chunk-TFMF3EXE.js";
7
7
 
8
8
  // src/goals/manager.ts
9
9
  var GoalManager = class {