@olane/o-lane 0.7.12-alpha.76 → 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.
Files changed (84) hide show
  1. package/dist/src/index.d.ts +1 -1
  2. package/dist/src/index.d.ts.map +1 -1
  3. package/dist/src/index.js +1 -2
  4. package/dist/src/prompts/agent.prompt.d.ts +11 -0
  5. package/dist/src/prompts/agent.prompt.d.ts.map +1 -1
  6. package/dist/src/prompts/agent.prompt.js +14 -3
  7. package/dist/src/prompts/configure.prompt.d.ts +7 -0
  8. package/dist/src/prompts/configure.prompt.d.ts.map +1 -1
  9. package/dist/src/prompts/configure.prompt.js +8 -1
  10. package/dist/src/prompts/custom.prompt.d.ts +7 -0
  11. package/dist/src/prompts/custom.prompt.d.ts.map +1 -1
  12. package/dist/src/prompts/custom.prompt.js +77 -0
  13. package/dist/src/storage/index.d.ts +8 -0
  14. package/dist/src/storage/index.d.ts.map +1 -0
  15. package/dist/src/storage/index.js +12 -0
  16. package/dist/src/storage/interfaces/prompt-storage.interface.d.ts +102 -0
  17. package/dist/src/storage/interfaces/prompt-storage.interface.d.ts.map +1 -0
  18. package/dist/src/storage/methods/prompt-storage.methods.d.ts +9 -0
  19. package/dist/src/storage/methods/prompt-storage.methods.d.ts.map +1 -0
  20. package/dist/src/storage/methods/prompt-storage.methods.js +338 -0
  21. package/dist/src/storage/prompt-loader.d.ts +40 -0
  22. package/dist/src/storage/prompt-loader.d.ts.map +1 -0
  23. package/dist/src/storage/prompt-loader.js +126 -0
  24. package/dist/src/storage/prompt-schema.d.ts +42 -0
  25. package/dist/src/storage/prompt-schema.d.ts.map +1 -0
  26. package/dist/src/storage/prompt-schema.js +29 -0
  27. package/dist/src/storage/prompt-seeder.d.ts +42 -0
  28. package/dist/src/storage/prompt-seeder.d.ts.map +1 -0
  29. package/dist/src/storage/prompt-seeder.js +141 -0
  30. package/dist/src/storage/prompt-storage-provider.tool.d.ts +99 -0
  31. package/dist/src/storage/prompt-storage-provider.tool.d.ts.map +1 -0
  32. package/dist/src/storage/prompt-storage-provider.tool.js +320 -0
  33. package/dist/test/prompt-seeder.spec.d.ts +2 -0
  34. package/dist/test/prompt-seeder.spec.d.ts.map +1 -0
  35. package/dist/test/prompt-seeder.spec.js +254 -0
  36. package/dist/test/prompt-storage-provider.spec.d.ts +2 -0
  37. package/dist/test/prompt-storage-provider.spec.d.ts.map +1 -0
  38. package/dist/test/prompt-storage-provider.spec.js +456 -0
  39. package/package.json +10 -7
  40. package/dist/src/ag-ui/ag-ui-constants.d.ts +0 -90
  41. package/dist/src/ag-ui/ag-ui-constants.d.ts.map +0 -1
  42. package/dist/src/ag-ui/ag-ui-constants.js +0 -113
  43. package/dist/src/ag-ui/ag-ui-event-mapper.d.ts +0 -88
  44. package/dist/src/ag-ui/ag-ui-event-mapper.d.ts.map +0 -1
  45. package/dist/src/ag-ui/ag-ui-event-mapper.js +0 -487
  46. package/dist/src/ag-ui/ag-ui-olane.tool.d.ts +0 -45
  47. package/dist/src/ag-ui/ag-ui-olane.tool.d.ts.map +0 -1
  48. package/dist/src/ag-ui/ag-ui-olane.tool.js +0 -257
  49. package/dist/src/ag-ui/ag-ui-stream-manager.d.ts +0 -99
  50. package/dist/src/ag-ui/ag-ui-stream-manager.d.ts.map +0 -1
  51. package/dist/src/ag-ui/ag-ui-stream-manager.js +0 -160
  52. package/dist/src/ag-ui/ag-ui-utils.d.ts +0 -50
  53. package/dist/src/ag-ui/ag-ui-utils.d.ts.map +0 -1
  54. package/dist/src/ag-ui/ag-ui-utils.js +0 -287
  55. package/dist/src/ag-ui/index.d.ts +0 -17
  56. package/dist/src/ag-ui/index.d.ts.map +0 -1
  57. package/dist/src/ag-ui/index.js +0 -21
  58. package/dist/src/ag-ui/transports/ag-ui-transport.interface.d.ts +0 -44
  59. package/dist/src/ag-ui/transports/ag-ui-transport.interface.d.ts.map +0 -1
  60. package/dist/src/ag-ui/transports/ag-ui-transport.interface.js +0 -26
  61. package/dist/src/ag-ui/transports/callback-transport.d.ts +0 -13
  62. package/dist/src/ag-ui/transports/callback-transport.d.ts.map +0 -1
  63. package/dist/src/ag-ui/transports/callback-transport.js +0 -26
  64. package/dist/src/ag-ui/transports/console-transport.d.ts +0 -14
  65. package/dist/src/ag-ui/transports/console-transport.d.ts.map +0 -1
  66. package/dist/src/ag-ui/transports/console-transport.js +0 -63
  67. package/dist/src/ag-ui/transports/index.d.ts +0 -5
  68. package/dist/src/ag-ui/transports/index.d.ts.map +0 -1
  69. package/dist/src/ag-ui/transports/index.js +0 -4
  70. package/dist/src/ag-ui/transports/onode-transport.d.ts +0 -34
  71. package/dist/src/ag-ui/transports/onode-transport.d.ts.map +0 -1
  72. package/dist/src/ag-ui/transports/onode-transport.js +0 -83
  73. package/dist/src/ag-ui/types/ag-ui-config.interface.d.ts +0 -105
  74. package/dist/src/ag-ui/types/ag-ui-config.interface.d.ts.map +0 -1
  75. package/dist/src/ag-ui/types/ag-ui-event.types.d.ts +0 -266
  76. package/dist/src/ag-ui/types/ag-ui-event.types.d.ts.map +0 -1
  77. package/dist/src/ag-ui/types/ag-ui-event.types.js +0 -6
  78. package/dist/src/ag-ui/types/index.d.ts +0 -3
  79. package/dist/src/ag-ui/types/index.d.ts.map +0 -1
  80. package/dist/src/ag-ui/types/index.js +0 -2
  81. package/dist/test/ai.spec.d.ts +0 -2
  82. package/dist/test/ai.spec.d.ts.map +0 -1
  83. package/dist/test/ai.spec.js +0 -19
  84. /package/dist/src/{ag-ui/types/ag-ui-config.interface.js → storage/interfaces/prompt-storage.interface.js} +0 -0
