@dxos/plugin-daily-summary 0.8.4-main.bcb3aa67d6 → 0.8.4-main.fcfe5033a5
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/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/blueprints/functions/generate.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/containers/DailySummarySettings/DailySummarySettings.d.ts.map +1 -1
- package/dist/types/src/containers/DailySummarySettings/index.d.ts +1 -2
- package/dist/types/src/containers/DailySummarySettings/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -26
- package/src/DailySummaryPlugin.tsx +2 -2
- package/src/blueprints/functions/generate.test.ts +8 -9
- package/src/blueprints/functions/generate.ts +14 -8
- package/src/capabilities/app-graph-builder.ts +2 -2
- package/src/capabilities/react-surface.tsx +3 -4
- package/src/containers/DailySummarySettings/DailySummarySettings.tsx +1 -4
- package/src/containers/DailySummarySettings/index.ts +1 -3
- package/src/translations.test.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-daily-summary",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.fcfe5033a5",
|
|
4
4
|
"description": "Daily activity summary plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -33,27 +33,27 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@effect/ai": "0.33.2",
|
|
35
35
|
"effect": "3.20.0",
|
|
36
|
-
"@dxos/ai": "0.8.4-main.
|
|
37
|
-
"@dxos/app-
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/functions
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/invariant": "0.8.4-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/plugin-
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-
|
|
53
|
-
"@dxos/schema": "0.8.4-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
36
|
+
"@dxos/ai": "0.8.4-main.fcfe5033a5",
|
|
37
|
+
"@dxos/app-toolkit": "0.8.4-main.fcfe5033a5",
|
|
38
|
+
"@dxos/blueprints": "0.8.4-main.fcfe5033a5",
|
|
39
|
+
"@dxos/app-framework": "0.8.4-main.fcfe5033a5",
|
|
40
|
+
"@dxos/assistant": "0.8.4-main.fcfe5033a5",
|
|
41
|
+
"@dxos/client-protocol": "0.8.4-main.fcfe5033a5",
|
|
42
|
+
"@dxos/client": "0.8.4-main.fcfe5033a5",
|
|
43
|
+
"@dxos/echo": "0.8.4-main.fcfe5033a5",
|
|
44
|
+
"@dxos/functions": "0.8.4-main.fcfe5033a5",
|
|
45
|
+
"@dxos/functions-runtime": "0.8.4-main.fcfe5033a5",
|
|
46
|
+
"@dxos/effect": "0.8.4-main.fcfe5033a5",
|
|
47
|
+
"@dxos/invariant": "0.8.4-main.fcfe5033a5",
|
|
48
|
+
"@dxos/keys": "0.8.4-main.fcfe5033a5",
|
|
49
|
+
"@dxos/plugin-graph": "0.8.4-main.fcfe5033a5",
|
|
50
|
+
"@dxos/plugin-space": "0.8.4-main.fcfe5033a5",
|
|
51
|
+
"@dxos/operation": "0.8.4-main.fcfe5033a5",
|
|
52
|
+
"@dxos/react-client": "0.8.4-main.fcfe5033a5",
|
|
53
|
+
"@dxos/schema": "0.8.4-main.fcfe5033a5",
|
|
54
|
+
"@dxos/react-ui-form": "0.8.4-main.fcfe5033a5",
|
|
55
|
+
"@dxos/util": "0.8.4-main.fcfe5033a5",
|
|
56
|
+
"@dxos/types": "0.8.4-main.fcfe5033a5"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@storybook/react-vite": "^10.2.12",
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"react": "~19.2.3",
|
|
63
63
|
"react-dom": "~19.2.3",
|
|
64
64
|
"vite": "^7.1.11",
|
|
65
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
66
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
67
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
65
|
+
"@dxos/echo-db": "0.8.4-main.fcfe5033a5",
|
|
66
|
+
"@dxos/react-ui": "0.8.4-main.fcfe5033a5",
|
|
67
|
+
"@dxos/storybook-utils": "0.8.4-main.fcfe5033a5"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"effect": "3.20.0",
|
|
71
71
|
"react": "~19.2.3",
|
|
72
72
|
"react-dom": "~19.2.3",
|
|
73
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
73
|
+
"@dxos/react-ui": "0.8.4-main.fcfe5033a5"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
7
|
|
|
8
|
+
import { AppGraphBuilder, BlueprintDefinition, ReactSurface } from '#capabilities';
|
|
8
9
|
import { meta } from '#meta';
|
|
9
|
-
import { translations } from './translations';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { translations } from './translations';
|
|
12
12
|
|
|
13
13
|
export const DailySummaryPlugin = Plugin.define(meta).pipe(
|
|
14
14
|
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
@@ -3,21 +3,20 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { describe, expect, it } from '@effect/vitest';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
6
|
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
8
|
|
|
9
9
|
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
10
10
|
import { Blueprint } from '@dxos/blueprints';
|
|
11
11
|
import { SpaceProperties } from '@dxos/client-protocol';
|
|
12
12
|
import { Collection, DXN, Database, Obj, Query, Ref, Type } from '@dxos/echo';
|
|
13
13
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
14
|
-
import { FunctionInvocationService } from '@dxos/functions';
|
|
15
14
|
import { ObjectId } from '@dxos/keys';
|
|
15
|
+
import { Operation } from '@dxos/operation';
|
|
16
16
|
import { Text } from '@dxos/schema';
|
|
17
17
|
import { HasSubject } from '@dxos/types';
|
|
18
18
|
|
|
19
19
|
import { DailySummaryHandlers } from '../daily-summary-blueprint';
|
|
20
|
-
|
|
21
20
|
import { GenerateSummary } from './definitions';
|
|
22
21
|
|
|
23
22
|
ObjectId.dangerouslyDisableRandomness();
|
|
@@ -50,7 +49,7 @@ describe('GenerateSummary', () => {
|
|
|
50
49
|
'creates a Markdown document with summary content',
|
|
51
50
|
Effect.fnUntraced(
|
|
52
51
|
function* (_) {
|
|
53
|
-
const result = yield*
|
|
52
|
+
const result = yield* Operation.invoke(GenerateSummary, {
|
|
54
53
|
lookbackHours: 24,
|
|
55
54
|
});
|
|
56
55
|
|
|
@@ -74,7 +73,7 @@ describe('GenerateSummary', () => {
|
|
|
74
73
|
'creates a "Summaries" collection if none exists',
|
|
75
74
|
Effect.fnUntraced(
|
|
76
75
|
function* (_) {
|
|
77
|
-
yield*
|
|
76
|
+
yield* Operation.invoke(GenerateSummary, {});
|
|
78
77
|
|
|
79
78
|
const collections = yield* Database.runQuery(Query.type(Collection.Collection, { name: 'Summaries' }));
|
|
80
79
|
expect(collections.length).toBe(1);
|
|
@@ -90,8 +89,8 @@ describe('GenerateSummary', () => {
|
|
|
90
89
|
'reuses existing "Summaries" collection on subsequent calls',
|
|
91
90
|
Effect.fnUntraced(
|
|
92
91
|
function* (_) {
|
|
93
|
-
yield*
|
|
94
|
-
yield*
|
|
92
|
+
yield* Operation.invoke(GenerateSummary, {});
|
|
93
|
+
yield* Operation.invoke(GenerateSummary, {});
|
|
95
94
|
|
|
96
95
|
const collections = yield* Database.runQuery(Query.type(Collection.Collection, { name: 'Summaries' }));
|
|
97
96
|
expect(collections.length).toBe(1);
|
|
@@ -108,7 +107,7 @@ describe('GenerateSummary', () => {
|
|
|
108
107
|
Effect.fnUntraced(
|
|
109
108
|
function* (_) {
|
|
110
109
|
const previousSummary = 'Yesterday was productive. 10 objects edited.';
|
|
111
|
-
const result = yield*
|
|
110
|
+
const result = yield* Operation.invoke(GenerateSummary, {
|
|
112
111
|
previousSummary,
|
|
113
112
|
lookbackHours: 24,
|
|
114
113
|
});
|
|
@@ -128,7 +127,7 @@ describe('GenerateSummary', () => {
|
|
|
128
127
|
'names document with today date',
|
|
129
128
|
Effect.fnUntraced(
|
|
130
129
|
function* (_) {
|
|
131
|
-
const result = yield*
|
|
130
|
+
const result = yield* Operation.invoke(GenerateSummary, {});
|
|
132
131
|
const today = new Date().toISOString().slice(0, 10);
|
|
133
132
|
expect(result.date).toBe(today);
|
|
134
133
|
|
|
@@ -10,8 +10,8 @@ import * as Schema from 'effect/Schema';
|
|
|
10
10
|
|
|
11
11
|
import { AiService, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
12
12
|
import { Collection, Database, Filter, Obj, Query, Ref, Type } from '@dxos/echo';
|
|
13
|
-
import {
|
|
14
|
-
import { Operation } from '@dxos/operation';
|
|
13
|
+
import { Trace } from '@dxos/functions';
|
|
14
|
+
import { Operation, OperationRegistry } from '@dxos/operation';
|
|
15
15
|
import { Text } from '@dxos/schema';
|
|
16
16
|
import { CollectionModel } from '@dxos/schema';
|
|
17
17
|
import { trim } from '@dxos/util';
|
|
@@ -109,8 +109,14 @@ export default GenerateSummary.pipe(
|
|
|
109
109
|
AiService.model('@anthropic/claude-haiku-4-5'),
|
|
110
110
|
ToolResolverService.layerEmpty,
|
|
111
111
|
ToolExecutionService.layerEmpty,
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
Database.notAvailable,
|
|
113
|
+
Layer.succeed(Operation.Service, {
|
|
114
|
+
invoke: () => Effect.die('Not available.'),
|
|
115
|
+
schedule: () => Effect.die('Not available.'),
|
|
116
|
+
invokePromise: async () => ({ error: new Error('Not available.') }),
|
|
117
|
+
} as any),
|
|
118
|
+
Layer.succeed(OperationRegistry.Service, { resolve: () => Effect.succeed(undefined) } as any),
|
|
119
|
+
Trace.writerLayerNoop,
|
|
114
120
|
),
|
|
115
121
|
),
|
|
116
122
|
),
|
|
@@ -158,14 +164,14 @@ const updateDocContent = Effect.fn(function* (doc: MarkdownDoc, newContent: stri
|
|
|
158
164
|
if (Ref.isRef(textRef)) {
|
|
159
165
|
const text: Text.Text | undefined = yield* Effect.promise(() => textRef.load());
|
|
160
166
|
if (text) {
|
|
161
|
-
Obj.change(text, (
|
|
162
|
-
|
|
167
|
+
Obj.change(text, (text) => {
|
|
168
|
+
text.content = newContent;
|
|
163
169
|
});
|
|
164
170
|
return;
|
|
165
171
|
}
|
|
166
172
|
}
|
|
167
|
-
Obj.change(doc, (
|
|
168
|
-
|
|
173
|
+
Obj.change(doc, (doc) => {
|
|
174
|
+
doc.content = Ref.make(Text.make(newContent));
|
|
169
175
|
});
|
|
170
176
|
});
|
|
171
177
|
|
|
@@ -15,12 +15,12 @@ export default Capability.makeModule(
|
|
|
15
15
|
Effect.fnUntraced(function* () {
|
|
16
16
|
const extensions = yield* Effect.all([
|
|
17
17
|
GraphBuilder.createExtension({
|
|
18
|
-
id:
|
|
18
|
+
id: 'space-settings-daily-summary',
|
|
19
19
|
match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),
|
|
20
20
|
connector: (node) =>
|
|
21
21
|
Effect.succeed([
|
|
22
22
|
AppNode.makeSettingsPanel({
|
|
23
|
-
id:
|
|
23
|
+
id: 'daily-summary',
|
|
24
24
|
type: `${meta.id}.space-settings-daily-summary`,
|
|
25
25
|
label: ['plugin.name', { ns: meta.id }],
|
|
26
26
|
icon: 'ph--calendar-check--regular',
|
|
@@ -7,7 +7,7 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
-
import { useActiveSpace } from '@dxos/app-toolkit/ui';
|
|
10
|
+
import { AppSurface, useActiveSpace } from '@dxos/app-toolkit/ui';
|
|
11
11
|
|
|
12
12
|
import { DailySummarySettings } from '#containers';
|
|
13
13
|
import { meta } from '#meta';
|
|
@@ -16,9 +16,8 @@ export default Capability.makeModule(() =>
|
|
|
16
16
|
Effect.succeed(
|
|
17
17
|
Capability.contributes(Capabilities.ReactSurface, [
|
|
18
18
|
Surface.create({
|
|
19
|
-
id:
|
|
20
|
-
|
|
21
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}.space-settings-daily-summary`,
|
|
19
|
+
id: 'space-settings-daily-summary',
|
|
20
|
+
filter: AppSurface.literal(AppSurface.Article, `${meta.id}.space-settings-daily-summary`),
|
|
22
21
|
component: () => {
|
|
23
22
|
const space = useActiveSpace();
|
|
24
23
|
if (!space) {
|
|
@@ -43,10 +43,7 @@ export const DailySummarySettings = ({ space }: DailySummarySettingsProps) => {
|
|
|
43
43
|
}
|
|
44
44
|
const trigger = Trigger.make({
|
|
45
45
|
enabled: true,
|
|
46
|
-
spec:
|
|
47
|
-
kind: 'timer',
|
|
48
|
-
cron: '0 21 * * *',
|
|
49
|
-
},
|
|
46
|
+
spec: Trigger.specTimer('0 21 * * *'),
|
|
50
47
|
function: Ref.make(Operation.serialize(GenerateSummary)),
|
|
51
48
|
});
|
|
52
49
|
space.db.add(trigger);
|