hanseol-dev 5.0.0-dev.9 → 5.0.1-dev.1
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/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +1 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/office/complete-tool.d.ts +3 -0
- package/dist/agents/office/complete-tool.d.ts.map +1 -0
- package/dist/agents/office/complete-tool.js +18 -0
- package/dist/agents/office/complete-tool.js.map +1 -0
- package/dist/agents/office/excel-agent.d.ts +3 -0
- package/dist/agents/office/excel-agent.d.ts.map +1 -0
- package/dist/agents/office/excel-agent.js +31 -0
- package/dist/agents/office/excel-agent.js.map +1 -0
- package/dist/agents/office/index.d.ts +7 -0
- package/dist/agents/office/index.d.ts.map +1 -0
- package/dist/agents/office/index.js +7 -0
- package/dist/agents/office/index.js.map +1 -0
- package/dist/agents/office/office-sub-agent.d.ts +21 -0
- package/dist/agents/office/office-sub-agent.d.ts.map +1 -0
- package/dist/agents/office/office-sub-agent.js +127 -0
- package/dist/agents/office/office-sub-agent.js.map +1 -0
- package/dist/agents/office/powerpoint-agent.d.ts +3 -0
- package/dist/agents/office/powerpoint-agent.d.ts.map +1 -0
- package/dist/agents/office/powerpoint-agent.js +31 -0
- package/dist/agents/office/powerpoint-agent.js.map +1 -0
- package/dist/agents/office/prompts.d.ts +4 -0
- package/dist/agents/office/prompts.d.ts.map +1 -0
- package/dist/agents/office/prompts.js +67 -0
- package/dist/agents/office/prompts.js.map +1 -0
- package/dist/agents/office/word-agent.d.ts +3 -0
- package/dist/agents/office/word-agent.d.ts.map +1 -0
- package/dist/agents/office/word-agent.js +31 -0
- package/dist/agents/office/word-agent.js.map +1 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/core/background-sync.d.ts +3 -3
- package/dist/core/background-sync.d.ts.map +1 -1
- package/dist/core/background-sync.js +44 -41
- package/dist/core/background-sync.js.map +1 -1
- package/dist/core/llm/llm-client.d.ts.map +1 -1
- package/dist/core/llm/llm-client.js +10 -2
- package/dist/core/llm/llm-client.js.map +1 -1
- package/dist/orchestration/plan-executor.d.ts.map +1 -1
- package/dist/orchestration/plan-executor.js +2 -0
- package/dist/orchestration/plan-executor.js.map +1 -1
- package/dist/prompts/shared/tool-usage.d.ts.map +1 -1
- package/dist/prompts/shared/tool-usage.js +0 -1
- package/dist/prompts/shared/tool-usage.js.map +1 -1
- package/dist/tools/llm/simple/external-services/external-service-api-clients.d.ts +41 -30
- package/dist/tools/llm/simple/external-services/external-service-api-clients.d.ts.map +1 -1
- package/dist/tools/llm/simple/external-services/external-service-api-clients.js +74 -66
- package/dist/tools/llm/simple/external-services/external-service-api-clients.js.map +1 -1
- package/dist/tools/llm/simple/external-services/index.d.ts +1 -1
- package/dist/tools/llm/simple/external-services/index.d.ts.map +1 -1
- package/dist/tools/llm/simple/external-services/index.js +1 -1
- package/dist/tools/llm/simple/external-services/index.js.map +1 -1
- package/dist/tools/llm/simple/external-services/once-tools.d.ts.map +1 -1
- package/dist/tools/llm/simple/external-services/once-tools.js +1 -53
- package/dist/tools/llm/simple/external-services/once-tools.js.map +1 -1
- package/dist/tools/llm/simple/file-tools.d.ts +1 -1
- package/dist/tools/llm/simple/file-tools.d.ts.map +1 -1
- package/dist/tools/llm/simple/file-tools.js +1 -1
- package/dist/tools/llm/simple/file-tools.js.map +1 -1
- package/dist/tools/llm/simple/simple-tool-executor.d.ts +2 -0
- package/dist/tools/llm/simple/simple-tool-executor.d.ts.map +1 -1
- package/dist/tools/llm/simple/simple-tool-executor.js +25 -1
- package/dist/tools/llm/simple/simple-tool-executor.js.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +8 -23
- package/dist/tools/registry.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +6 -2
- package/dist/utils/logger.js.map +1 -1
- package/package.json +1 -1
package/dist/agents/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { BaseAgent, type AgentContext, type AgentResult, type AgentConfig, } from './base/base-agent.js';
|
|
2
2
|
export { PlanningLLM, } from './planner/index.js';
|
|
3
|
+
export { OfficeSubAgent, createWordWorkRequestTool, createExcelWorkRequestTool, createPowerPointWorkRequestTool, } from './office/index.js';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,WAAW,GACZ,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,mBAAmB,CAAC"}
|
package/dist/agents/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { BaseAgent, } from './base/base-agent.js';
|
|
2
2
|
export { PlanningLLM, } from './planner/index.js';
|
|
3
|
+
export { OfficeSubAgent, createWordWorkRequestTool, createExcelWorkRequestTool, createPowerPointWorkRequestTool, } from './office/index.js';
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
package/dist/agents/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,SAAS,GAIV,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,WAAW,GACZ,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,SAAS,GAIV,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete-tool.d.ts","sourceRoot":"","sources":["../../../src/agents/office/complete-tool.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,eAAO,MAAM,wBAAwB,EAAE,cAiBtC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const COMPLETE_TOOL_DEFINITION = {
|
|
2
|
+
type: 'function',
|
|
3
|
+
function: {
|
|
4
|
+
name: 'complete',
|
|
5
|
+
description: '작업이 완료되었을 때 호출합니다. 수행한 작업의 요약을 반환합니다. 모든 작업을 마친 후 반드시 이 도구를 호출하세요.',
|
|
6
|
+
parameters: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
summary: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
description: '수행한 작업의 요약 (어떤 파일/문서에 무엇을 했는지)',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
required: ['summary'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=complete-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete-tool.js","sourceRoot":"","sources":["../../../src/agents/office/complete-tool.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,wBAAwB,GAAmB;IACtD,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,WAAW,EACT,oEAAoE;QACtE,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,gCAAgC;iBAC9C;aACF;YACD,QAAQ,EAAE,CAAC,SAAS,CAAC;SACtB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/office/excel-agent.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKpD,wBAAgB,0BAA0B,IAAI,YAAY,CA2BzD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EXCEL_TOOLS } from '../../tools/office/excel-tools.js';
|
|
2
|
+
import { OfficeSubAgent } from './office-sub-agent.js';
|
|
3
|
+
import { EXCEL_SYSTEM_PROMPT } from './prompts.js';
|
|
4
|
+
export function createExcelWorkRequestTool() {
|
|
5
|
+
return {
|
|
6
|
+
definition: {
|
|
7
|
+
type: 'function',
|
|
8
|
+
function: {
|
|
9
|
+
name: 'excel_work_request',
|
|
10
|
+
description: 'Microsoft Excel 전문 에이전트에게 작업을 요청합니다. 통합문서 생성/편집, 셀/범위 읽기/쓰기, 수식, 차트, 조건부 서식, 데이터 검증, 필터/정렬, PDF 내보내기 등 모든 Excel 작업을 수행할 수 있습니다. 자연어로 원하는 작업을 지시하세요.',
|
|
11
|
+
parameters: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
instruction: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: '수행할 Excel 작업에 대한 자연어 지시',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ['instruction'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
execute: async (args, llmClient) => {
|
|
24
|
+
const agent = new OfficeSubAgent(llmClient, 'excel', EXCEL_TOOLS, EXCEL_SYSTEM_PROMPT);
|
|
25
|
+
return agent.run(args['instruction']);
|
|
26
|
+
},
|
|
27
|
+
categories: ['llm-agent'],
|
|
28
|
+
requiresSubLLM: true,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=excel-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-agent.js","sourceRoot":"","sources":["../../../src/agents/office/excel-agent.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL,UAAU,EAAE;YACV,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACR,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EACT,qJAAqJ;gBACvJ,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,yBAAyB;yBACvC;qBACF;oBACD,QAAQ,EAAE,CAAC,aAAa,CAAC;iBAC1B;aACF;SACF;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;YACjC,MAAM,KAAK,GAAG,IAAI,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC;YACvF,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAW,CAAC,CAAC;QAClD,CAAC;QACD,UAAU,EAAE,CAAC,WAAW,CAAC;QACzB,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { OfficeSubAgent, type OfficeSubAgentConfig } from './office-sub-agent.js';
|
|
2
|
+
export { COMPLETE_TOOL_DEFINITION } from './complete-tool.js';
|
|
3
|
+
export { WORD_SYSTEM_PROMPT, EXCEL_SYSTEM_PROMPT, POWERPOINT_SYSTEM_PROMPT, } from './prompts.js';
|
|
4
|
+
export { createWordWorkRequestTool } from './word-agent.js';
|
|
5
|
+
export { createExcelWorkRequestTool } from './excel-agent.js';
|
|
6
|
+
export { createPowerPointWorkRequestTool } from './powerpoint-agent.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/office/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { OfficeSubAgent } from './office-sub-agent.js';
|
|
2
|
+
export { COMPLETE_TOOL_DEFINITION } from './complete-tool.js';
|
|
3
|
+
export { WORD_SYSTEM_PROMPT, EXCEL_SYSTEM_PROMPT, POWERPOINT_SYSTEM_PROMPT, } from './prompts.js';
|
|
4
|
+
export { createWordWorkRequestTool } from './word-agent.js';
|
|
5
|
+
export { createExcelWorkRequestTool } from './excel-agent.js';
|
|
6
|
+
export { createPowerPointWorkRequestTool } from './powerpoint-agent.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/office/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAA6B,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LLMClient } from '../../core/llm/llm-client.js';
|
|
2
|
+
import { LLMSimpleTool, ToolResult } from '../../tools/types.js';
|
|
3
|
+
export interface OfficeSubAgentConfig {
|
|
4
|
+
maxIterations?: number;
|
|
5
|
+
temperature?: number;
|
|
6
|
+
maxTokens?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class OfficeSubAgent {
|
|
9
|
+
private llmClient;
|
|
10
|
+
private appName;
|
|
11
|
+
private tools;
|
|
12
|
+
private toolMap;
|
|
13
|
+
private systemPrompt;
|
|
14
|
+
private maxIterations;
|
|
15
|
+
private temperature;
|
|
16
|
+
private maxTokens;
|
|
17
|
+
constructor(llmClient: LLMClient, appName: string, tools: LLMSimpleTool[], systemPrompt: string, config?: OfficeSubAgentConfig);
|
|
18
|
+
run(instruction: string): Promise<ToolResult>;
|
|
19
|
+
private buildResult;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=office-sub-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"office-sub-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/office/office-sub-agent.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIjE,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;gBAGxB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,aAAa,EAAE,EACtB,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,oBAAoB;IAqBzB,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAyHnD,OAAO,CAAC,WAAW;CAiBpB"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { COMPLETE_TOOL_DEFINITION } from './complete-tool.js';
|
|
2
|
+
import { logger } from '../../utils/logger.js';
|
|
3
|
+
export class OfficeSubAgent {
|
|
4
|
+
llmClient;
|
|
5
|
+
appName;
|
|
6
|
+
tools;
|
|
7
|
+
toolMap;
|
|
8
|
+
systemPrompt;
|
|
9
|
+
maxIterations;
|
|
10
|
+
temperature;
|
|
11
|
+
maxTokens;
|
|
12
|
+
constructor(llmClient, appName, tools, systemPrompt, config) {
|
|
13
|
+
this.llmClient = llmClient;
|
|
14
|
+
this.appName = appName;
|
|
15
|
+
this.tools = tools;
|
|
16
|
+
this.systemPrompt = systemPrompt;
|
|
17
|
+
this.maxIterations = config?.maxIterations ?? 15;
|
|
18
|
+
this.temperature = config?.temperature ?? 0.3;
|
|
19
|
+
this.maxTokens = config?.maxTokens ?? 4000;
|
|
20
|
+
this.toolMap = new Map();
|
|
21
|
+
for (const tool of tools) {
|
|
22
|
+
this.toolMap.set(tool.definition.function.name, tool);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async run(instruction) {
|
|
26
|
+
const startTime = Date.now();
|
|
27
|
+
let iterations = 0;
|
|
28
|
+
let totalToolCalls = 0;
|
|
29
|
+
logger.enter(`OfficeSubAgent[${this.appName}].run`);
|
|
30
|
+
logger.info(`Sub-agent starting`, {
|
|
31
|
+
appName: this.appName,
|
|
32
|
+
toolCount: this.tools.length,
|
|
33
|
+
instruction: instruction.slice(0, 100),
|
|
34
|
+
});
|
|
35
|
+
const toolDefinitions = [
|
|
36
|
+
...this.tools.map((t) => t.definition),
|
|
37
|
+
COMPLETE_TOOL_DEFINITION,
|
|
38
|
+
];
|
|
39
|
+
const messages = [
|
|
40
|
+
{ role: 'system', content: this.systemPrompt },
|
|
41
|
+
{ role: 'user', content: instruction },
|
|
42
|
+
];
|
|
43
|
+
while (iterations < this.maxIterations) {
|
|
44
|
+
iterations++;
|
|
45
|
+
logger.flow(`OfficeSubAgent[${this.appName}] iteration ${iterations}`);
|
|
46
|
+
const response = await this.llmClient.chatCompletion({
|
|
47
|
+
messages,
|
|
48
|
+
tools: toolDefinitions,
|
|
49
|
+
temperature: this.temperature,
|
|
50
|
+
max_tokens: this.maxTokens,
|
|
51
|
+
});
|
|
52
|
+
const assistantMessage = response.choices[0]?.message;
|
|
53
|
+
if (!assistantMessage) {
|
|
54
|
+
return this.buildResult(false, undefined, 'No response from Sub-LLM', iterations, totalToolCalls, startTime);
|
|
55
|
+
}
|
|
56
|
+
messages.push(assistantMessage);
|
|
57
|
+
if (!assistantMessage.tool_calls || assistantMessage.tool_calls.length === 0) {
|
|
58
|
+
const content = assistantMessage.content || '';
|
|
59
|
+
logger.flow(`OfficeSubAgent[${this.appName}] completed with text response`);
|
|
60
|
+
return this.buildResult(true, content, undefined, iterations, totalToolCalls, startTime);
|
|
61
|
+
}
|
|
62
|
+
for (const toolCall of assistantMessage.tool_calls) {
|
|
63
|
+
const toolName = toolCall.function.name;
|
|
64
|
+
let args;
|
|
65
|
+
try {
|
|
66
|
+
args = JSON.parse(toolCall.function.arguments);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
messages.push({
|
|
70
|
+
role: 'tool',
|
|
71
|
+
content: 'Error: Invalid JSON in tool arguments.',
|
|
72
|
+
tool_call_id: toolCall.id,
|
|
73
|
+
});
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (toolName === 'complete') {
|
|
77
|
+
const summary = args['summary'] || 'Task completed.';
|
|
78
|
+
logger.flow(`OfficeSubAgent[${this.appName}] completed via complete tool`);
|
|
79
|
+
return this.buildResult(true, summary, undefined, iterations, totalToolCalls, startTime);
|
|
80
|
+
}
|
|
81
|
+
const tool = this.toolMap.get(toolName);
|
|
82
|
+
if (!tool) {
|
|
83
|
+
messages.push({
|
|
84
|
+
role: 'tool',
|
|
85
|
+
content: `Error: Unknown tool "${toolName}". Use only the provided tools.`,
|
|
86
|
+
tool_call_id: toolCall.id,
|
|
87
|
+
});
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
totalToolCalls++;
|
|
91
|
+
logger.info(`OfficeSubAgent[${this.appName}] executing tool`, { toolName, iteration: iterations });
|
|
92
|
+
try {
|
|
93
|
+
const result = await tool.execute(args);
|
|
94
|
+
const resultText = result.success
|
|
95
|
+
? result.result || '(success, no output)'
|
|
96
|
+
: `Error: ${result.error || 'Unknown error'}`;
|
|
97
|
+
messages.push({
|
|
98
|
+
role: 'tool',
|
|
99
|
+
content: resultText,
|
|
100
|
+
tool_call_id: toolCall.id,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
105
|
+
messages.push({
|
|
106
|
+
role: 'tool',
|
|
107
|
+
content: `Error executing ${toolName}: ${errorMsg}`,
|
|
108
|
+
tool_call_id: toolCall.id,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
logger.warn(`OfficeSubAgent[${this.appName}] max iterations reached`, { maxIterations: this.maxIterations });
|
|
114
|
+
return this.buildResult(true, `Sub-agent completed after ${this.maxIterations} iterations. ${totalToolCalls} tool calls executed.`, undefined, iterations, totalToolCalls, startTime);
|
|
115
|
+
}
|
|
116
|
+
buildResult(success, result, error, iterations, toolCalls, startTime) {
|
|
117
|
+
const duration = Date.now() - startTime;
|
|
118
|
+
logger.exit(`OfficeSubAgent[${this.appName}].run`, { success, iterations, toolCalls, duration });
|
|
119
|
+
return {
|
|
120
|
+
success,
|
|
121
|
+
result,
|
|
122
|
+
error,
|
|
123
|
+
metadata: { iterations, toolCalls, duration },
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=office-sub-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"office-sub-agent.js","sourceRoot":"","sources":["../../../src/agents/office/office-sub-agent.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAQ/C,MAAM,OAAO,cAAc;IACjB,SAAS,CAAY;IACrB,OAAO,CAAS;IAChB,KAAK,CAAkB;IACvB,OAAO,CAA6B;IACpC,YAAY,CAAS;IACrB,aAAa,CAAS;IACtB,WAAW,CAAS;IACpB,SAAS,CAAS;IAE1B,YACE,SAAoB,EACpB,OAAe,EACf,KAAsB,EACtB,YAAoB,EACpB,MAA6B;QAE7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,I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MAAM;YACN,KAAK;YACL,QAAQ,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE;SAC9C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powerpoint-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/office/powerpoint-agent.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKpD,wBAAgB,+BAA+B,IAAI,YAAY,CAgC9D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { POWERPOINT_TOOLS } from '../../tools/office/powerpoint-tools.js';
|
|
2
|
+
import { OfficeSubAgent } from './office-sub-agent.js';
|
|
3
|
+
import { POWERPOINT_SYSTEM_PROMPT } from './prompts.js';
|
|
4
|
+
export function createPowerPointWorkRequestTool() {
|
|
5
|
+
return {
|
|
6
|
+
definition: {
|
|
7
|
+
type: 'function',
|
|
8
|
+
function: {
|
|
9
|
+
name: 'powerpoint_work_request',
|
|
10
|
+
description: 'Microsoft PowerPoint 전문 에이전트에게 작업을 요청합니다. 프레젠테이션 생성/편집, 슬라이드 관리, 텍스트/이미지/도형/표/차트 삽입, 애니메이션, 전환효과, PDF 내보내기 등 모든 PowerPoint 작업을 수행할 수 있습니다. 자연어로 원하는 작업을 지시하세요.',
|
|
11
|
+
parameters: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
instruction: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: '수행할 PowerPoint 작업에 대한 자연어 지시',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ['instruction'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
execute: async (args, llmClient) => {
|
|
24
|
+
const agent = new OfficeSubAgent(llmClient, 'powerpoint', POWERPOINT_TOOLS, POWERPOINT_SYSTEM_PROMPT);
|
|
25
|
+
return agent.run(args['instruction']);
|
|
26
|
+
},
|
|
27
|
+
categories: ['llm-agent'],
|
|
28
|
+
requiresSubLLM: true,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=powerpoint-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powerpoint-agent.js","sourceRoot":"","sources":["../../../src/agents/office/powerpoint-agent.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,UAAU,EAAE;YACV,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACR,IAAI,EAAE,yBAAyB;gBAC/B,WAAW,EACT,gKAAgK;gBAClK,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,8BAA8B;yBAC5C;qBACF;oBACD,QAAQ,EAAE,CAAC,aAAa,CAAC;iBAC1B;aACF;SACF;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;YACjC,MAAM,KAAK,GAAG,IAAI,cAAc,CAC9B,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,CACzB,CAAC;YACF,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAW,CAAC,CAAC;QAClD,CAAC;QACD,UAAU,EAAE,CAAC,WAAW,CAAC;QACzB,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const WORD_SYSTEM_PROMPT = "You are an Office automation agent.\nExecute the user's instruction using the available tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a summary of what was done.\nCall only one tool at a time. After each tool result, decide the next step.\nIf a tool fails, try an alternative approach or report the error via \"complete\".\nAlways respond in the same language as the user's instruction.\n\nYou are a Microsoft Word specialist.\nAvailable tool categories:\n- Document lifecycle: create, open, close, save, quit\n- Text: write, read, find/replace, selected text\n- Formatting: font, paragraph, style, columns\n- Tables: add, set cell, merge cells, style, border\n- Content: image, hyperlink, textbox, shape, break\n- Lists: bullet, numbered\n- Headers/Footers: header, footer, page number\n- Page Setup: margins, orientation, size\n- Bookmarks: add, get, delete, goto\n- Comments: add, get, delete\n- Watermarks: add, remove\n- Navigation: select all, goto\n- Track Changes & TOC & Footnotes\n- Export: PDF, print\n- Undo/Redo";
|
|
2
|
+
export declare const EXCEL_SYSTEM_PROMPT = "You are an Office automation agent.\nExecute the user's instruction using the available tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a summary of what was done.\nCall only one tool at a time. After each tool result, decide the next step.\nIf a tool fails, try an alternative approach or report the error via \"complete\".\nAlways respond in the same language as the user's instruction.\n\nYou are a Microsoft Excel specialist.\nAvailable tool categories:\n- Workbook lifecycle: create, open, close, save, quit\n- Cell/Range: write cell, read cell, write range, read range, copy, paste, clear\n- Formulas: set formula\n- Formatting: font, fill, number format, border, alignment, merge/unmerge, column width, row height\n- Sheet management: add, delete, rename, get sheets, select sheet\n- Data: sort, insert/delete row, freeze panes, auto filter, find/replace\n- Charts: add chart, set title, delete\n- Conditional formatting: add, clear\n- Data validation: set, clear\n- Named ranges: create, get, delete\n- Hide/Show: columns, rows\n- Images & Hyperlinks\n- Comments: add, get, delete\n- Protection: protect/unprotect sheet\n- Grouping: group/ungroup rows\n- Export: PDF, print";
|
|
3
|
+
export declare const POWERPOINT_SYSTEM_PROMPT = "You are an Office automation agent.\nExecute the user's instruction using the available tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a summary of what was done.\nCall only one tool at a time. After each tool result, decide the next step.\nIf a tool fails, try an alternative approach or report the error via \"complete\".\nAlways respond in the same language as the user's instruction.\n\nYou are a Microsoft PowerPoint specialist.\nAvailable tool categories:\n- Presentation lifecycle: create, open, close, save, quit\n- Slides: add, delete, move, duplicate, hide/show, layout, sections\n- Text: write text, add textbox, set placeholder text, get placeholders\n- Shapes: add, delete, duplicate, rotate, position, size, style, name, opacity, get info/list\n- Tables: add, set cell, set style\n- Images & Media: image, video, audio, chart, hyperlink\n- Z-Order: bring to front/forward, send to back/backward\n- Alignment: align shapes, distribute shapes\n- Text formatting: font, text alignment, bullet list, line spacing, textbox border/fill\n- Notes: add, get\n- Grouping: group/ungroup shapes\n- Effects: shadow, reflection, theme\n- Background: set background\n- Animation & Transition\n- Slide layouts: get layouts\n- Export: PDF, slideshow\n- Screenshot, slide count";
|
|
4
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/agents/office/prompts.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,kBAAkB,miCAkBnB,CAAC;AAEb,eAAO,MAAM,mBAAmB,8rCAmBX,CAAC;AAEtB,eAAO,MAAM,wBAAwB,2xCAoBX,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const OFFICE_BASE_PROMPT = `You are an Office automation agent.
|
|
2
|
+
Execute the user's instruction using the available tools.
|
|
3
|
+
When the task is complete, you MUST call the "complete" tool with a summary of what was done.
|
|
4
|
+
Call only one tool at a time. After each tool result, decide the next step.
|
|
5
|
+
If a tool fails, try an alternative approach or report the error via "complete".
|
|
6
|
+
Always respond in the same language as the user's instruction.`;
|
|
7
|
+
export const WORD_SYSTEM_PROMPT = `${OFFICE_BASE_PROMPT}
|
|
8
|
+
|
|
9
|
+
You are a Microsoft Word specialist.
|
|
10
|
+
Available tool categories:
|
|
11
|
+
- Document lifecycle: create, open, close, save, quit
|
|
12
|
+
- Text: write, read, find/replace, selected text
|
|
13
|
+
- Formatting: font, paragraph, style, columns
|
|
14
|
+
- Tables: add, set cell, merge cells, style, border
|
|
15
|
+
- Content: image, hyperlink, textbox, shape, break
|
|
16
|
+
- Lists: bullet, numbered
|
|
17
|
+
- Headers/Footers: header, footer, page number
|
|
18
|
+
- Page Setup: margins, orientation, size
|
|
19
|
+
- Bookmarks: add, get, delete, goto
|
|
20
|
+
- Comments: add, get, delete
|
|
21
|
+
- Watermarks: add, remove
|
|
22
|
+
- Navigation: select all, goto
|
|
23
|
+
- Track Changes & TOC & Footnotes
|
|
24
|
+
- Export: PDF, print
|
|
25
|
+
- Undo/Redo`;
|
|
26
|
+
export const EXCEL_SYSTEM_PROMPT = `${OFFICE_BASE_PROMPT}
|
|
27
|
+
|
|
28
|
+
You are a Microsoft Excel specialist.
|
|
29
|
+
Available tool categories:
|
|
30
|
+
- Workbook lifecycle: create, open, close, save, quit
|
|
31
|
+
- Cell/Range: write cell, read cell, write range, read range, copy, paste, clear
|
|
32
|
+
- Formulas: set formula
|
|
33
|
+
- Formatting: font, fill, number format, border, alignment, merge/unmerge, column width, row height
|
|
34
|
+
- Sheet management: add, delete, rename, get sheets, select sheet
|
|
35
|
+
- Data: sort, insert/delete row, freeze panes, auto filter, find/replace
|
|
36
|
+
- Charts: add chart, set title, delete
|
|
37
|
+
- Conditional formatting: add, clear
|
|
38
|
+
- Data validation: set, clear
|
|
39
|
+
- Named ranges: create, get, delete
|
|
40
|
+
- Hide/Show: columns, rows
|
|
41
|
+
- Images & Hyperlinks
|
|
42
|
+
- Comments: add, get, delete
|
|
43
|
+
- Protection: protect/unprotect sheet
|
|
44
|
+
- Grouping: group/ungroup rows
|
|
45
|
+
- Export: PDF, print`;
|
|
46
|
+
export const POWERPOINT_SYSTEM_PROMPT = `${OFFICE_BASE_PROMPT}
|
|
47
|
+
|
|
48
|
+
You are a Microsoft PowerPoint specialist.
|
|
49
|
+
Available tool categories:
|
|
50
|
+
- Presentation lifecycle: create, open, close, save, quit
|
|
51
|
+
- Slides: add, delete, move, duplicate, hide/show, layout, sections
|
|
52
|
+
- Text: write text, add textbox, set placeholder text, get placeholders
|
|
53
|
+
- Shapes: add, delete, duplicate, rotate, position, size, style, name, opacity, get info/list
|
|
54
|
+
- Tables: add, set cell, set style
|
|
55
|
+
- Images & Media: image, video, audio, chart, hyperlink
|
|
56
|
+
- Z-Order: bring to front/forward, send to back/backward
|
|
57
|
+
- Alignment: align shapes, distribute shapes
|
|
58
|
+
- Text formatting: font, text alignment, bullet list, line spacing, textbox border/fill
|
|
59
|
+
- Notes: add, get
|
|
60
|
+
- Grouping: group/ungroup shapes
|
|
61
|
+
- Effects: shadow, reflection, theme
|
|
62
|
+
- Background: set background
|
|
63
|
+
- Animation & Transition
|
|
64
|
+
- Slide layouts: get layouts
|
|
65
|
+
- Export: PDF, slideshow
|
|
66
|
+
- Screenshot, slide count`;
|
|
67
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/agents/office/prompts.ts"],"names":[],"mappings":"AAOA,MAAM,kBAAkB,GAAG;;;;;+DAKoC,CAAC;AAEhE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,kBAAkB;;;;;;;;;;;;;;;;;;YAkB3C,CAAC;AAEb,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,kBAAkB;;;;;;;;;;;;;;;;;;;qBAmBnC,CAAC;AAEtB,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,kBAAkB;;;;;;;;;;;;;;;;;;;;0BAoBnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"word-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/office/word-agent.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKpD,wBAAgB,yBAAyB,IAAI,YAAY,CA2BxD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { WORD_TOOLS } from '../../tools/office/word-tools.js';
|
|
2
|
+
import { OfficeSubAgent } from './office-sub-agent.js';
|
|
3
|
+
import { WORD_SYSTEM_PROMPT } from './prompts.js';
|
|
4
|
+
export function createWordWorkRequestTool() {
|
|
5
|
+
return {
|
|
6
|
+
definition: {
|
|
7
|
+
type: 'function',
|
|
8
|
+
function: {
|
|
9
|
+
name: 'word_work_request',
|
|
10
|
+
description: 'Microsoft Word 전문 에이전트에게 작업을 요청합니다. 문서 생성/편집, 서식, 표, 이미지, 헤더/푸터, 북마크, PDF 내보내기 등 모든 Word 작업을 수행할 수 있습니다. 자연어로 원하는 작업을 지시하세요.',
|
|
11
|
+
parameters: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
instruction: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: '수행할 Word 작업에 대한 자연어 지시',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ['instruction'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
execute: async (args, llmClient) => {
|
|
24
|
+
const agent = new OfficeSubAgent(llmClient, 'word', WORD_TOOLS, WORD_SYSTEM_PROMPT);
|
|
25
|
+
return agent.run(args['instruction']);
|
|
26
|
+
},
|
|
27
|
+
categories: ['llm-agent'],
|
|
28
|
+
requiresSubLLM: true,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=word-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"word-agent.js","sourceRoot":"","sources":["../../../src/agents/office/word-agent.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,UAAU,yBAAyB;IACvC,OAAO;QACL,UAAU,EAAE;YACV,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACR,IAAI,EAAE,mBAAmB;gBACzB,WAAW,EACT,8HAA8H;gBAChI,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,wBAAwB;yBACtC;qBACF;oBACD,QAAQ,EAAE,CAAC,aAAa,CAAC;iBAC1B;aACF;SACF;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;YACjC,MAAM,KAAK,GAAG,IAAI,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;YACpF,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAW,CAAC,CAAC;QAClD,CAAC;QACD,UAAU,EAAE,CAAC,WAAW,CAAC;QACzB,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const PROJECTS_DIR: string;
|
|
|
7
7
|
export declare const CREDENTIALS_FILE_PATH: string;
|
|
8
8
|
export declare const APP_NAME = "hanseol-dev";
|
|
9
9
|
export declare const SERVICE_ID = "hanseol";
|
|
10
|
-
export declare const APP_VERSION = "5.0.
|
|
10
|
+
export declare const APP_VERSION = "5.0.1-dev.1";
|
|
11
11
|
export declare const DASHBOARD_URL = "https://52.78.246.50.nip.io";
|
|
12
12
|
export declare const ONCE_URL = "https://52.78.246.50.nip.io:5090";
|
|
13
13
|
export declare const FREE_URL = "https://52.78.246.50.nip.io:6090";
|
package/dist/constants.js
CHANGED
|
@@ -9,7 +9,7 @@ export const PROJECTS_DIR = path.join(LOCAL_HOME_DIR, 'projects');
|
|
|
9
9
|
export const CREDENTIALS_FILE_PATH = path.join(LOCAL_HOME_DIR, 'credentials.json');
|
|
10
10
|
export const APP_NAME = 'hanseol-dev';
|
|
11
11
|
export const SERVICE_ID = 'hanseol';
|
|
12
|
-
export const APP_VERSION = '5.0.
|
|
12
|
+
export const APP_VERSION = '5.0.1-dev.1';
|
|
13
13
|
export const DASHBOARD_URL = 'https://52.78.246.50.nip.io';
|
|
14
14
|
export const ONCE_URL = 'https://52.78.246.50.nip.io:5090';
|
|
15
15
|
export const FREE_URL = 'https://52.78.246.50.nip.io:6090';
|
|
@@ -13,13 +13,13 @@ export interface AutoSyncResult {
|
|
|
13
13
|
success: boolean;
|
|
14
14
|
count: number;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
freeTodoCreated?: {
|
|
17
17
|
success: boolean;
|
|
18
18
|
count: number;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
freeTodoCompleted?: {
|
|
21
21
|
success: boolean;
|
|
22
|
-
|
|
22
|
+
count: number;
|
|
23
23
|
};
|
|
24
24
|
loginRequired?: boolean;
|
|
25
25
|
setupRequired?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-sync.d.ts","sourceRoot":"","sources":["../../src/core/background-sync.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhD,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAM3D,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,cAAc,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,gBAAgB,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,
|
|
1
|
+
{"version":3,"file":"background-sync.d.ts","sourceRoot":"","sources":["../../src/core/background-sync.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhD,OAA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