@@ -15,5 +15,5 @@ export * from './capabilities-task/o-capability.task.js';
15
15
  export * from './prompts/custom.prompt.js';
16
16
  export * from './intent-encoder/index.js';
17
17
  export * from './enum/o-lane.status-enum.js';
18
- export * from './ag-ui/index.js';
18
+ export * from './storage/index.js';
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC;AACnE,cAAc,kDAAkD,CAAC;AACjE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAG7C,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC;AACnE,cAAc,kDAAkD,CAAC;AACjE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC"}
package/dist/src/index.js CHANGED
@@ -15,5 +15,4 @@ export * from './capabilities-task/o-capability.task.js';
15
15
  export * from './prompts/custom.prompt.js';
16
16
  export * from './intent-encoder/index.js';
17
17
  export * from './enum/o-lane.status-enum.js';
18
- // AG-UI Protocol Support
19
- export * from './ag-ui/index.js';
18
+ export * from './storage/index.js';
@@ -1,2 +1,13 @@
1
+ /**
2
+ * Cycle instructions for seeding - extracted from agent workflow
3
+ */
4
+ export declare const CYCLE_INSTRUCTIONS_SEED = "\n Every Step Instructions:\n1. Review the provided user intent, context and agent history\n2. If you can complete the user intent, return the \"Stop Response\" using the [RETURN INSTRUCTIONS] steps\n3. If the intent is already completed in past cycles, return the \"Stop Response\" using the [RETURN INSTRUCTIONS] steps\n4. If you experience 3 similar errors in a row, return the \"Stop Response\" indicating an error and follow the [RETURN INSTRUCTIONS] steps\n5. Review the current step number and perform the instructions associated with that step\n6. Start with step 1\n\nStep 1 - Evaluate the intent\n1. A complex step means there are multiple actions required to complete the user's intent\n2. If the intent is not-complex, continue to step 2\n3. If the intent is complex, break it up into a list of simple concise intents. Return the \"Complex Intent Response\" using the [RETURN INSTRUCTIONS]\n\nStep 2 - Search for tools and context\n1. If all entities and tool addresses are known within the user intent, continue to step 4\n2. If you know the tool address to use to complete the user intent, continue to step 4\n3. If there are unknown tool addresses or entities within the user intent, generate search queries to resolve the unknown entities. \n4. Use the o://mcp search tool to find model context protocol servers (MCP servers) that can help you add tooling that could help you complete the user intent.\n5. If there is a placeholder address used (o://.../placeholder), do not extract the contents of the placeholder address unless necessary for completing the user intent.\n6. Use the search results data & tooling to help you resolve the unknown entities.\n7. Continue to step 3.\n\nStep 3 - Filter Search Results\n1. If all search results are relevant to the user intent resolution, continue to step 4.\n2. Filter the search results for information that may contain supporting data or tooling that can help complete the user intent.\n3. If you do not see anything that can help you. Return the \"Stop Response\" using the [RETURN INSTRUCTIONS]\n4. Continue to step 4\n\nStep 4 - Configure the target tool address use\n1. Identify the tool address that most likely will help you complete the user intent.\n2. Review the provided context for past cycles that contain configuration instructions for the target tool address.\n3. If there is no configuration instructions for the target tool address, return the \"Configure Response\" using the [RETURN INSTRUCTIONS]\n4. Identify if there are any missing parameter values for the target tool address and search for them if so.\n5. If the tool use configuration is already known including all parameter values, continue to step 5\n\nStep 5 - Use target tool address\n1. If the target tool address configuration is known, return the \"Use Tool Response\" using the [RETURN INSTRUCTIONS]\n2. If the target tool address with the same configuration has failed in the past cycles, return the \"Error Response\" using the [RETURN INSTRUCTIONS] steps to indicate the error.\n3. Using this filtered tool list, return the \"Use Tool Response\" using the [RETURN INSTRUCTIONS] steps to return a series of addresses and respective intents to align with the current user intent resolution goal\n4. Continue to step 6\n\nStep 6 - Review the tool use results\n1. Analyze each tool use result\n2. When formatting tool results for the user in a Stop Response, present as clean markdown:\n - For general contexts, present as clean markdown:\n * Use headings to organize different sections\n * Use lists for multiple items\n * Use bold for important values or labels\n * Use code blocks for addresses (e.g., `o://tool-address`)\n * Transform raw JSON into readable prose and structured lists\n3. In the summary field, provide a 1-2 sentence overview\n4. If it failed, clearly explain why in a user-friendly way\n\n\n ";
5
+ /**
6
+ * Output instructions for seeding - extracted from return format specifications
7
+ */
8
+ export declare const OUTPUT_INSTRUCTIONS_SEED = "\n[RETURN INSTRUCTIONS BEGIN]\nThese are the types of cycle responses: \"Complex Intent Response\", \"Search Response\", \"Use Tool Response\", \"Stop Response\", \"Error Response\", \"Configure Response\".\n\nAll Return Step Instructions:\n1. Do not explain your reasoning process, just return the output in the correct format.\n2. Determine what type of results we have\n3. Output the respective results using the matching output type.\n4. Generate a reasoning key value pair for why this result was returned.\n5. The reasoning should be no longer than 1 sentence.\n6. 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.\n6. Do not include ```json or ``` in your output.\n\nComplex Intent Results:\n{\n \"intents\": [\n \"simple intent 1\",\n \"simple intent 2\",\n \"simple intent 3\",\n ],\n \"summary\": string,\n \"reasoning\": string,\n \"type\": \"multiple_step\",\n}\n\nConfigure Response:\n{\n \"intent\": string,\n \"toolAddress\": string,\n \"reasoning\": string,\n \"summary\": string,\n \"type\": \"configure\",\n}\n\nSearch Response:\n{\n \"queries\": [\n {\n \"query\": \"vector database query key terms to search for\",\n \"limit\": number,\n }\n ],\n \"isExternal\": boolean,\n \"reasoning\": string,\n \"summary\": string,\n \"type\": \"search\",\n}\n\nStop Response:\n{\n \"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.\n \"reasoning\": string,\n \"addresses_to_index\": [string], // COMMENT: If the results of a tool use include \"address_to_index\", list them in the \"addresses_to_index\" array.\n \"summary\": string, // A concise 1-2 sentence summary for the user\n \"type\": \"stop\",\n}\n\nError Response:\n{\n \"result\": \"string explaining the error\",\n \"summary\": string,\n \"reasoning\": string,\n \"type\": \"evaluate\",\n}\n\nUse Tool Response:\n{\n \"task\": {\n \"address\": string,\n \"payload\": { \"method\": string, \"params\": any }\n },\n \"summary\": string,\n \"type\": \"task\",\n}\n[RETURN INSTRUCTIONS END]\n\n ";
9
+ /**
10
+ * Runtime agent prompt function with parameter interpolation
11
+ */
1
12
  export declare const AGENT_PROMPT: (intent: string, context: string, agentHistory: string, extraInstructions: string) => string;
