@questionbase/deskfree 0.3.0-alpha.21 → 0.3.0-alpha.22
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/README.md +24 -3
- package/dist/index.d.ts +66 -28
- package/dist/index.js +466 -401
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/deskfree/SKILL.md +225 -103
- package/skills/deskfree/references/tools.md +43 -40
package/README.md
CHANGED
|
@@ -126,12 +126,33 @@ bot ──[start_task]──> bot (is_working) ──[complete_task(done)]──
|
|
|
126
126
|
[approve] → done
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
See
|
|
129
|
+
See `skills/deskfree/references/tools.md` for the full tool reference.
|
|
130
|
+
|
|
131
|
+
### Message Flow
|
|
132
|
+
|
|
133
|
+
**Inbound (human → agent):** WebSocket sends thin notification (`hint: "message.new"`) → plugin fetches full message via HTTP. Fallback: polls every 30s if WebSocket is unavailable.
|
|
134
|
+
|
|
135
|
+
**Outbound (agent → human):** Messages chunked at 2000 chars → `POST messages.send` per chunk.
|
|
136
|
+
|
|
137
|
+
### WebSocket Gateway
|
|
138
|
+
|
|
139
|
+
1. Request ticket: `POST messages.wsTicket` → one-time ticket (30s expiry)
|
|
140
|
+
2. Connect: `wss://...?ticket=<ticket>`
|
|
141
|
+
3. Keep alive: ping every 5 min (API Gateway idle timeout = 10 min)
|
|
142
|
+
4. Reconnect: exponential backoff (2s → 30s) on disconnect
|
|
143
|
+
5. Cursor persisted to `deskfree/{accountId}/cursor` for resume after restart
|
|
144
|
+
|
|
145
|
+
### Plugin Registration
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
register(api)
|
|
149
|
+
├─ setDeskFreeRuntime(api.runtime) // runtime singleton
|
|
150
|
+
├─ api.registerChannel(deskFreePlugin) // messaging channel
|
|
151
|
+
└─ api.registerTool(factory) // task management tools
|
|
152
|
+
```
|
|
130
153
|
|
|
131
154
|
## Documentation
|
|
132
155
|
|
|
133
|
-
- **[Architecture](docs/architecture.md)** — system design, message flow, WebSocket gateway
|
|
134
|
-
- **[Tools reference](docs/tools.md)** — all 8 agent tools with parameters and behavior
|
|
135
156
|
- **[Publishing](PUBLISH.md)** — how to release new versions
|
|
136
157
|
|
|
137
158
|
## License
|
package/dist/index.d.ts
CHANGED
|
@@ -426,8 +426,19 @@ interface Task {
|
|
|
426
426
|
botId?: string | null;
|
|
427
427
|
createdById: string;
|
|
428
428
|
reason?: string | null;
|
|
429
|
-
|
|
430
|
-
|
|
429
|
+
fileId?: string | null;
|
|
430
|
+
fileName?: string | null;
|
|
431
|
+
}
|
|
432
|
+
interface TaskSummary {
|
|
433
|
+
taskId: string;
|
|
434
|
+
title: string;
|
|
435
|
+
status: 'bot' | 'human' | 'done';
|
|
436
|
+
instructions: string | null;
|
|
437
|
+
isWorking: boolean;
|
|
438
|
+
fileId: string | null;
|
|
439
|
+
fileName: string | null;
|
|
440
|
+
createdAt: string;
|
|
441
|
+
updatedAt: string;
|
|
431
442
|
}
|
|
432
443
|
interface TaskMessage {
|
|
433
444
|
messageId: string;
|
|
@@ -437,14 +448,23 @@ interface TaskMessage {
|
|
|
437
448
|
createdAt: string;
|
|
438
449
|
userName?: string | null;
|
|
439
450
|
}
|
|
451
|
+
interface FileContext {
|
|
452
|
+
fileId: string;
|
|
453
|
+
name: string;
|
|
454
|
+
description: string;
|
|
455
|
+
content: string;
|
|
456
|
+
contentFormat: string;
|
|
457
|
+
version: number;
|
|
458
|
+
}
|
|
440
459
|
interface TaskWithContext extends Task {
|
|
441
460
|
instructions: string;
|
|
442
|
-
deliverable: string;
|
|
443
461
|
messages: TaskMessage[];
|
|
462
|
+
fileContext: FileContext | null;
|
|
444
463
|
}
|
|
445
464
|
interface CompleteTaskInput {
|
|
446
465
|
taskId: string;
|
|
447
466
|
outcome: 'done' | 'blocked';
|
|
467
|
+
summary?: string;
|
|
448
468
|
}
|
|
449
469
|
interface WorkspaceStateTask {
|
|
450
470
|
taskId: string;
|
|
@@ -452,7 +472,8 @@ interface WorkspaceStateTask {
|
|
|
452
472
|
status: 'bot' | 'human' | 'done';
|
|
453
473
|
isWorking?: boolean;
|
|
454
474
|
instructions?: string | null;
|
|
455
|
-
|
|
475
|
+
fileId?: string | null;
|
|
476
|
+
fileName?: string | null;
|
|
456
477
|
createdAt: string;
|
|
457
478
|
updatedAt: string;
|
|
458
479
|
}
|
|
@@ -465,6 +486,14 @@ interface Initiative {
|
|
|
465
486
|
taskCount: number;
|
|
466
487
|
activeTaskCount: number;
|
|
467
488
|
}
|
|
489
|
+
interface WorkspaceFile {
|
|
490
|
+
fileId: string;
|
|
491
|
+
name: string;
|
|
492
|
+
description: string;
|
|
493
|
+
contentFormat: string;
|
|
494
|
+
version: number;
|
|
495
|
+
updatedAt: string;
|
|
496
|
+
}
|
|
468
497
|
interface WorkspaceState {
|
|
469
498
|
tasks: WorkspaceStateTask[];
|
|
470
499
|
recentlyDone: WorkspaceStateTask[];
|
|
@@ -476,6 +505,7 @@ interface WorkspaceState {
|
|
|
476
505
|
initiativeId?: string | null;
|
|
477
506
|
}>;
|
|
478
507
|
initiatives: Initiative[];
|
|
508
|
+
files: WorkspaceFile[];
|
|
479
509
|
}
|
|
480
510
|
interface EvaluationTaskMessage {
|
|
481
511
|
messageId: string;
|
|
@@ -537,13 +567,13 @@ declare class DeskFreeClient {
|
|
|
537
567
|
content: string;
|
|
538
568
|
}>;
|
|
539
569
|
/**
|
|
540
|
-
* Send a text message
|
|
570
|
+
* Send a text message to a DeskFree conversation.
|
|
541
571
|
*
|
|
542
|
-
* @param input - Message content, optional userId, taskId, attachments
|
|
572
|
+
* @param input - Message content, optional userId, taskId, attachments
|
|
543
573
|
*/
|
|
544
574
|
sendMessage(input: {
|
|
545
575
|
userId?: string;
|
|
546
|
-
content
|
|
576
|
+
content: string;
|
|
547
577
|
taskId?: string;
|
|
548
578
|
attachments?: Array<{
|
|
549
579
|
s3Key: string;
|
|
@@ -551,10 +581,6 @@ declare class DeskFreeClient {
|
|
|
551
581
|
contentType: string;
|
|
552
582
|
size: number;
|
|
553
583
|
}>;
|
|
554
|
-
suggestions?: Array<{
|
|
555
|
-
title: string;
|
|
556
|
-
instructions?: string;
|
|
557
|
-
}>;
|
|
558
584
|
}): Promise<{
|
|
559
585
|
messageId: string;
|
|
560
586
|
content: string;
|
|
@@ -571,12 +597,35 @@ declare class DeskFreeClient {
|
|
|
571
597
|
claimTask(input: {
|
|
572
598
|
taskId: string;
|
|
573
599
|
}): Promise<TaskWithContext>;
|
|
574
|
-
/**
|
|
575
|
-
|
|
600
|
+
/** Fetch a lightweight task summary by ID. Read-only, no side effects. */
|
|
601
|
+
getTask(input: {
|
|
576
602
|
taskId: string;
|
|
577
|
-
|
|
578
|
-
|
|
603
|
+
}): Promise<TaskSummary>;
|
|
604
|
+
/** Update the content of an existing file. */
|
|
605
|
+
updateFile(input: {
|
|
606
|
+
fileId: string;
|
|
607
|
+
content: string;
|
|
608
|
+
contentFormat?: 'markdown' | 'html';
|
|
579
609
|
}): Promise<void>;
|
|
610
|
+
/** Create a new persistent file. */
|
|
611
|
+
createFile(input: {
|
|
612
|
+
name: string;
|
|
613
|
+
description?: string;
|
|
614
|
+
content?: string;
|
|
615
|
+
contentFormat?: 'markdown' | 'html';
|
|
616
|
+
}): Promise<{
|
|
617
|
+
fileId: string;
|
|
618
|
+
name: string;
|
|
619
|
+
}>;
|
|
620
|
+
/** List all files for this bot (metadata only, no content). */
|
|
621
|
+
listFiles(): Promise<Array<{
|
|
622
|
+
fileId: string;
|
|
623
|
+
name: string;
|
|
624
|
+
description: string;
|
|
625
|
+
contentFormat: string;
|
|
626
|
+
version: number;
|
|
627
|
+
updatedAt: string;
|
|
628
|
+
}>>;
|
|
580
629
|
/** Send an agent status update to DeskFree. */
|
|
581
630
|
statusUpdate(input: {
|
|
582
631
|
status: 'idle' | 'working' | 'responding';
|
|
@@ -623,25 +672,14 @@ declare class DeskFreeClient {
|
|
|
623
672
|
completeTask(input: CompleteTaskInput): Promise<Task & {
|
|
624
673
|
outcome: 'done' | 'blocked';
|
|
625
674
|
}>;
|
|
626
|
-
/** Suggest new tasks for the human to review and approve (via messages.send with suggestions). */
|
|
627
|
-
suggestTasks(input: {
|
|
628
|
-
tasks: Array<{
|
|
629
|
-
title: string;
|
|
630
|
-
instructions?: string;
|
|
631
|
-
}>;
|
|
632
|
-
taskId?: string;
|
|
633
|
-
}): Promise<{
|
|
634
|
-
messageId: string;
|
|
635
|
-
content: string;
|
|
636
|
-
}>;
|
|
637
675
|
/** Suggest tasks via the dedicated bot/tasks.suggest endpoint. */
|
|
638
676
|
suggestTasksDedicated(input: {
|
|
639
677
|
suggestions: Array<{
|
|
640
678
|
title: string;
|
|
641
679
|
instructions?: string;
|
|
642
680
|
estimatedTokens?: number;
|
|
643
|
-
dependsOn?: string[];
|
|
644
681
|
initiativeId?: string;
|
|
682
|
+
scheduledFor?: string;
|
|
645
683
|
}>;
|
|
646
684
|
parentTaskId?: string;
|
|
647
685
|
initiativeSuggestions?: Array<{
|
|
@@ -747,4 +785,4 @@ declare const plugin: {
|
|
|
747
785
|
register(api: OpenClawPluginApi): void;
|
|
748
786
|
};
|
|
749
787
|
|
|
750
|
-
export { type AnyAgentTool, type ChannelAccountSnapshot, type ChannelCapabilities, type ChannelConfigAdapter, type ChannelGatewayAdapter, type ChannelGatewayContext, type ChannelLogoutContext, type ChannelLogoutResult, type ChannelMessagingAdapter, type ChannelMessagingTargetResolver, type ChannelMeta, type ChannelOnboardingAdapter, type ChannelOnboardingResult, type ChannelOnboardingStatus, type ChannelOutboundAdapter, type ChannelOutboundContext, type ChannelPlugin, type ChannelProbeResult, type ChannelSecurityAdapter, type ChannelSecurityDmPolicy, type ChannelSetupAdapter, type ChannelStatusAdapter, type ChannelStatusIssue, type ChatMessage, type ChatMessageAttachment, type ClaimEvaluationResponse, type CompleteTaskInput, type DeskFreeChannelConfig, DeskFreeClient, DeskFreeError, type EvaluationTaskMessage, type FinalizedMsgContext, type Initiative, type MessagesResponse, OfflineQueue, type OpenClawConfig, type OpenClawPluginApi, type OpenClawPluginToolContext, type OpenClawPluginToolFactory, type OpenClawPluginToolOptions, type OutboundDeliveryResult, type PluginHookAgentContext, type PluginHookBeforeAgentStartEvent, type PluginHookBeforeAgentStartResult, type PluginHookHandlerMap, type PluginHookName, type PluginLogger, type PluginRuntime, type ReplyDispatcher, type ResolvedDeskFreeAccount, type Task, type TaskMessage, type TaskWithContext, type WizardPrompter, type WorkspaceState, type WorkspaceStateTask, type WsNotification, type WsTicketResponse, plugin as default, reportError };
|
|
788
|
+
export { type AnyAgentTool, type ChannelAccountSnapshot, type ChannelCapabilities, type ChannelConfigAdapter, type ChannelGatewayAdapter, type ChannelGatewayContext, type ChannelLogoutContext, type ChannelLogoutResult, type ChannelMessagingAdapter, type ChannelMessagingTargetResolver, type ChannelMeta, type ChannelOnboardingAdapter, type ChannelOnboardingResult, type ChannelOnboardingStatus, type ChannelOutboundAdapter, type ChannelOutboundContext, type ChannelPlugin, type ChannelProbeResult, type ChannelSecurityAdapter, type ChannelSecurityDmPolicy, type ChannelSetupAdapter, type ChannelStatusAdapter, type ChannelStatusIssue, type ChatMessage, type ChatMessageAttachment, type ClaimEvaluationResponse, type CompleteTaskInput, type DeskFreeChannelConfig, DeskFreeClient, DeskFreeError, type EvaluationTaskMessage, type FileContext, type FinalizedMsgContext, type Initiative, type MessagesResponse, OfflineQueue, type OpenClawConfig, type OpenClawPluginApi, type OpenClawPluginToolContext, type OpenClawPluginToolFactory, type OpenClawPluginToolOptions, type OutboundDeliveryResult, type PluginHookAgentContext, type PluginHookBeforeAgentStartEvent, type PluginHookBeforeAgentStartResult, type PluginHookHandlerMap, type PluginHookName, type PluginLogger, type PluginRuntime, type ReplyDispatcher, type ResolvedDeskFreeAccount, type Task, type TaskMessage, type TaskSummary, type TaskWithContext, type WizardPrompter, type WorkspaceFile, type WorkspaceState, type WorkspaceStateTask, type WsNotification, type WsTicketResponse, plugin as default, reportError };
|