@olane/o-lane 0.7.12-alpha.9 → 0.7.12
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/src/capabilities/enums/o-capability.type-enum.d.ts +1 -0
- package/dist/src/capabilities/enums/o-capability.type-enum.d.ts.map +1 -1
- package/dist/src/capabilities/enums/o-capability.type-enum.js +1 -0
- package/dist/src/capabilities/interfaces/o-capability.config.d.ts +4 -2
- package/dist/src/capabilities/interfaces/o-capability.config.d.ts.map +1 -1
- package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts +1 -0
- package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts.map +1 -1
- package/dist/src/capabilities/o-capability.d.ts +3 -2
- package/dist/src/capabilities/o-capability.d.ts.map +1 -1
- package/dist/src/capabilities/o-capability.intelligence.d.ts.map +1 -1
- package/dist/src/capabilities/o-capability.intelligence.js +33 -8
- package/dist/src/capabilities/o-capability.js +3 -0
- package/dist/src/capabilities/o-capability.result.d.ts +2 -0
- package/dist/src/capabilities/o-capability.result.d.ts.map +1 -1
- package/dist/src/capabilities/o-capability.result.js +2 -0
- package/dist/src/capabilities/utils/result-stream-parser.d.ts +37 -0
- package/dist/src/capabilities/utils/result-stream-parser.d.ts.map +1 -0
- package/dist/src/capabilities/utils/result-stream-parser.js +90 -0
- package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts +1 -0
- package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts.map +1 -1
- package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts +2 -0
- package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts.map +1 -1
- package/dist/src/capabilities-multiple-step/o-capability.multiple-step.js +12 -0
- package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts +1 -0
- package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts.map +1 -1
- package/dist/src/capabilities-search/o-capability.search.d.ts.map +1 -1
- package/dist/src/capabilities-search/o-capability.search.js +24 -6
- package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts +1 -0
- package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts.map +1 -1
- package/dist/src/capabilities-task/o-capability.task.d.ts.map +1 -1
- package/dist/src/capabilities-task/o-capability.task.js +4 -0
- package/dist/src/errors/capability-errors.d.ts +71 -0
- package/dist/src/errors/capability-errors.d.ts.map +1 -0
- package/dist/src/errors/capability-errors.js +142 -0
- package/dist/src/errors/index.d.ts +5 -0
- package/dist/src/errors/index.d.ts.map +1 -0
- package/dist/src/errors/index.js +4 -0
- package/dist/src/formatters/index.d.ts +7 -0
- package/dist/src/formatters/index.d.ts.map +1 -0
- package/dist/src/formatters/index.js +6 -0
- package/dist/src/formatters/markdown-builder.d.ts +65 -0
- package/dist/src/formatters/markdown-builder.d.ts.map +1 -0
- package/dist/src/formatters/markdown-builder.js +120 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/interfaces/o-lane.config.d.ts +5 -2
- package/dist/src/interfaces/o-lane.config.d.ts.map +1 -1
- package/dist/src/o-lane.d.ts +8 -1
- package/dist/src/o-lane.d.ts.map +1 -1
- package/dist/src/o-lane.js +165 -23
- package/dist/src/o-lane.mixin.d.ts +17 -0
- package/dist/src/o-lane.mixin.d.ts.map +1 -0
- package/dist/src/o-lane.mixin.js +136 -0
- package/dist/src/o-lane.tool.d.ts +12 -19
- package/dist/src/o-lane.tool.d.ts.map +1 -1
- package/dist/src/o-lane.tool.js +11 -93
- package/dist/src/prompts/agent.prompt.d.ts +11 -0
- package/dist/src/prompts/agent.prompt.d.ts.map +1 -1
- package/dist/src/prompts/agent.prompt.js +34 -10
- package/dist/src/prompts/configure.prompt.d.ts +7 -0
- package/dist/src/prompts/configure.prompt.d.ts.map +1 -1
- package/dist/src/prompts/configure.prompt.js +8 -1
- package/dist/src/prompts/custom.prompt.d.ts +7 -0
- package/dist/src/prompts/custom.prompt.d.ts.map +1 -1
- package/dist/src/prompts/custom.prompt.js +77 -0
- package/dist/src/storage/index.d.ts +8 -0
- package/dist/src/storage/index.d.ts.map +1 -0
- package/dist/src/storage/index.js +12 -0
- package/dist/src/storage/interfaces/prompt-storage.interface.d.ts +102 -0
- package/dist/src/storage/interfaces/prompt-storage.interface.d.ts.map +1 -0
- package/dist/src/storage/interfaces/prompt-storage.interface.js +1 -0
- package/dist/src/storage/methods/prompt-storage.methods.d.ts +9 -0
- package/dist/src/storage/methods/prompt-storage.methods.d.ts.map +1 -0
- package/dist/src/storage/methods/prompt-storage.methods.js +338 -0
- package/dist/src/storage/prompt-loader.d.ts +40 -0
- package/dist/src/storage/prompt-loader.d.ts.map +1 -0
- package/dist/src/storage/prompt-loader.js +126 -0
- package/dist/src/storage/prompt-schema.d.ts +42 -0
- package/dist/src/storage/prompt-schema.d.ts.map +1 -0
- package/dist/src/storage/prompt-schema.js +29 -0
- package/dist/src/storage/prompt-seeder.d.ts +42 -0
- package/dist/src/storage/prompt-seeder.d.ts.map +1 -0
- package/dist/src/storage/prompt-seeder.js +141 -0
- package/dist/src/storage/prompt-storage-provider.tool.d.ts +99 -0
- package/dist/src/storage/prompt-storage-provider.tool.d.ts.map +1 -0
- package/dist/src/storage/prompt-storage-provider.tool.js +320 -0
- package/dist/test/prompt-seeder.spec.d.ts +2 -0
- package/dist/test/prompt-seeder.spec.d.ts.map +1 -0
- package/dist/test/prompt-seeder.spec.js +254 -0
- package/dist/test/prompt-storage-provider.spec.d.ts +2 -0
- package/dist/test/prompt-storage-provider.spec.d.ts.map +1 -0
- package/dist/test/prompt-storage-provider.spec.js +456 -0
- package/package.json +10 -7
- package/dist/test/ai.spec.d.ts +0 -2
- package/dist/test/ai.spec.d.ts.map +0 -1
- package/dist/test/ai.spec.js +0 -19
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { CUSTOM_AGENT_PROMPT } from './custom.prompt.js';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Cycle instructions for seeding - extracted from agent workflow
|
|
4
|
+
*/
|
|
5
|
+
export const CYCLE_INSTRUCTIONS_SEED = `
|
|
3
6
|
Every Step Instructions:
|
|
4
7
|
1. Review the provided user intent, context and agent history
|
|
5
8
|
2. If you can complete the user intent, return the "Stop Response" using the [RETURN INSTRUCTIONS] steps
|
|
@@ -43,12 +46,22 @@ Step 5 - Use target tool address
|
|
|
43
46
|
|
|
44
47
|
Step 6 - Review the tool use results
|
|
45
48
|
1. Analyze each tool use result
|
|
46
|
-
2.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
2. When formatting tool results for the user in a Stop Response, present as clean markdown:
|
|
50
|
+
- For general contexts, present as clean markdown:
|
|
51
|
+
* Use headings to organize different sections
|
|
52
|
+
* Use lists for multiple items
|
|
53
|
+
* Use bold for important values or labels
|
|
54
|
+
* Use code blocks for addresses (e.g., \`o://tool-address\`)
|
|
55
|
+
* Transform raw JSON into readable prose and structured lists
|
|
56
|
+
3. In the summary field, provide a 1-2 sentence overview
|
|
57
|
+
4. If it failed, clearly explain why in a user-friendly way
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
`;
|
|
61
|
+
/**
|
|
62
|
+
* Output instructions for seeding - extracted from return format specifications
|
|
63
|
+
*/
|
|
64
|
+
export const OUTPUT_INSTRUCTIONS_SEED = `
|
|
52
65
|
[RETURN INSTRUCTIONS BEGIN]
|
|
53
66
|
These are the types of cycle responses: "Complex Intent Response", "Search Response", "Use Tool Response", "Stop Response", "Error Response", "Configure Response".
|
|
54
67
|
|
|
@@ -58,6 +71,7 @@ All Return Step Instructions:
|
|
|
58
71
|
3. Output the respective results using the matching output type.
|
|
59
72
|
4. Generate a reasoning key value pair for why this result was returned.
|
|
60
73
|
5. The reasoning should be no longer than 1 sentence.
|
|
74
|
+
6. The summary should be a short message used to inform the user of the result of the cycle. These updates should be insightful and concise and within 1-2 sentences.
|
|
61
75
|
6. Do not include \`\`\`json or \`\`\` in your output.
|
|
62
76
|
|
|
63
77
|
Complex Intent Results:
|
|
@@ -67,6 +81,7 @@ Complex Intent Results:
|
|
|
67
81
|
"simple intent 2",
|
|
68
82
|
"simple intent 3",
|
|
69
83
|
],
|
|
84
|
+
"summary": string,
|
|
70
85
|
"reasoning": string,
|
|
71
86
|
"type": "multiple_step",
|
|
72
87
|
}
|
|
@@ -76,6 +91,7 @@ Configure Response:
|
|
|
76
91
|
"intent": string,
|
|
77
92
|
"toolAddress": string,
|
|
78
93
|
"reasoning": string,
|
|
94
|
+
"summary": string,
|
|
79
95
|
"type": "configure",
|
|
80
96
|
}
|
|
81
97
|
|
|
@@ -89,20 +105,23 @@ Search Response:
|
|
|
89
105
|
],
|
|
90
106
|
"isExternal": boolean,
|
|
91
107
|
"reasoning": string,
|
|
108
|
+
"summary": string,
|
|
92
109
|
"type": "search",
|
|
93
110
|
}
|
|
94
111
|
|
|
95
112
|
Stop Response:
|
|
96
113
|
{
|
|
97
|
-
"result": string,
|
|
114
|
+
"result": string, // IMPORTANT: Format this as clean, readable markdown. Use headers (##, ###), lists (-, 1.), bold (**text**), and code blocks (\`code\`) to make the response easy to read. Structure tool outputs, search results, and data clearly. Focus on what the user needs to know, not raw data dumps.
|
|
98
115
|
"reasoning": string,
|
|
99
116
|
"addresses_to_index": [string], // COMMENT: If the results of a tool use include "address_to_index", list them in the "addresses_to_index" array.
|
|
117
|
+
"summary": string, // A concise 1-2 sentence summary for the user
|
|
100
118
|
"type": "stop",
|
|
101
119
|
}
|
|
102
120
|
|
|
103
121
|
Error Response:
|
|
104
122
|
{
|
|
105
123
|
"result": "string explaining the error",
|
|
124
|
+
"summary": string,
|
|
106
125
|
"reasoning": string,
|
|
107
126
|
"type": "evaluate",
|
|
108
127
|
}
|
|
@@ -112,9 +131,14 @@ Use Tool Response:
|
|
|
112
131
|
"task": {
|
|
113
132
|
"address": string,
|
|
114
133
|
"payload": { "method": string, "params": any }
|
|
115
|
-
}
|
|
134
|
+
},
|
|
135
|
+
"summary": string,
|
|
116
136
|
"type": "task",
|
|
117
137
|
}
|
|
118
138
|
[RETURN INSTRUCTIONS END]
|
|
119
139
|
|
|
120
|
-
|
|
140
|
+
`;
|
|
141
|
+
/**
|
|
142
|
+
* Runtime agent prompt function with parameter interpolation
|
|
143
|
+
*/
|
|
144
|
+
export const AGENT_PROMPT = (intent, context, agentHistory, extraInstructions) => CUSTOM_AGENT_PROMPT(intent, context, agentHistory, CYCLE_INSTRUCTIONS_SEED, OUTPUT_INSTRUCTIONS_SEED, extraInstructions);
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configure instructions for seeding - extracted from configure capability
|
|
3
|
+
*/
|
|
4
|
+
export declare const CONFIGURE_INSTRUCTIONS_SEED = "\n Configure Request Instructions:\n1. Review the provided user intent and context\n2. If you can complete the user intent, return the answer using the [RETURN INSTRUCTIONS] steps\n3. If you experience an error trying to use a tool more than 2 times, stop here and follow the [RETURN INSTRUCTIONS] steps to indicate the error.\n3. Review the current step number and perform the instructions associated with that step.\n4. Start with step 1\n\nStep 1 - Validate the intent\n1. If the intent is not a configure request, continue to step 5\n2. If the context provided would suggest that the intent is already solved, continue to step 5\n2. Continue to step 2\n\nStep 2 - Choose Method\n1. Review the method options and metadata to determine the best method to resolve the user's intent.\n2. Choose the best method to resolve the user's intent.\n3. Continue to step 3\n\nStep 3 - Select Parameters\n1. Review the parameters for the selected best method.\n2. Extract the parameter values from the agent history, provided context and intent. Do NOT use a parameter value that is not mentioned previously.\n3. Do not use placeholder values for parameter values.\n4. Do not use parameter values that are not explicitly mentioned in the agent history, provided context or intent.\n3. Identify missing parameter values.\n4. If you have enough information to complete the configure request, go to step 5.\n5. Continue to step 4\n\nStep 4 - Search for missing parameter values\n1. Identify other methods that can be used to resolve the missing parameter values.\n2. Identify methods that can be used to resolve the missing parameter values.\n3. Continue to step 5\n\nStep 5 - Finish\n1. If the intent seems to be already solved, return answer results.\n1. If this is not a configure request, return an error.\n2. If you are missing parameter values, generate the intents for the \"Complex Intent\" results using other methods or search to help.\n2. If you have enough information to complete the configure request, follow the [RETURN INSTRUCTIONS] steps to return the \"configure results\".\n3. If you do not have enough information to complete the configure request, return an error.\n\n ";
|
|
5
|
+
/**
|
|
6
|
+
* Alias for backwards compatibility - runtime usage
|
|
7
|
+
*/
|
|
1
8
|
export declare const CONFIGURE_INSTRUCTIONS = "\n Configure Request Instructions:\n1. Review the provided user intent and context\n2. If you can complete the user intent, return the answer using the [RETURN INSTRUCTIONS] steps\n3. If you experience an error trying to use a tool more than 2 times, stop here and follow the [RETURN INSTRUCTIONS] steps to indicate the error.\n3. Review the current step number and perform the instructions associated with that step.\n4. Start with step 1\n\nStep 1 - Validate the intent\n1. If the intent is not a configure request, continue to step 5\n2. If the context provided would suggest that the intent is already solved, continue to step 5\n2. Continue to step 2\n\nStep 2 - Choose Method\n1. Review the method options and metadata to determine the best method to resolve the user's intent.\n2. Choose the best method to resolve the user's intent.\n3. Continue to step 3\n\nStep 3 - Select Parameters\n1. Review the parameters for the selected best method.\n2. Extract the parameter values from the agent history, provided context and intent. Do NOT use a parameter value that is not mentioned previously.\n3. Do not use placeholder values for parameter values.\n4. Do not use parameter values that are not explicitly mentioned in the agent history, provided context or intent.\n3. Identify missing parameter values.\n4. If you have enough information to complete the configure request, go to step 5.\n5. Continue to step 4\n\nStep 4 - Search for missing parameter values\n1. Identify other methods that can be used to resolve the missing parameter values.\n2. Identify methods that can be used to resolve the missing parameter values.\n3. Continue to step 5\n\nStep 5 - Finish\n1. If the intent seems to be already solved, return answer results.\n1. If this is not a configure request, return an error.\n2. If you are missing parameter values, generate the intents for the \"Complex Intent\" results using other methods or search to help.\n2. If you have enough information to complete the configure request, follow the [RETURN INSTRUCTIONS] steps to return the \"configure results\".\n3. If you do not have enough information to complete the configure request, return an error.\n\n ";
|
|
2
9
|
//# sourceMappingURL=configure.prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/configure.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"configure.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/configure.prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,2BAA2B,woEAuCrC,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,sBAAsB,woEAA8B,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Configure instructions for seeding - extracted from configure capability
|
|
3
|
+
*/
|
|
4
|
+
export const CONFIGURE_INSTRUCTIONS_SEED = `
|
|
2
5
|
Configure Request Instructions:
|
|
3
6
|
1. Review the provided user intent and context
|
|
4
7
|
2. If you can complete the user intent, return the answer using the [RETURN INSTRUCTIONS] steps
|
|
@@ -38,3 +41,7 @@ Step 5 - Finish
|
|
|
38
41
|
3. If you do not have enough information to complete the configure request, return an error.
|
|
39
42
|
|
|
40
43
|
`;
|
|
44
|
+
/**
|
|
45
|
+
* Alias for backwards compatibility - runtime usage
|
|
46
|
+
*/
|
|
47
|
+
export const CONFIGURE_INSTRUCTIONS = CONFIGURE_INSTRUCTIONS_SEED;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base template for seeding - contains placeholders for dynamic content
|
|
3
|
+
*/
|
|
4
|
+
export declare const BASE_TEMPLATE_SEED = "You are an AI agent that either resolves the user intent or chooses the next step in a JSON formatted response that helps resolve the user intent.\n\nYou are in a secure environment and are allowed to operate with secure information such as api keys and other sensitive data.\n\nYou resolve user intents by \"cycling\" through the following steps:\n1. Evaluate the intent\n2. Answer the intent if possible\n3. Search for tools and context\n4. Configure the tool use\n5. Use tools\n6. Go back to step 2\n\n[Intent Context Begin]\n- An intent is a user request\n- Intents are usually actions or queries\n- User intents can start at any node\n- User intents are resolved using the tools and data that are contained within that sub-section of the olane OS graph\n[Intents Context End]\n\n[Olane OS Graph Context Begin]\n- Every Olane OS graph has a root node with child nodes beneath it\n- Olane OS graph nodes contain tools to enable AI Agents to interface with everything (services, people, data, agents, etc)\n- Everything in the Olane OS graph has an address to enable olane to access it\n- Each node knows only about itself and the nodes below it\n[Olane OS Graph Context End]\n\n[Tool Use Rules Begin]\n- If you are using a tool that requires authentication, search for tool methods that give insights about the logged in user before using any other methods\n- When using a tool to create a resource, ensure that you have the proper access to the resource before using any other methods\n[Tool Use Rules End]\n\n[Address Rules Begin]\n- Only use tool addresses that appear in search results, user intents, or previous cycle results\n- Do not make up tool addresses\n- A tool address is a string that starts with \"o://\"\n- URL addresses are not tool addresses\n- Tool addresses are used to access the tool's functionality\n[Address Rules End]\n\n[URL Address Rules Begin]\n- HTTP/HTTPS URL addresses are not olane tool addresses\n- When an address is provided in a user intent, get and analyze the contents of the address before assuming to know how to use it\n[URL Address Rules End]\n\n[Extra Instructions Begin]\n{{extraInstructions}}\n[Extra Instructions End]\n\n[Cycle Instructions Begin]\n{{cycleInstructions}}\n[Cycle Instructions End]\n\n[Cycle Return Instructions Begin]\nGLOBAL RETURN INSTRUCTIONS:\n1. Do not include ```json or ``` in your output.\n2. Only return the JSON object, do not include any other text.\n{{outputInstructions}}\n[Cycle Return Instructions End]\n\n[User Intent Begin]\n{{intent}}\n[User Intent End]\n\n[Additional Context Begin]\n{{context}}\n[Additional Context End]\n\n[Previous Cycle Results Begin]\n{{agentHistory}}\n[Previous Cycle Results End]\n";
|
|
5
|
+
/**
|
|
6
|
+
* Runtime template function with parameter interpolation
|
|
7
|
+
*/
|
|
1
8
|
export declare const CUSTOM_AGENT_PROMPT: (intent: string, context: string, agentHistory: string, cycleInstructions: string, outputInstructions: string, extraInstructions: string) => string;
|
|
2
9
|
//# sourceMappingURL=custom.prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/custom.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,WACtB,MAAM,WACL,MAAM,gBACD,MAAM,qBACD,MAAM,sBACL,MAAM,qBACP,MAAM,WAyE1B,CAAC"}
|
|
1
|
+
{"version":3,"file":"custom.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/custom.prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,kBAAkB,soFAsE9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,WACtB,MAAM,WACL,MAAM,gBACD,MAAM,qBACD,MAAM,sBACL,MAAM,qBACP,MAAM,WAyE1B,CAAC"}
|
|
@@ -1,3 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base template for seeding - contains placeholders for dynamic content
|
|
3
|
+
*/
|
|
4
|
+
export const BASE_TEMPLATE_SEED = `You are an AI agent that either resolves the user intent or chooses the next step in a JSON formatted response that helps resolve the user intent.
|
|
5
|
+
|
|
6
|
+
You are in a secure environment and are allowed to operate with secure information such as api keys and other sensitive data.
|
|
7
|
+
|
|
8
|
+
You resolve user intents by "cycling" through the following steps:
|
|
9
|
+
1. Evaluate the intent
|
|
10
|
+
2. Answer the intent if possible
|
|
11
|
+
3. Search for tools and context
|
|
12
|
+
4. Configure the tool use
|
|
13
|
+
5. Use tools
|
|
14
|
+
6. Go back to step 2
|
|
15
|
+
|
|
16
|
+
[Intent Context Begin]
|
|
17
|
+
- An intent is a user request
|
|
18
|
+
- Intents are usually actions or queries
|
|
19
|
+
- User intents can start at any node
|
|
20
|
+
- User intents are resolved using the tools and data that are contained within that sub-section of the olane OS graph
|
|
21
|
+
[Intents Context End]
|
|
22
|
+
|
|
23
|
+
[Olane OS Graph Context Begin]
|
|
24
|
+
- Every Olane OS graph has a root node with child nodes beneath it
|
|
25
|
+
- Olane OS graph nodes contain tools to enable AI Agents to interface with everything (services, people, data, agents, etc)
|
|
26
|
+
- Everything in the Olane OS graph has an address to enable olane to access it
|
|
27
|
+
- Each node knows only about itself and the nodes below it
|
|
28
|
+
[Olane OS Graph Context End]
|
|
29
|
+
|
|
30
|
+
[Tool Use Rules Begin]
|
|
31
|
+
- If you are using a tool that requires authentication, search for tool methods that give insights about the logged in user before using any other methods
|
|
32
|
+
- When using a tool to create a resource, ensure that you have the proper access to the resource before using any other methods
|
|
33
|
+
[Tool Use Rules End]
|
|
34
|
+
|
|
35
|
+
[Address Rules Begin]
|
|
36
|
+
- Only use tool addresses that appear in search results, user intents, or previous cycle results
|
|
37
|
+
- Do not make up tool addresses
|
|
38
|
+
- A tool address is a string that starts with "o://"
|
|
39
|
+
- URL addresses are not tool addresses
|
|
40
|
+
- Tool addresses are used to access the tool's functionality
|
|
41
|
+
[Address Rules End]
|
|
42
|
+
|
|
43
|
+
[URL Address Rules Begin]
|
|
44
|
+
- HTTP/HTTPS URL addresses are not olane tool addresses
|
|
45
|
+
- When an address is provided in a user intent, get and analyze the contents of the address before assuming to know how to use it
|
|
46
|
+
[URL Address Rules End]
|
|
47
|
+
|
|
48
|
+
[Extra Instructions Begin]
|
|
49
|
+
{{extraInstructions}}
|
|
50
|
+
[Extra Instructions End]
|
|
51
|
+
|
|
52
|
+
[Cycle Instructions Begin]
|
|
53
|
+
{{cycleInstructions}}
|
|
54
|
+
[Cycle Instructions End]
|
|
55
|
+
|
|
56
|
+
[Cycle Return Instructions Begin]
|
|
57
|
+
GLOBAL RETURN INSTRUCTIONS:
|
|
58
|
+
1. Do not include \`\`\`json or \`\`\` in your output.
|
|
59
|
+
2. Only return the JSON object, do not include any other text.
|
|
60
|
+
{{outputInstructions}}
|
|
61
|
+
[Cycle Return Instructions End]
|
|
62
|
+
|
|
63
|
+
[User Intent Begin]
|
|
64
|
+
{{intent}}
|
|
65
|
+
[User Intent End]
|
|
66
|
+
|
|
67
|
+
[Additional Context Begin]
|
|
68
|
+
{{context}}
|
|
69
|
+
[Additional Context End]
|
|
70
|
+
|
|
71
|
+
[Previous Cycle Results Begin]
|
|
72
|
+
{{agentHistory}}
|
|
73
|
+
[Previous Cycle Results End]
|
|
74
|
+
`;
|
|
75
|
+
/**
|
|
76
|
+
* Runtime template function with parameter interpolation
|
|
77
|
+
*/
|
|
1
78
|
export const CUSTOM_AGENT_PROMPT = (intent, context, agentHistory, cycleInstructions, outputInstructions, extraInstructions) => `
|
|
2
79
|
You are an AI agent that either resolves the user intent or chooses the next step in a JSON formatted response that helps resolve the user intent.
|
|
3
80
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './prompt-storage-provider.tool.js';
|
|
2
|
+
export * from './interfaces/prompt-storage.interface.js';
|
|
3
|
+
export * from './methods/prompt-storage.methods.js';
|
|
4
|
+
export * from './prompt-schema.js';
|
|
5
|
+
export * from './prompt-seeder.js';
|
|
6
|
+
export * from './prompt-loader.js';
|
|
7
|
+
export * from './o-lane.storage.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/index.ts"],"names":[],"mappings":"AACA,cAAc,mCAAmC,CAAC;AAGlD,cAAc,0CAA0C,CAAC;AAGzD,cAAc,qCAAqC,CAAC;AAGpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Prompt Storage Provider
|
|
2
|
+
export * from './prompt-storage-provider.tool.js';
|
|
3
|
+
// Interfaces
|
|
4
|
+
export * from './interfaces/prompt-storage.interface.js';
|
|
5
|
+
// Methods
|
|
6
|
+
export * from './methods/prompt-storage.methods.js';
|
|
7
|
+
// Prompt Management
|
|
8
|
+
export * from './prompt-schema.js';
|
|
9
|
+
export * from './prompt-seeder.js';
|
|
10
|
+
export * from './prompt-loader.js';
|
|
11
|
+
// Existing storage
|
|
12
|
+
export * from './o-lane.storage.js';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { oNodeConfig } from '@olane/o-node';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for PromptStorageProvider
|
|
4
|
+
* Extends standard node tool configuration
|
|
5
|
+
*/
|
|
6
|
+
export interface PromptStorageConfig extends oNodeConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Maximum number of prompts to keep in storage
|
|
9
|
+
* Oldest prompts will be evicted when limit is reached
|
|
10
|
+
* @default undefined (no limit)
|
|
11
|
+
*/
|
|
12
|
+
maxPrompts?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Time-to-live for inactive prompts in milliseconds
|
|
15
|
+
* Prompts not accessed within this time will be automatically cleared
|
|
16
|
+
* @default undefined (no automatic cleanup)
|
|
17
|
+
*/
|
|
18
|
+
promptTTL?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Interval for running cleanup checks in milliseconds
|
|
21
|
+
* @default 60000 (1 minute)
|
|
22
|
+
*/
|
|
23
|
+
cleanupInterval?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Statistics for a prompt namespace
|
|
27
|
+
*/
|
|
28
|
+
export interface PromptStats {
|
|
29
|
+
/**
|
|
30
|
+
* The prompt identifier
|
|
31
|
+
*/
|
|
32
|
+
promptId: string;
|
|
33
|
+
/**
|
|
34
|
+
* Number of keys stored in this prompt
|
|
35
|
+
*/
|
|
36
|
+
keyCount: number;
|
|
37
|
+
/**
|
|
38
|
+
* Timestamp of last access (read or write) in milliseconds
|
|
39
|
+
*/
|
|
40
|
+
lastAccessed: number;
|
|
41
|
+
/**
|
|
42
|
+
* Whether this prompt currently exists in storage
|
|
43
|
+
*/
|
|
44
|
+
exists: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Timestamp when the prompt was created in milliseconds
|
|
47
|
+
*/
|
|
48
|
+
createdAt?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Response for list_prompts method
|
|
52
|
+
*/
|
|
53
|
+
export interface ListPromptsResponse {
|
|
54
|
+
/**
|
|
55
|
+
* Array of prompt IDs with active storage
|
|
56
|
+
*/
|
|
57
|
+
promptIds: string[];
|
|
58
|
+
/**
|
|
59
|
+
* Total count of prompts
|
|
60
|
+
*/
|
|
61
|
+
count: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Response for get_prompt_keys method
|
|
65
|
+
*/
|
|
66
|
+
export interface PromptKeysResponse {
|
|
67
|
+
/**
|
|
68
|
+
* Array of keys in the prompt namespace
|
|
69
|
+
*/
|
|
70
|
+
keys: string[];
|
|
71
|
+
/**
|
|
72
|
+
* Total count of keys
|
|
73
|
+
*/
|
|
74
|
+
count: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Response for clear_prompt method
|
|
78
|
+
*/
|
|
79
|
+
export interface ClearPromptResponse {
|
|
80
|
+
/**
|
|
81
|
+
* Whether the operation succeeded
|
|
82
|
+
*/
|
|
83
|
+
success: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Number of keys that were deleted
|
|
86
|
+
*/
|
|
87
|
+
keysDeleted: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Internal metadata tracked per prompt
|
|
91
|
+
*/
|
|
92
|
+
export interface PromptMetadata {
|
|
93
|
+
/**
|
|
94
|
+
* Timestamp when prompt was created
|
|
95
|
+
*/
|
|
96
|
+
createdAt: number;
|
|
97
|
+
/**
|
|
98
|
+
* Timestamp of last access
|
|
99
|
+
*/
|
|
100
|
+
lastAccessed: number;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=prompt-storage.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-storage.interface.d.ts","sourceRoot":"","sources":["../../../../src/storage/interfaces/prompt-storage.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { oMethod } from '@olane/o-protocol';
|
|
2
|
+
/**
|
|
3
|
+
* Method definitions for prompt-specific storage operations
|
|
4
|
+
* Extends standard storage with promptId namespace isolation
|
|
5
|
+
*/
|
|
6
|
+
export declare const PROMPT_STORAGE_METHODS: {
|
|
7
|
+
[key: string]: oMethod;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=prompt-storage.methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-storage.methods.d.ts","sourceRoot":"","sources":["../../../../src/storage/methods/prompt-storage.methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CA0V5D,CAAC"}
|