2
13
  //# sourceMappingURL=agent.prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/agent.prompt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,WACf,MAAM,WACL,MAAM,gBACD,MAAM,qBACD,MAAM,WA4IxB,CAAC"}
1
+ {"version":3,"file":"agent.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/agent.prompt.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,uBAAuB,izHAuDjC,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,wBAAwB,41EA4ElC,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,WACf,MAAM,WACL,MAAM,gBACD,MAAM,qBACD,MAAM,WASxB,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import { CUSTOM_AGENT_PROMPT } from './custom.prompt.js';
2
- export const AGENT_PROMPT = (intent, context, agentHistory, extraInstructions) => CUSTOM_AGENT_PROMPT(intent, context, agentHistory, `
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
@@ -54,7 +57,11 @@ Step 6 - Review the tool use results
54
57
  4. If it failed, clearly explain why in a user-friendly way
55
58
 
56
59
 
57
- `, `
60
+ `;
61
+ /**
62
+ * Output instructions for seeding - extracted from return format specifications
63
+ */
64
+ export const OUTPUT_INSTRUCTIONS_SEED = `
58
65
  [RETURN INSTRUCTIONS BEGIN]
59
66
  These are the types of cycle responses: "Complex Intent Response", "Search Response", "Use Tool Response", "Stop Response", "Error Response", "Configure Response".
60
67
 
@@ -130,4 +137,8 @@ Use Tool Response:
130
137
  }
131
138
  [RETURN INSTRUCTIONS END]
132
139
 
133
- `, extraInstructions);
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,woEAuChC,CAAC"}
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
- export const CONFIGURE_INSTRUCTIONS = `
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,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"}