@dxos/plugin-daily-summary 0.8.4-main.bcb3aa67d6 → 0.8.4-main.fcc0d83b33
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 +3 -19
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +18 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/types/src/DailySummaryPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/daily-summary-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/daily-summary-blueprint.d.ts.map +1 -1
- package/dist/types/src/blueprints/functions/definitions.d.ts +2 -2
- package/dist/types/src/blueprints/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/blueprints/functions/generate.d.ts +2 -2
- package/dist/types/src/blueprints/functions/generate.d.ts.map +1 -1
- package/dist/types/src/blueprints/functions/index.d.ts +1 -1
- package/dist/types/src/blueprints/functions/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -2
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.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 +2 -5
- 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/src/translations.d.ts +5 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -29
- package/src/DailySummaryPlugin.tsx +2 -3
- package/src/blueprints/daily-summary-blueprint.ts +2 -3
- package/src/blueprints/functions/definitions.ts +1 -1
- package/src/blueprints/functions/generate.test.ts +10 -11
- package/src/blueprints/functions/generate.ts +14 -8
- package/src/blueprints/functions/index.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +6 -7
- package/src/capabilities/react-surface.tsx +3 -4
- package/src/containers/DailySummarySettings/DailySummarySettings.tsx +10 -14
- package/src/containers/DailySummarySettings/index.ts +1 -3
- package/src/translations.test.ts +1 -1
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.fcc0d83b33",
|
|
4
4
|
"description": "Daily activity summary plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -16,13 +16,20 @@
|
|
|
16
16
|
"#blueprints": "./src/blueprints/index.ts",
|
|
17
17
|
"#capabilities": "./src/capabilities/index.ts",
|
|
18
18
|
"#containers": "./src/containers/index.ts",
|
|
19
|
-
"#meta": "./src/meta.ts"
|
|
19
|
+
"#meta": "./src/meta.ts",
|
|
20
|
+
"#translations": "./src/translations.ts"
|
|
20
21
|
},
|
|
21
22
|
"exports": {
|
|
22
23
|
".": {
|
|
23
24
|
"source": "./src/index.ts",
|
|
24
25
|
"types": "./dist/types/src/index.d.ts",
|
|
25
26
|
"browser": "./dist/lib/browser/index.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./translations": {
|
|
29
|
+
"source": "./src/translations.ts",
|
|
30
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
31
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
32
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
26
33
|
}
|
|
27
34
|
},
|
|
28
35
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -33,44 +40,42 @@
|
|
|
33
40
|
"dependencies": {
|
|
34
41
|
"@effect/ai": "0.33.2",
|
|
35
42
|
"effect": "3.20.0",
|
|
36
|
-
"@dxos/ai": "0.8.4-main.
|
|
37
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/client": "0.8.4-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/effect": "0.8.4-main.
|
|
46
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/types": "0.8.4-main.bcb3aa67d6",
|
|
55
|
-
"@dxos/keys": "0.8.4-main.bcb3aa67d6",
|
|
56
|
-
"@dxos/util": "0.8.4-main.bcb3aa67d6"
|
|
43
|
+
"@dxos/ai": "0.8.4-main.fcc0d83b33",
|
|
44
|
+
"@dxos/app-framework": "0.8.4-main.fcc0d83b33",
|
|
45
|
+
"@dxos/assistant": "0.8.4-main.fcc0d83b33",
|
|
46
|
+
"@dxos/app-toolkit": "0.8.4-main.fcc0d83b33",
|
|
47
|
+
"@dxos/client-protocol": "0.8.4-main.fcc0d83b33",
|
|
48
|
+
"@dxos/client": "0.8.4-main.fcc0d83b33",
|
|
49
|
+
"@dxos/echo": "0.8.4-main.fcc0d83b33",
|
|
50
|
+
"@dxos/compute": "0.8.4-main.fcc0d83b33",
|
|
51
|
+
"@dxos/invariant": "0.8.4-main.fcc0d83b33",
|
|
52
|
+
"@dxos/effect": "0.8.4-main.fcc0d83b33",
|
|
53
|
+
"@dxos/plugin-graph": "0.8.4-main.fcc0d83b33",
|
|
54
|
+
"@dxos/plugin-space": "0.8.4-main.fcc0d83b33",
|
|
55
|
+
"@dxos/react-ui-form": "0.8.4-main.fcc0d83b33",
|
|
56
|
+
"@dxos/react-client": "0.8.4-main.fcc0d83b33",
|
|
57
|
+
"@dxos/util": "0.8.4-main.fcc0d83b33",
|
|
58
|
+
"@dxos/types": "0.8.4-main.fcc0d83b33",
|
|
59
|
+
"@dxos/schema": "0.8.4-main.fcc0d83b33",
|
|
60
|
+
"@dxos/keys": "0.8.4-main.fcc0d83b33"
|
|
57
61
|
},
|
|
58
62
|
"devDependencies": {
|
|
59
|
-
"@storybook/react-vite": "^10.
|
|
63
|
+
"@storybook/react-vite": "^10.3.6",
|
|
60
64
|
"@types/react": "~19.2.7",
|
|
61
65
|
"@types/react-dom": "~19.2.3",
|
|
62
66
|
"react": "~19.2.3",
|
|
63
67
|
"react-dom": "~19.2.3",
|
|
64
|
-
"vite": "^
|
|
65
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
+
"vite": "^8.0.10",
|
|
69
|
+
"@dxos/echo-db": "0.8.4-main.fcc0d83b33",
|
|
70
|
+
"@dxos/functions-runtime": "0.8.4-main.fcc0d83b33",
|
|
71
|
+
"@dxos/react-ui": "0.8.4-main.fcc0d83b33",
|
|
72
|
+
"@dxos/storybook-utils": "0.8.4-main.fcc0d83b33"
|
|
68
73
|
},
|
|
69
74
|
"peerDependencies": {
|
|
70
75
|
"effect": "3.20.0",
|
|
71
76
|
"react": "~19.2.3",
|
|
72
77
|
"react-dom": "~19.2.3",
|
|
73
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
78
|
+
"@dxos/react-ui": "0.8.4-main.fcc0d83b33"
|
|
74
79
|
},
|
|
75
80
|
"publishConfig": {
|
|
76
81
|
"access": "public"
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
7
|
|
|
8
|
-
import { meta } from '#meta';
|
|
9
|
-
import { translations } from './translations';
|
|
10
|
-
|
|
11
8
|
import { AppGraphBuilder, BlueprintDefinition, ReactSurface } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
12
11
|
|
|
13
12
|
export const DailySummaryPlugin = Plugin.define(meta).pipe(
|
|
14
13
|
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { Blueprint, Template } from '@dxos/blueprints';
|
|
5
|
+
import { Blueprint, Template } from '@dxos/compute';
|
|
7
6
|
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
8
|
import { DailySummaryHandlers, GenerateSummary } from './functions';
|
|
@@ -29,7 +28,7 @@ const make = () =>
|
|
|
29
28
|
}),
|
|
30
29
|
});
|
|
31
30
|
|
|
32
|
-
const blueprint:
|
|
31
|
+
const blueprint: Blueprint.Definition = {
|
|
33
32
|
key: BLUEPRINT_KEY,
|
|
34
33
|
make,
|
|
35
34
|
};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { AiService } from '@dxos/ai';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
8
9
|
import { Database } from '@dxos/echo';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Generates a daily summary of recently modified objects using AI.
|
|
@@ -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
|
-
import { AssistantTestLayer } from '@dxos/assistant/testing';
|
|
10
|
-
import { Blueprint } from '@dxos/blueprints';
|
|
11
9
|
import { SpaceProperties } from '@dxos/client-protocol';
|
|
10
|
+
import { Blueprint } from '@dxos/compute';
|
|
11
|
+
import { Operation } from '@dxos/compute';
|
|
12
12
|
import { Collection, DXN, Database, Obj, Query, Ref, Type } from '@dxos/echo';
|
|
13
13
|
import { TestHelpers } from '@dxos/effect/testing';
|
|
14
|
-
import {
|
|
14
|
+
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
15
15
|
import { ObjectId } from '@dxos/keys';
|
|
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
|
|
|
@@ -9,9 +9,9 @@ import * as Layer from 'effect/Layer';
|
|
|
9
9
|
import * as Schema from 'effect/Schema';
|
|
10
10
|
|
|
11
11
|
import { AiService, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
12
|
+
import { Trace } from '@dxos/compute';
|
|
13
|
+
import { Operation, OperationRegistry } from '@dxos/compute';
|
|
12
14
|
import { Collection, Database, Filter, Obj, Query, Ref, Type } from '@dxos/echo';
|
|
13
|
-
import { FunctionInvocationService, TracingService } from '@dxos/functions';
|
|
14
|
-
import { Operation } 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.
|
|
162
|
-
|
|
167
|
+
Obj.update(text, (text) => {
|
|
168
|
+
text.content = newContent;
|
|
163
169
|
});
|
|
164
170
|
return;
|
|
165
171
|
}
|
|
166
172
|
}
|
|
167
|
-
Obj.
|
|
168
|
-
|
|
173
|
+
Obj.update(doc, (doc) => {
|
|
174
|
+
doc.content = Ref.make(Text.make(newContent));
|
|
169
175
|
});
|
|
170
176
|
});
|
|
171
177
|
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
|
|
9
|
-
import { GraphBuilder
|
|
10
|
-
import { meta as spaceMeta } from '@dxos/plugin-space/meta';
|
|
8
|
+
import { AppCapabilities, AppNode, AppNodeMatcher } from '@dxos/app-toolkit';
|
|
9
|
+
import { GraphBuilder } from '@dxos/plugin-graph';
|
|
11
10
|
|
|
12
11
|
import { meta } from '#meta';
|
|
13
12
|
|
|
@@ -15,12 +14,12 @@ export default Capability.makeModule(
|
|
|
15
14
|
Effect.fnUntraced(function* () {
|
|
16
15
|
const extensions = yield* Effect.all([
|
|
17
16
|
GraphBuilder.createExtension({
|
|
18
|
-
id:
|
|
19
|
-
match:
|
|
20
|
-
connector: (
|
|
17
|
+
id: 'space-settings-daily-summary',
|
|
18
|
+
match: AppNodeMatcher.whenSpace,
|
|
19
|
+
connector: () =>
|
|
21
20
|
Effect.succeed([
|
|
22
21
|
AppNode.makeSettingsPanel({
|
|
23
|
-
id:
|
|
22
|
+
id: 'daily-summary',
|
|
24
23
|
type: `${meta.id}.space-settings-daily-summary`,
|
|
25
24
|
label: ['plugin.name', { ns: meta.id }],
|
|
26
25
|
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) {
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { Trigger } from '@dxos/compute';
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
10
|
+
import { Filter, Query, Ref } from '@dxos/echo';
|
|
11
11
|
import { useQuery } from '@dxos/react-client/echo';
|
|
12
12
|
import { IconButton, useTranslation } from '@dxos/react-ui';
|
|
13
13
|
import { Settings } from '@dxos/react-ui-form';
|
|
@@ -15,14 +15,13 @@ import { Settings } from '@dxos/react-ui-form';
|
|
|
15
15
|
import { GenerateSummary } from '#blueprints';
|
|
16
16
|
import { meta } from '#meta';
|
|
17
17
|
|
|
18
|
-
export
|
|
19
|
-
space: Space;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const DailySummarySettings = ({ space }: DailySummarySettingsProps) => {
|
|
18
|
+
export const DailySummarySettings = ({ space }: AppSurface.SpaceArticleProps) => {
|
|
23
19
|
const { t } = useTranslation(meta.id);
|
|
24
20
|
|
|
25
|
-
const triggers = useQuery(
|
|
21
|
+
const triggers = useQuery(
|
|
22
|
+
space.db,
|
|
23
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-daily-summary.DailySummarySettings'),
|
|
24
|
+
);
|
|
26
25
|
const existingTrigger = useMemo(
|
|
27
26
|
() =>
|
|
28
27
|
triggers.find((trigger) => {
|
|
@@ -43,10 +42,7 @@ export const DailySummarySettings = ({ space }: DailySummarySettingsProps) => {
|
|
|
43
42
|
}
|
|
44
43
|
const trigger = Trigger.make({
|
|
45
44
|
enabled: true,
|
|
46
|
-
spec:
|
|
47
|
-
kind: 'timer',
|
|
48
|
-
cron: '0 21 * * *',
|
|
49
|
-
},
|
|
45
|
+
spec: Trigger.specTimer('0 21 * * *'),
|
|
50
46
|
function: Ref.make(Operation.serialize(GenerateSummary)),
|
|
51
47
|
});
|
|
52
48
|
space.db.add(trigger);
|
package/src/translations.test.ts
CHANGED